---
title: "Add a public key for the authenticated user."
method: POST
path: "/cmx/user/public-keys"
tags: ["cmx"]
---

# Add a public key for the authenticated user.

`POST /cmx/user/public-keys`

## Request

- Base URL: `https://api.replicated.com/vendor/v3`
- URL: `https://api.replicated.com/vendor/v3/cmx/user/public-keys`
- Auth: API key in header `Authorization`

Adds an SSH public key associated with the authenticated user in their team.

## Request body

- object
  - `public_key` string, required: SSH public key to add
  - `user_id` string, required: GitHub username or identifier for the public key

## Response `201`

AddUserPublicKeyResponse contains the response for adding a user public key.

- object
  - `error` string
  - `public_key` UserPublicKeyResponse
    - `fingerprint` string
    - `is_synced` boolean
    - `public_key` string
    - `user_id` string

## Other responses

- `400`: Returned on bad input
- `401`: Return if the caller is not authorized

## Changes

- **2026-11-03** `a36c6aead22f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/replicated/apis/vendor-api-v3-2/changes/cmx/user/public-keys/post.md)

---

[API](https://skmtc.dev/replicated/apis/vendor-api-v3-2.md) - [All operations](https://skmtc.dev/replicated/apis/vendor-api-v3-2/llms.txt) - [OpenAPI document](https://skmtc.dev/replicated/apis/vendor-api-v3-2/revisions/a36c6aead22f?raw)
