---
title: "Update a public key"
method: PATCH
path: "/public-keys/{keyId}"
tags: ["Public Keys"]
---

# Update a public key

`PATCH /public-keys/{keyId}`

## Request

- Base URL: `https://api.sazabi.com/v1`
- URL: `https://api.sazabi.com/v1/public-keys/{keyId}`
- Auth: none declared

Update one public key within one project.

## Path parameters

- `keyId` string, uuid, required: Key ID to update.

## Request body

- object
  - `projectId` string, uuid: Project containing the key. Auto-filled from CLI and SDK context when omitted.
  - `name` string: New human-readable name for the key.
  - `expiresAt` string, date-time, nullable: New expiration timestamp for the key, or null to clear it.

## Response `200`

OK

- object
  - `publicKey` object, required
    - `id` string, uuid, required
    - `name` string, required
    - `expiresAt` string, date-time, nullable, required
    - `lastUsedAt` string, date-time, nullable, required
    - `createdAt` string, date-time, required
    - `projectId` string, uuid, required
    - `dataSourceConnectionId` string, uuid, nullable, required: Linked data source connection ID when this key is scoped to one data source.
    - `deactivatedAt` string, date-time, nullable, required: Timestamp when this public key was deactivated.

---

[API](https://skmtc.dev/sazabi/apis/sazabi-public-api.md) - [All operations](https://skmtc.dev/sazabi/apis/sazabi-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sazabi/apis/sazabi-public-api/revisions/965b6230cf45?raw)
