---
title: "Create a new checkout key"
method: POST
path: "/project/{project-slug}/checkout-key"
tags: ["Project"]
---

# Create a new checkout key

`POST /project/{project-slug}/checkout-key`

## Request

- Base URL: `https://circleci.com/api/v2`
- URL: `https://circleci.com/api/v2/project/{project-slug}/checkout-key`
- Auth: one of:
  - API key in header `Circle-Token`
  - HTTP bearer
  - HTTP basic
  - API key in query parameter `circle-token`

Not available to projects that use GitLab or GitHub App. Creates a new checkout key. This API request is only usable with a user API token.
                           Please ensure that you have authorized your account with GitHub before creating user keys.
                           This is necessary to give CircleCI the permission to create a user key associated with
                           your GitHub user account. You can find this page by visiting Project Settings > Checkout SSH Keys

## Path parameters

- `project-slug` string, required

## Request body

- object
  - `type` 'user-key' | 'deploy-key', required: The type of checkout key to create. This may be either `deploy-key` or `user-key`.

## Response `201`

The checkout key.

- object: A checkout key
  - `public-key` string, required: A public SSH key.
  - `type` 'deploy-key' | 'github-user-key', required: The type of checkout key. This may be either `deploy-key` or `github-user-key`.
  - `fingerprint` string, required: An SSH key fingerprint.
  - `preferred` boolean, required: A boolean value that indicates if this key is preferred.
  - `created-at` string, date-time, required: The date and time the checkout key was created.

## Other responses

- `default`: Error response.

---

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