API keys
View as Markdown

Create an API key

No API key can call this route. It needs a signed-in dashboard user with the right role; a key answers 403. About scopes

POST
/api/v1/api-keys

Authorization

Authorization
Required
Bearer <token>

An API key: gpy_test_… or gpy_live_… (or an agent key, agk_…).

In: header

Request Body

application/jsonOptional

name
Required
string

Minimum length: 1Maximum length: 200

key_typestring

developer -> gpy_ prefix, agent -> agk_, publishable -> pk_ (browser-safe, takes no scopes). Defaults to developer.

Value in: "developer" | "agent" | "publishable"

scopesarray<string>

expires_atAny properties in string, string

When the key stops working; must be in the future. never for no expiry. Omitted: 90 days from now, except a publishable key, which never expires by default.

curl -X POST "https://globalymint.com/api/v1/api-keys" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "key_type": "developer",
    "scopes": [
      "string"
    ],
    "expires_at": "2019-08-24T14:15:22Z"
  }'

API key created. Store secret now; it is unrecoverable.

{
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "string",
    "key_type": "developer",
    "mode": "test",
    "key_prefix": "gpy_",
    "key_hint": "string",
    "scopes": [
      "string"
    ],
    "expires_at": "2019-08-24T14:15:22Z",
    "secret": "gpy_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  },
  "_agent": {
    "summary": "string",
    "status": "ok",
    "next_actions": [
      "string"
    ],
    "warnings": [
      "string"
    ]
  },
  "api_version": "2026-07-01"
}