---
title: "Enable a deploy key"
method: POST
path: "/api/v4/projects/{id}/deploy_keys/{key_id}/enable"
tags: ["deploy_resources"]
---

# Enable a deploy key

`POST /api/v4/projects/{id}/deploy_keys/{key_id}/enable`

## Request

- Base URL: `https://gitlab.com`
- URL: `https://gitlab.com/api/v4/projects/{id}/deploy_keys/{key_id}/enable`
- Auth: none declared

Enables a deploy key for a project so this can be used. Returns the enabled key, with a status code 201 when successful.

## Path parameters

- `id` string, required
- `key_id` integer, required

## Response `201`

Enable a deploy key

- APIEntitiesDeployKey: API_Entities_DeployKey model
  - `id` integer, required
  - `title` string, required
  - `created_at` string, date-time, required
  - `expires_at` string, date-time, required
  - `last_used_at` string, date-time, required
  - `key` string, required
  - `usage_type` string, required
  - `fingerprint` string
  - `fingerprint_sha256` string, required
  - `projects_with_write_access` APIEntitiesProjectIdentity
    - `id` integer, required
    - `description` string, required
    - `name` string, required
    - `name_with_namespace` string, required
    - `path` string, required
    - `path_with_namespace` string, required
    - `created_at` string, date-time, required
  - `projects_with_readonly_access` APIEntitiesProjectIdentity
    - `id` integer, required
    - `description` string, required
    - `name` string, required
    - `name_with_namespace` string, required
    - `path` string, required
    - `path_with_namespace` string, required
    - `created_at` string, date-time, required

## Other responses

- `401`: Unauthorized
- `404`: Not found

---

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