Skip to main content

Update

PATCH /v1/api-keys/{item_id}

Changes the description or expires_at of one of your API keys. The key value, owner and status cannot be changed here; to revoke a key, delete it.

Authentication​

Requires authentication via: OAuth2PasswordBearer.

Parameters​

NameInTypeRequiredDescriptionConstraints
item_idpathintegerYes
X-API-Keyheaderstring | nullNonullable

Request Body​

Required: Yes

application/json​

Resolved schema:

{
"properties": {
"expires_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Expires At"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
}
},
"type": "object",
"title": "APIKeyRecordCreate"
}

Field details:

FieldTypeRequiredDescriptionConstraints
expires_atstring | nullNoformat=date-time, nullable
descriptionstring | nullNonullable

Responses​

200​

Successful Response

application/json​

Resolved schema:

{
"properties": {
"id": {
"type": "integer",
"title": "Id"
},
"key_prefix": {
"type": "string",
"title": "Key Prefix"
},
"user_id": {
"type": "integer",
"title": "User Id"
},
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Status"
},
"created_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Created At"
},
"expires_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Expires At"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
},
"full_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Full Key"
}
},
"type": "object",
"required": [
"id",
"key_prefix",
"user_id",
"status",
"created_at",
"expires_at",
"description"
],
"title": "APIKeyRecordRead"
}

Field details:

FieldTypeRequiredDescriptionConstraints
idintegerYes
key_prefixstringYes
user_idintegerYes
statusstring | nullYesnullable
created_atstring | nullYesformat=date-time, nullable
expires_atstring | nullYesformat=date-time, nullable
descriptionstring | nullYesnullable
full_keystring | nullNonullable

401​

No credentials, or the Bearer token / X-API-Key is invalid.

No response body.

403​

The account is disabled, or a guest token was used; or short-lived integration-user tokens cannot call this route; or the API key belongs to another account.

No response body.

404​

No API key with this id.

No response body.

422​

Validation Error

application/json​

Resolved schema:

{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}

Field details:

FieldTypeRequiredDescriptionConstraints
detailarray<object>No
detail[]objectNo
detail[].locarray<string | integer>No
detail[].loc[]string | integerNo
detail[].msgstringNo
detail[].typestringNo

429​

Rate limit exceeded. Retry later.

No response body.