---
title: "Update a key"
method: PATCH
path: "/compute/{connection_id}/key/{id}"
tags: ["compute", "key"]
---

# Update a key

`PATCH /compute/{connection_id}/key/{id}`

## Request

- Base URL: `https://api.unified.to`
- URL: `https://api.unified.to/compute/{connection_id}/key/{id}`
- Auth: API key in header `authorization`

## Path parameters

- `connection_id` string, required
- `id` string, required

## Query parameters

- `fields` string[]
- `raw` string

## Request body

- ComputeKey
  - `id` string: Unique identifier for the key
  - `created_at` string, date-time: When the key was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `updated_at` string, date-time: When the key was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `name` string: Display name of the key
  - `type` 'SSH' | 'REGISTRY' | 'SECRET' | 'OTHER': The kind of credential
  - `public_key` string: SSH public key
  - `private_key` string: SSH private key generated by the vendor; returned only in the create response
  - `fingerprint` string: SSH key fingerprint
  - `registry_url` string: Container registry URL (REGISTRY keys)
  - `username` string: Registry or SSH username
  - `secret` string: Registry password or secret value (write-only; never returned)
  - `instance_id` string: The instance this key is scoped to, for per-instance keys
  - `expires_at` string, date-time: When the key expires (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `metadata` ComputeMetadata[]
    - `id` string: The label, tag or metadata identifier
    - `slug` string: The label, tag or metadata key
    - `value` union: The label, tag or metadata value
      - object
      - string
      - number
      - boolean
      - union[]
        - union
          - object
          - string
          - number
          - boolean
    - `namespace` string: The origin of the value (eg. labels, tags, metadata)
    - `format` 'TEXT' | 'NUMBER' | 'DATE' | 'BOOLEAN' | 'ARRAY' | 'OBJECT': The data type of the value
    - `extra_data` union: Additional data about the value
      - object
      - string
      - number
      - boolean
      - union[]
        - union
          - object
          - string
          - number
          - boolean
  - `raw` object: Raw data from integration

## Response `200`

Successful

- ComputeKey
  - `id` string: Unique identifier for the key
  - `created_at` string, date-time: When the key was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `updated_at` string, date-time: When the key was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `name` string: Display name of the key
  - `type` 'SSH' | 'REGISTRY' | 'SECRET' | 'OTHER': The kind of credential
  - `public_key` string: SSH public key
  - `private_key` string: SSH private key generated by the vendor; returned only in the create response
  - `fingerprint` string: SSH key fingerprint
  - `registry_url` string: Container registry URL (REGISTRY keys)
  - `username` string: Registry or SSH username
  - `secret` string: Registry password or secret value (write-only; never returned)
  - `instance_id` string: The instance this key is scoped to, for per-instance keys
  - `expires_at` string, date-time: When the key expires (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `metadata` ComputeMetadata[]
    - `id` string: The label, tag or metadata identifier
    - `slug` string: The label, tag or metadata key
    - `value` union: The label, tag or metadata value
      - object
      - string
      - number
      - boolean
      - union[]
        - union
          - object
          - string
          - number
          - boolean
    - `namespace` string: The origin of the value (eg. labels, tags, metadata)
    - `format` 'TEXT' | 'NUMBER' | 'DATE' | 'BOOLEAN' | 'ARRAY' | 'OBJECT': The data type of the value
    - `extra_data` union: Additional data about the value
      - object
      - string
      - number
      - boolean
      - union[]
        - union
          - object
          - string
          - number
          - boolean
  - `raw` object: Raw data from integration

## Changes

- **2026-10-19** `39502239a975`: 3 info
  - added the new optional request property `metadata`
  - added the enum value `metadata` to the property `items/` of the `query` request parameter `fields`
  - added the optional property `metadata` to the response with the `200` status
- **2026-10-12** `32f1e856a6c9`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/unified/apis/unified-to-api/changes/compute/:connection_id/key/:id/patch.md)

---

[API](https://skmtc.dev/unified/apis/unified-to-api.md) · [All operations](https://skmtc.dev/unified/apis/unified-to-api/llms.txt) · [OpenAPI document](https://skmtc.dev/unified/apis/unified-to-api/revisions/88a1fc7820d6?raw)
