API Key
Read and write API key information
API Key object
Attributes
object
StringString representing the object's type
id
StringThe apiKey's unique identifier
status
EnumThe apiKey's status
secret_redacted
StringThe apiKey's secret, redacted
secret
StringNullableThe apiKey's secret
type
EnumThe apiKey's type
name
StringThe apiKey's name
description
StringNullableThe apiKey's description
ip_filters
Array of StringsList of allowed IP addresses or CIDR ranges for this API key
machine_access
Objectdeleted_at
DateNullableThe apiKey's deletion date
last_used_at
DateNullableThe apiKey's last usage date
expires_at
DateNullableThe apiKey's expiration date
created_at
DateThe apiKey's creation date
updated_at
DateThe 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
NumberOptionalafter
StringOptionalbefore
StringOptionalcursor
StringOptionalorder
EnumOptionalcurl -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
StringThe unique identifier for the api_key
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
Stringdescription
StringOptionalexpires_at
DateOptionalip_filters
Array of StringsOptionalcurl -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
StringThe unique identifier for the api_key
Request Body
name
StringOptionaldescription
StringOptionalexpires_at
DateOptionalip_filters
Array of StringsOptionalcurl -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
StringThe unique identifier for the api_key
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
StringThe unique identifier for the api_key
Request Body
current_expires_at
DateOptionalcurl -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
StringThe unique identifier for the api_key
curl -X POST "https://api.metorial.com/organization/api-keys/api_Rm4Mnheq2bfEPhBhP7SY/reveal" \-H "Authorization: Bearer metorial_sk_..."