OpenMetal
API referenceApi keys

Create Project Api Key

POST
/v1/projects/{project_id}/api-keys

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*string
Match^prj_[A-Za-z0-9]+$

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

name*string
Length1–120
expires_in*string | null
Defaultnull
expires_in
Variant 1
Values1h, 1d, 7d, 30d, 90d, 180d, 1y
Variant 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"}