---
title: "Create a public key"
method: POST
path: "/user/keys"
tags: ["Users"]
---

# Create a public key

`POST /user/keys`

## Request body

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

## Response `201`

Created

- PublicKey
  - `id` integer
  - `key` string
  - `url` string
  - `title` string
  - `created_at` string, date-time

## Other responses

- `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/revisions/87e2da32266c/schema)
