---
title: "Register deployment key"
method: POST
path: "/v2/integrations/git/{providerId}/register-deployment-key"
tags: ["Users"]
---

# Register deployment key

`POST /v2/integrations/git/{providerId}/register-deployment-key`

## Request

- Base URL: `https://api.apify.com`
- URL: `https://api.apify.com/v2/integrations/git/{providerId}/register-deployment-key`
- Auth: one of:
  - HTTP bearer
  - API key in query parameter `token`

Registers the Actor's deployment key (a read-only SSH key generated for every Actor) on a repository through a
connected git account, so that Apify can clone the repository when building the Actor.

You need write access to the Actor. The repository's host must match the provider of the connected account.
If the key is already registered on the repository, nothing changes. On GitHub, registering the key on another
repository removes it from the previously linked one.

## Path parameters

- `providerId` string, required

## Request body

- RegisterDeploymentKeyRequest
  - `actorId` string, required: ID or `username~name` of the Actor whose deployment key to register.
  - `repoName` string, required: URL of the repository to register the key on. Its host must match the provider.

## Response `201`

- RegisterDeploymentKeyResponse
  - `data` object, required
    - `repoName` string, required: The normalized URL of the repository the key is registered on.

## Other responses

- `400`: Bad request - invalid input parameters or request body.
- `401`: Unauthorized - authentication required or invalid token.
- `403`: Forbidden - insufficient permissions to perform this action.
- `404`: Not found - the requested resource does not exist.
- `405`: Method not allowed.
- `413`: Payload too large - the request body exceeds the size limit.
- `415`: Unsupported media type - the Content-Encoding of the request is not supported.
- `429`: Too many requests - rate limit exceeded.

## Changes

> 25 revisions in range; 1 not diffed.

- **2026-10-27** `ec76185eb934`: 8 info
  - added the optional property `error/data` to the response with the `400` status
  - added the optional property `error/data` to the response with the `401` status
  - added the optional property `error/data` to the response with the `403` status
  - added the optional property `error/data` to the response with the `404` status
  - …4 more
- **2026-10-27** `e52dd2239cee`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/apify/apis/apify-api/changes/v2/integrations/git/:providerId/register-deployment-key/post.md)

---

[API](https://skmtc.dev/apify/apis/apify-api.md) - [All operations](https://skmtc.dev/apify/apis/apify-api/llms.txt) - [OpenAPI document](https://skmtc.dev/apify/apis/apify-api/revisions/68d2d102e6a2?raw)
