Skip to content

API Keys API

API reference for managing API keys programmatically.

Generate, list, and revoke API keys via the API.

GET /v1/api-keys
Terminal window
curl -X GET https://api.gopaylocal.com/v1/api-keys \
-H "Authorization: Bearer gpl_sk_live_xyz789"

Response:

{
"data": [
{
"id": "key_abc123",
"name": "Production Banner",
"type": "public",
"prefix": "gpl_pk_live_abc",
"createdAt": "2025-01-15T10:30:00Z",
"lastUsedAt": "2025-01-20T14:22:00Z"
},
{
"id": "key_def456",
"name": "CI/CD Pipeline",
"type": "secret",
"prefix": "gpl_sk_live_def",
"createdAt": "2025-01-15T10:30:00Z",
"lastUsedAt": "2025-01-19T09:15:00Z"
}
]
}
POST /v1/api-keys
Terminal window
curl -X POST https://api.gopaylocal.com/v1/api-keys \
-H "Authorization: Bearer gpl_sk_live_xyz789" \
-H "Content-Type: application/json" \
-d '{
"name": "New Banner Key",
"type": "public"
}'

Request Body:

FieldTypeRequiredDescription
namestringYesDescriptive name for the key
typestringYes"public" or "secret"

Response: 201 Created

{
"data": {
"id": "key_ghi789",
"name": "New Banner Key",
"type": "public",
"key": "gpl_pk_live_abc123def456ghi789",
"createdAt": "2025-01-20T15:00:00Z"
}
}
DELETE /v1/api-keys/:id
Terminal window
curl -X DELETE https://api.gopaylocal.com/v1/api-keys/key_abc123 \
-H "Authorization: Bearer gpl_sk_live_xyz789"

Response: 204 No Content

Revoked keys are immediately disabled. Any requests using a revoked key receive a 401 Unauthorized response.