Skip to main content
POST
/
repos
/
{owner}
/
{repo}
/
keys
Add a deploy key
curl --request POST \
  --url https://gogs.example.com/api/v1/repos/{owner}/{repo}/keys \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "key": "<string>"
}
'
{
  "id": 123,
  "key": "<string>",
  "url": "<string>",
  "title": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "read_only": true
}

Authorizations

Authorization
string
header
required

Personal access token. Use format: token {YOUR_ACCESS_TOKEN}

Path Parameters

owner
string
required

Repository owner

repo
string
required

Repository name

Body

application/json
title
string
required
key
string
required

Response

Created

id
integer
key
string
url
string
title
string
created_at
string<date-time>
read_only
boolean