---
title: "Add a deploy key"
method: POST
path: "/repos/{owner}/{repo}/keys"
tags: ["Collaborators and Deploy Keys"]
---

# Add a deploy key

`POST /repos/{owner}/{repo}/keys`

## Path parameters

- `owner` string, required
- `repo` string, required

## Request body

- object
  - `title` string, required
  - `key` string, required

## Response `201`

Created

- DeployKey
  - `id` integer
  - `key` string
  - `url` string
  - `title` string
  - `created_at` string, date-time
  - `read_only` boolean

## Other responses

- `404` — Resource not found.
- `422` — Validation error.

---

[API](https://skmtc.net/gogs/apis/gogs-api.md) · [All operations](https://skmtc.net/gogs/apis/gogs-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gogs/gogs-api/versions/87e2da32266c/schema)
