API referenceApi keys
Create Project Api Key
Authorization
bearerAuth AuthorizationBearer <token>
Use a project API key for sandbox and runtime routes, or an OpenMetal user access token for account management routes.
In: header
Path Parameters
project_id*stringMatch
^prj_[A-Za-z0-9]+$Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
name*stringLength
1–120expires_in*string | nullDefault
nullexpires_in
Variant 1
Values
1h, 1d, 7d, 30d, 90d, 180d, 1yVariant 2
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/projects/string/api-keys" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "expires_in": null }'{ "api_key": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "project_id": "string", "name": "string", "prefix": "stringst", "created_at": "2019-08-24T14:15:22Z", "last_used_at": "2019-08-24T14:15:22Z", "expires_at": "2019-08-24T14:15:22Z", "revoked_at": "2019-08-24T14:15:22Z", "deleted_at": "2019-08-24T14:15:22Z" }, "key": "string"}