Skip to Content

UpdateApiKey

PATCH
/organizations/{org_id}/api-keys/v1/{key_id}

Authorization

headerX-API-Key<token>

API key for protected endpoints, supplied in the X-API-Key header.

Path Parameters

org_id*org_id
key_id*key_id
Match^[0-9A-Za-z]+$

Request Body

required
application/json
{
  "name": "Production Key",
  "expiring_at": "2026-01-15T10:30:00Z",
  "policy_ids": [
    "aS9d0F1g2H"
  ],
  "replace_policies": true,
  "retire_previous_secret": true
}
name?string | null
expiring_at?unknown | null
policy_ids?array<string>
replace_policies?boolean
retire_previous_secret?boolean

Stop accepting the previous secret now instead of at its overlap deadline. No-op when no overlap is active.

Response Body

200application/json

Success

type: unknown

{
  "$ref": "#/components/schemas/apikeys.v1.UpdateApiKeyResponse",
  "$ref-value": {
    "type": "object",
    "properties": {
      "api_key": {
        "title": "api_key",
        "$ref": "#/components/schemas/apikeys.v1.ApiKey",
        "$ref-value": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "examples": [
                "XyZ9aB8cD1"
              ],
              "title": "id"
            },
            "project_id": {
              "type": "string",
              "examples": [
                "Bq4y3QB38S"
              ],
              "title": "project_id"
            },
            "name": {
              "type": "string",
              "examples": [
                "Production Key"
              ],
              "title": "name",
              "maxLength": 64
            },
            "org_id": {
              "type": "string",
              "examples": [
                "OR98234j23"
              ],
              "title": "org_id"
            },
            "project_name": {
              "type": "string",
              "title": "project_name"
            },
            "created_at": {
              "examples": [
                "2026-01-15T10:30:00Z"
              ],
              "title": "created_at",
              "$ref": "#/components/schemas/google.protobuf.Timestamp",
              "$ref-value": {
                "type": "string",
                "examples": [
                  "2023-01-15T01:30:15.01Z",
                  "2024-12-25T12:00:00Z"
                ],
                "format": "date-time",
                "description": "A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC."
              }
            },
            "expiring_at": {
              "examples": [
                "2026-01-15T10:30:00Z"
              ],
              "title": "expiring_at",
              "$ref": "#/components/schemas/google.protobuf.Timestamp",
              "$ref-value": {
                "type": "string",
                "examples": [
                  "2023-01-15T01:30:15.01Z",
                  "2024-12-25T12:00:00Z"
                ],
                "format": "date-time",
                "description": "A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC."
              }
            },
            "last_used": {
              "examples": [
                "2026-01-15T10:30:00Z"
              ],
              "title": "last_used",
              "$ref": "#/components/schemas/google.protobuf.Timestamp",
              "$ref-value": {
                "type": "string",
                "examples": [
                  "2023-01-15T01:30:15.01Z",
                  "2024-12-25T12:00:00Z"
                ],
                "format": "date-time",
                "description": "A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC."
              }
            },
            "secret": {
              "type": "string",
              "examples": [
                "rxl_Bq4y3QB38SFpzVPNx1cG"
              ],
              "title": "secret"
            },
            "policy_ids": {
              "type": "array",
              "examples": [
                [
                  "aS9d0F1g2H"
                ]
              ],
              "items": {
                "type": "string",
                "examples": [
                  [
                    "aS9d0F1g2H"
                  ]
                ]
              },
              "title": "policy_ids"
            },
            "permissions": {
              "type": "array",
              "examples": [
                [
                  "media:videos:read"
                ]
              ],
              "items": {
                "type": "string",
                "examples": [
                  [
                    "media:videos:read"
                  ]
                ]
              },
              "title": "permissions"
            },
            "previous_secret_expires_at": {
              "examples": [
                "2026-01-16T10:30:00Z"
              ],
              "title": "previous_secret_expires_at",
              "description": "When the previous secret stops working. Unset unless a staged rotation overlap is active.",
              "$ref": "#/components/schemas/google.protobuf.Timestamp",
              "$ref-value": {
                "type": "string",
                "examples": [
                  "2023-01-15T01:30:15.01Z",
                  "2024-12-25T12:00:00Z"
                ],
                "format": "date-time",
                "description": "A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC."
              }
            },
            "secret_rotated_at": {
              "examples": [
                "2026-01-15T10:30:00Z"
              ],
              "title": "secret_rotated_at",
              "description": "When the current secret was issued by a rotation. Unset if the key was never rotated.",
              "$ref": "#/components/schemas/google.protobuf.Timestamp",
              "$ref-value": {
                "type": "string",
                "examples": [
                  "2023-01-15T01:30:15.01Z",
                  "2024-12-25T12:00:00Z"
                ],
                "format": "date-time",
                "description": "A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC."
              }
            },
            "secret_state": {
              "title": "secret_state",
              "description": "Whether only the current secret is valid, or the previous secret is also valid until previous_secret_expires_at.",
              "$ref": "#/components/schemas/apikeys.v1.SecretState",
              "$ref-value": {
                "type": "string",
                "title": "SecretState",
                "enum": [
                  "SECRET_STATE_UNSPECIFIED",
                  "SECRET_STATE_SINGLE",
                  "SECRET_STATE_OVERLAP"
                ]
              }
            }
          },
          "title": "ApiKey",
          "additionalProperties": false
        }
      }
    },
    "title": "UpdateApiKeyResponse",
    "additionalProperties": false
  }
}
default
curl -X PATCH 'https://api.rixl.com/organizations/OR98234j23/api-keys/v1/XyZ9aB8cD1'

Success

application/json

{
  "$ref": "#/components/schemas/apikeys.v1.UpdateApiKeyResponse",
  "$ref-value": {
    "type": "object",
    "properties": {
      "api_key": {
        "title": "api_key",
        "$ref": "#/components/schemas/apikeys.v1.ApiKey",
        "$ref-value": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "examples": [
                "XyZ9aB8cD1"
              ],
              "title": "id"
            },
            "project_id": {
              "type": "string",
              "examples": [
                "Bq4y3QB38S"
              ],
              "title": "project_id"
            },
            "name": {
              "type": "string",
              "examples": [
                "Production Key"
              ],
              "title": "name",
              "maxLength": 64
            },
            "org_id": {
              "type": "string",
              "examples": [
                "OR98234j23"
              ],
              "title": "org_id"
            },
            "project_name": {
              "type": "string",
              "title": "project_name"
            },
            "created_at": {
              "examples": [
                "2026-01-15T10:30:00Z"
              ],
              "title": "created_at",
              "$ref": "#/components/schemas/google.protobuf.Timestamp",
              "$ref-value": {
                "type": "string",
                "examples": [
                  "2023-01-15T01:30:15.01Z",
                  "2024-12-25T12:00:00Z"
                ],
                "format": "date-time",
                "description": "A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC."
              }
            },
            "expiring_at": {
              "examples": [
                "2026-01-15T10:30:00Z"
              ],
              "title": "expiring_at",
              "$ref": "#/components/schemas/google.protobuf.Timestamp",
              "$ref-value": {
                "type": "string",
                "examples": [
                  "2023-01-15T01:30:15.01Z",
                  "2024-12-25T12:00:00Z"
                ],
                "format": "date-time",
                "description": "A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC."
              }
            },
            "last_used": {
              "examples": [
                "2026-01-15T10:30:00Z"
              ],
              "title": "last_used",
              "$ref": "#/components/schemas/google.protobuf.Timestamp",
              "$ref-value": {
                "type": "string",
                "examples": [
                  "2023-01-15T01:30:15.01Z",
                  "2024-12-25T12:00:00Z"
                ],
                "format": "date-time",
                "description": "A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC."
              }
            },
            "secret": {
              "type": "string",
              "examples": [
                "rxl_Bq4y3QB38SFpzVPNx1cG"
              ],
              "title": "secret"
            },
            "policy_ids": {
              "type": "array",
              "examples": [
                [
                  "aS9d0F1g2H"
                ]
              ],
              "items": {
                "type": "string",
                "examples": [
                  [
                    "aS9d0F1g2H"
                  ]
                ]
              },
              "title": "policy_ids"
            },
            "permissions": {
              "type": "array",
              "examples": [
                [
                  "media:videos:read"
                ]
              ],
              "items": {
                "type": "string",
                "examples": [
                  [
                    "media:videos:read"
                  ]
                ]
              },
              "title": "permissions"
            },
            "previous_secret_expires_at": {
              "examples": [
                "2026-01-16T10:30:00Z"
              ],
              "title": "previous_secret_expires_at",
              "description": "When the previous secret stops working. Unset unless a staged rotation overlap is active.",
              "$ref": "#/components/schemas/google.protobuf.Timestamp",
              "$ref-value": {
                "type": "string",
                "examples": [
                  "2023-01-15T01:30:15.01Z",
                  "2024-12-25T12:00:00Z"
                ],
                "format": "date-time",
                "description": "A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC."
              }
            },
            "secret_rotated_at": {
              "examples": [
                "2026-01-15T10:30:00Z"
              ],
              "title": "secret_rotated_at",
              "description": "When the current secret was issued by a rotation. Unset if the key was never rotated.",
              "$ref": "#/components/schemas/google.protobuf.Timestamp",
              "$ref-value": {
                "type": "string",
                "examples": [
                  "2023-01-15T01:30:15.01Z",
                  "2024-12-25T12:00:00Z"
                ],
                "format": "date-time",
                "description": "A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC."
              }
            },
            "secret_state": {
              "title": "secret_state",
              "description": "Whether only the current secret is valid, or the previous secret is also valid until previous_secret_expires_at.",
              "$ref": "#/components/schemas/apikeys.v1.SecretState",
              "$ref-value": {
                "type": "string",
                "title": "SecretState",
                "enum": [
                  "SECRET_STATE_UNSPECIFIED",
                  "SECRET_STATE_SINGLE",
                  "SECRET_STATE_OVERLAP"
                ]
              }
            }
          },
          "title": "ApiKey",
          "additionalProperties": false
        }
      }
    },
    "title": "UpdateApiKeyResponse",
    "additionalProperties": false
  }
}