API Key

Read and write API key information

API Key object

Attributes

object

String

String representing the object's type

id

String

The apiKey's unique identifier

status

Enum

The apiKey's status

secret_redacted

String

The apiKey's secret, redacted

secret

StringNullable

The apiKey's secret

type

Enum

The apiKey's type

name

String

The apiKey's name

description

StringNullable

The apiKey's description

ip_filters

Array of Strings

List of allowed IP addresses or CIDR ranges for this API key

machine_access

Object

deleted_at

DateNullable

The apiKey's deletion date

last_used_at

DateNullable

The apiKey's last usage date

expires_at

DateNullable

The apiKey's expiration date

created_at

Date

The apiKey's creation date

updated_at

Date

The apiKey's last update date

{
"object": "machine_access.api_key",
"id": "apk_4fGhJkLmNpQrStUv",
"status": "active",
"secret_redacted": "metorial_sk_4eC39HqLyjWDarjtT1zdp7dc",
"secret": "metorial_sk_4eC39HqLyjWDarjtT1zdp7dc",
"type": "organization_management_token",
"name": "Production API Key",
"description": "API key for production server access",
"ip_filters": [
"192.168.1.10",
"192.168.1.10"
],
"machine_access": {
"object": "machine_access",
"status": "active",
"type": "organization_management",
"last_used_at": "2024-01-15T09:30:00.000Z",
"created_at": "2024-01-15T09:30:00.000Z",
"updated_at": "2024-01-15T09:30:00.000Z",
"deleted_at": "2024-01-15T09:30:00.000Z",
"actor": {
"object": "organization.actor",
"id": "omem_5fGhJkLmNpQrStUv",
"type": "member",
"organization_id": "org_7hNkPqRsTuVwXyZa",
"name": "Alex Chen",
"email": "[email protected]",
"image_url": "https://avatar-cdn.metorial.com/aimg_1234567890",
"teams": [
{
"id": "tm_3eFgHjKlMnPqRsTu",
"name": "Engineering",
"slug": "engineering",
"assignment_id": "tmas_8jKlMnPqRsTuVwXy"
},
{
"id": "tm_3eFgHjKlMnPqRsTu",
"name": "Engineering",
"slug": "engineering",
"assignment_id": "tmas_8jKlMnPqRsTuVwXy"
}
]
},
"instance": {
"object": "organization.instance",
"id": "ins_9sTuVwXyZaBcDeFg",
"slug": "production-env",
"name": "Production Environment",
"organization_id": "org_7hNkPqRsTuVwXyZa",
"type": "development",
"created_at": "2026-01-29T12:35:22.304Z",
"updated_at": "2026-01-29T12:35:22.304Z",
"project": {
"object": "organization.project",
"id": "prj_3bCdEfGhJkLmNpQr",
"status": "active",
"slug": "api-integration",
"name": "API Integration",
"organization_id": "org_7hNkPqRsTuVwXyZa",
"created_at": "2026-04-04T17:24:51.277Z",
"updated_at": "2026-04-04T17:24:51.277Z"
}
},
"organization": {
"object": "organization",
"id": "org_7hNkPqRsTuVwXyZa",
"type": "default",
"slug": "acme-corp",
"name": "Acme Corporation",
"image_url": "https://avatar-cdn.metorial.com/aimg_1234567890"
},
"user": {
"object": "user",
"id": "usr_2xKj8mNpQrStUvWy",
"status": "active",
"type": "user",
"email": "[email protected]",
"name": "Alex Chen",
"first_name": "Alex",
"last_name": "Chen",
"image_url": "https://avatar-cdn.metorial.com/aimg_1234567890"
}
}
}

Get user

Get the current user information

Query Parameters

limit

NumberOptional

after

StringOptional

before

StringOptional

cursor

StringOptional

order

EnumOptional
Provide exactly one of the following:
These 3 fields are mutually exclusive - include only one in your request

type

String

List organization management tokens

type

String

List instance access tokens

instance_id

String

Instance ID for the access token

GEThttp://api.metorial.com/organization/api-keys
curl -X GET "https://api.metorial.com/organization/api-keys" \
-H "Authorization: Bearer metorial_sk_..."

Get API key

Get the information of a specific API key

URL Parameters

api_key_id

String

The unique identifier for the api_key

GEThttp://api.metorial.com/organization/api-keys/:api_key_id
curl -X GET "https://api.metorial.com/organization/api-keys/api_Rm4Mnheq2bfEPhBhP7SY" \
-H "Authorization: Bearer metorial_sk_..."

Create API key

Create a new API key

Request Body

name

String

description

StringOptional

expires_at

DateOptional

ip_filters

Array of StringsOptional
Provide exactly one of the following:
These 3 fields are mutually exclusive - include only one in your request

type

String

type

Enum

instance_id

String
POSThttp://api.metorial.com/organization/api-keys
curl -X POST "https://api.metorial.com/organization/api-keys" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..." \
-d '{
"name": "example_name",
"description": "example_description",
"expires_at": "2026-04-04T19:03:23.849Z",
"ip_filters": [
"example_item"
],
"type": "instance_access_token_secret"
}'

Update API key

Update the information of a specific API key

URL Parameters

api_key_id

String

The unique identifier for the api_key

Request Body

name

StringOptional

description

StringOptional

expires_at

DateOptional

ip_filters

Array of StringsOptional
POSThttp://api.metorial.com/organization/api-keys/:api_key_id
curl -X POST "https://api.metorial.com/organization/api-keys/api_Rm4Mnheq2bfEPhBhP7SY" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..." \
-d '{
"name": "example_name",
"description": "example_description",
"expires_at": "2026-04-04T19:03:23.849Z",
"ip_filters": [
"example_item"
]
}'

Revoke API key

Revoke a specific API key

URL Parameters

api_key_id

String

The unique identifier for the api_key

DELETEhttp://api.metorial.com/organization/api-keys/:api_key_id
curl -X DELETE "https://api.metorial.com/organization/api-keys/api_Rm4Mnheq2bfEPhBhP7SY" \
-H "Authorization: Bearer metorial_sk_..."

Rotate API key

Rotate a specific API key

URL Parameters

api_key_id

String

The unique identifier for the api_key

Request Body

current_expires_at

DateOptional
POSThttp://api.metorial.com/organization/api-keys/:api_key_id/rotate
curl -X POST "https://api.metorial.com/organization/api-keys/api_Rm4Mnheq2bfEPhBhP7SY/rotate" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..." \
-d '{
"current_expires_at": "2026-04-04T19:03:23.850Z"
}'

Reveal API key

Reveal a specific API key

URL Parameters

api_key_id

String

The unique identifier for the api_key

POSThttp://api.metorial.com/organization/api-keys/:api_key_id/reveal
curl -X POST "https://api.metorial.com/organization/api-keys/api_Rm4Mnheq2bfEPhBhP7SY/reveal" \
-H "Authorization: Bearer metorial_sk_..."