---
title: "Create a project deploy key"
method: POST
path: "/workspaces/{workspace}/projects/{project_key}/deploy-keys"
tags: ["Deployments"]
---

# Create a project deploy key

`POST /workspaces/{workspace}/projects/{project_key}/deploy-keys`

Create a new deploy key in a project.

Example:
```
$ curl -X POST \
-H "Authorization <auth header>" \
-H "Content-type: application/json" \
https://api.bitbucket.org/2.0/workspaces/standard/projects/TEST_PROJECT/deploy-keys/ -d \
'{
    "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5 mleu@C02W454JHTD8",
    "label": "mydeploykey"
}'
```

## Response `200`

The project deploy key that was created

- ProjectDeployKey — Represents deploy key for a project.
  - `type` string, required
  - `key` string — The deploy key value.
  - `project` Project — A Bitbucket project. Projects are used by teams to organize repositories.
    - `type` string, required
    - `links` object
      - `html` object — A link to a resource related to this object.
        - `href` string, uri
        - `name` string
      - `avatar` object — A link to a resource related to this object.
        - `href` string, uri
        - `name` string
    - `uuid` string — The project's immutable id.
    - `key` string — The project's key.
    - `owner` Team — A team object.
      - `type` string, required
      - `links` object — Links related to a Team.
        - `avatar` Link — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
        - `self` Link — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
        - `html` Link — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
        - `members` Link — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
        - `projects` Link — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
        - `repositories` Link — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
      - `created_on` string, date-time
      - `display_name` string
      - `uuid` string
    - `name` string — The name of the project.
    - `description` string
    - `is_private` boolean — Indicates whether the project is publicly accessible, or whether it is private to the team and consequently only visible to team members. Note that private projects cannot contain public repositories.
    - `created_on` string, date-time
    - `updated_on` string, date-time
    - `has_publicly_visible_repos` boolean — Indicates whether the project contains publicly visible repositories. Note that private projects cannot contain public repositories.
  - `comment` string — The comment parsed from the deploy key (if present)
  - `label` string — The user-defined label for the deploy key
  - `added_on` string, date-time
  - `last_used` string, date-time
  - `links` object
    - `self` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
  - `created_by` Account — An account object.
    - `type` string, required
    - `links` AccountLinks — Links related to an Account.
      - `avatar` Link — A link to a resource related to this object.
        - `href` string, uri
        - `name` string
    - `created_on` string, date-time
    - `display_name` string
    - `uuid` string

## Other responses

- `400` — Invalid deploy key inputs
- `403` — If the specified workspace or project is not accessible to the current user
- `404` — If the specified workspace or project does not exist

---

[API](https://skmtc.net/bitbucket/apis/bitbucket-api.md) · [All operations](https://skmtc.net/bitbucket/apis/bitbucket-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bitbucket/bitbucket-api/revisions/4ec8bd2515c5/schema)
