Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

Update key

PATCH/v1/organizations/{organizationId}/keys/{keyId}

Updates API key properties.

Authorizations

Path parameters

  • organizationIdstringrequired

    ID of the organization that owns the key.

    format: uuid
  • keyIdstringrequired

    ID of the key to update.

    format: uuid

Request bodyJSON

  • nameoptionalstring

    Name of the key

  • rolesdeprecatedarray ofadminordeveloperorquery_endpoints

    DEPRECATED. Use assignedRoleIds instead. List of roles assigned to the key.

  • assignedRoleIdsoptionalarray ofstring

    Array of role UUIDs to assign to the API key

    format: uuid
  • expireAtoptionalstring | null

    Timestamp the key expires. If null or is empty the key never expires. ISO-8601.

    format: date-time
  • stateoptionalenabledordisabled

    State of the key: 'enabled', 'disabled'.

  • ipAccessListoptionalarray ofobject

    List of IP addresses allowed to access the API using this key

    2 properties
    • sourceoptionalstring

      IP or CIDR

    • descriptionoptionalstring

      Optional description of IPv4 address or IPv4 CIDR to allow access from

Response

JSON

200

Successful response

JSON
  • statusoptionalnumber

    HTTP status code.

    Example: 200
  • requestIdoptionalstring

    Unique id assigned to every request. UUIDv4

    format: uuid
  • resultoptionalobject
    10 properties
    • idoptionalstring

      Unique API key ID.

      format: uuid
    • nameoptionalstring

      Name of the key

    • stateoptionalenabledordisabled

      State of the key: 'enabled', 'disabled'.

    • rolesdeprecatedarray ofadminordeveloperorquery_endpoints

      DEPRECATED. Use assignedRoles instead. List of roles assigned to the key. For organizations that have migrated to custom roles, this field is frozen at the pre-migration value and does not reflect current role assignments.

    • assignedRolesoptionalarray ofobject

      Custom roles and System roles assigned to this API key

      3 properties
      • roleIdoptionalstring

        Unique identifier of the role

        format: uuid
      • roleNameoptionalstring

        Human-readable name of the role

      • roleTypeoptionalsystemorcustom

        Type of role: system (predefined) or custom (organization-defined)

    • keySuffixoptionalstring

      Last 4 letters of the key.

    • createdAtoptionalstring

      Timestamp the key was created. ISO-8601.

      format: date-time
    • expireAtoptionalstring | null

      Timestamp the key expires. If not present, null or is empty the key never expires. ISO-8601.

      format: date-time
    • usedAtoptionalstring

      Timestamp the key was used last time, with one-minute precision. If not present the key was never used. ISO-8601.

      format: date-time
    • ipAccessListoptionalarray ofobject

      List of IP addresses allowed to access the API using this key

      2 properties
      • sourceoptionalstring

        IP or CIDR

      • descriptionoptionalstring

        Optional description of IPv4 address or IPv4 CIDR to allow access from

Navigation