Viewrium Docs
HTTP referenceAPI keys

Create an API key

POST/v1/api_keys

Creates a publishable or secret key. Answers 201 with the full key: for a secret key this is the only time it is returned. Requires a signed-in admin or owner.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/api_keys" \  -H "Content-Type: application/json" \  -d '{    "key_type": "publishable"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "key_type": "publishable",  "key_prefix": "string",  "name": "string",  "scopes": [],  "last_used_at": "2019-08-24T14:15:22Z",  "revoked_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "key": "string"}
{  "error": {    "code": "string",    "message": "string",    "details": null  }}