Skip to content

Change an API key

PATCHhttps://my.neuronai.uz/api/v1/api-keys/{id}

Changes an API key. Send only the fields to change; null clears expires_at, allowed_ips or monthly_spend_limit.

A change that gives the key more power, such as a higher permission or a later expiry, must stay within the calling key's own limits. A revoked key cannot be changed, and the key of an app connected through MCP keeps its name, access and permissions.

Needs an API key with api_keys:write.

Path parameters

  • idstringRequired

    The key id: a lowercase ULID.

Request body

application/json

A JSON object.

  • namestringOptional

    Min. length: 1 · Max. length: 80

  • descriptionstring | nullOptional

    Max. length: 500

  • accessstringOptional

    How much a key may do. A full key holds every product at its highest level, products added later included, but never api_keys, which is only ever granted explicitly. A restricted key holds exactly the levels in its permissions map.

    Allowed values:fullrestricted

  • permissionsobjectOptional

    Replaces the whole map. Levels by product, such as {"tts": "write"}. On a restricted key a product left out is none. A full key already holds every other product at its highest level, so its map may name only api_keys.

  • expires_atstring | nullOptional

    Format: date-time

  • monthly_spend_limitnumber | nullOptional

    In credits per calendar month (UTC), from 0 to 999999999999.99 with at most two decimals. null removes the limit.

  • enabledbooleanOptional
  • allowed_ipsarray | nullOptional

Response

200application/json

Success.

  • dataobjectRequired
  • request_idstringRequired

    Format: uuid

Headers

  • X-Request-IdstringOptional

    Identifies this request. A JSON body carries it as request_id too; quote it to support.

    Format: uuid

  • X-RateLimit-LimitintegerOptional

    The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused.

  • X-RateLimit-RemainingintegerOptional

    How many of them are left this minute.

Errors

  • 401

    The API key is missing or not recognized (invalid_api_key), revoked (api_key_revoked), disabled (api_key_disabled) or expired (api_key_expired).

  • 403

    The key lacks the permission (insufficient_permissions), the IP is not allowed (ip_not_allowed), or the change would exceed the calling key's own access or limits (insufficient_permissions).

  • 404

    No such key in your organization: not_found.

  • 409

    The key is revoked and cannot be changed: conflict.

  • 422

    The request failed validation (invalid_request). error.fields names each invalid field.

  • 429

    A rate or concurrency limit was reached (rate_limit_exceeded, concurrency_limit_exceeded). Retry after Retry-After seconds.

  • default

    Any other error, in the same shape, such as server_error (500) or service_unavailable (503).