VYG Docs

API keys

GET/v1/keys

Requires sign-in (OAuth). Scope: keys:manage.

View API keys and their details. Full key values are not shown.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Query Parameters

key_class?string

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/keys"
{  "data": [    {      "id": "string",      "key_prefix": "string",      "brand_id": "string",      "scopes": [        "string"      ],      "created_at": "string",      "last_used_at": "string",      "expires_at": "string",      "revoked_at": "string"    }  ],  "next_cursor": "string"}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
POST/v1/keys

Requires sign-in (OAuth). Scope: keys:manage.

Create an API key with the permissions your integration needs. Copy the key when it is returned; it is shown once.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/keys" \  -H "Content-Type: application/json" \  -d '{    "scopes": [      "string"    ]  }'
{  "id": "string",  "key_prefix": "string",  "brand_id": "string",  "scopes": [    "string"  ],  "created_at": "string",  "last_used_at": "string",  "expires_at": "string",  "revoked_at": "string",  "plaintext": "string"}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
POST/v1/keys/{id}/rotate

Requires sign-in (OAuth). Scope: keys:manage.

Replace an API key, keeping its permissions or choosing new ones. The previous key stops working immediately.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/keys/string/rotate" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "key_prefix": "string",  "brand_id": "string",  "scopes": [    "string"  ],  "created_at": "string",  "last_used_at": "string",  "expires_at": "string",  "revoked_at": "string",  "plaintext": "string"}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
DELETE/v1/keys/{id}

Requires sign-in (OAuth). Scope: keys:manage.

Revoke an API key. Returns 404 if it cannot be found or has already been revoked.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Query Parameters

key_class?string

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/v1/keys/string"
{  "id": "string",  "key_prefix": "string",  "brand_id": "string",  "scopes": [    "string"  ],  "created_at": "string",  "last_used_at": "string",  "expires_at": "string",  "revoked_at": "string"}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}
{  "error": {    "code": "bad_request",    "message": "string"  }}