---
title: "POST /v2/contacts/{contact_id}/publickeys"
method: POST
path: "/v2/contacts/{contact_id}/publickeys"
tags: ["pgp", "keys"]
---

# POST /v2/contacts/{contact_id}/publickeys

`POST /v2/contacts/{contact_id}/publickeys`

Add a pgp public key to a contact

## Path parameters

- `contact_id` string, required

## Request body

- NewPublicKey
  - `key` string, required — DER or PEM key, base64 encoded
  - `label` string, required

## Response `200`

Public key created

- object
  - `location` string — url to retrieve public key /contacts/{contact_id}/publickeys/{publickey_id}
  - `publickey_id` string

## Other responses

- `400` — malform request
- `401` — Unauthorized access
- `422` — Unprocessable entity. Parameters were valid but the server was unable to create the key (probably because of a semantically erroneous document)

---

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