API reference
APIs
Register each API you want to meter. Keys can be scoped to specific APIs by their apiId.
POST
/api/createBearerCreate API
Register an API under your project.
Body
apiNamestringrequiredAPI name. Must match ^[a-zA-Z0-9_-]+$.
apiIdstringCustom API ID (auto-generated if omitted). Must match ^[a-zA-Z0-9_-]+$.
Request
curl -X POST "https://api.reqkey.com/api/create" \
-H "Authorization: Bearer reqkey_xxx..." \
-H "Content-Type: application/json" \
-d '{
"apiName": "PaymentAPI",
"apiId": "payment-api-v1"
}'Response
{
"apiId": "payment-api-v1",
"apiName": "PaymentAPI",
"createdAt": "2026-01-30T12:34:56Z",
"expiresAt": null
}Errors
400Missing apiName, invalid format, or body parse error
401Missing or invalid authentication
409API ID already exists
500Temporary internal error — safe to retry
POST
/api/deleteBearerDelete API
Soft (30-day recovery) or hard delete an API.
Body
apiIdstringrequiredID of the API to delete.
permanentbooleantrue = hard delete. Default false (soft delete, recoverable 30 days).
Request
curl -X POST "https://api.reqkey.com/api/delete" \
-H "Authorization: Bearer reqkey_xxx..." \
-H "Content-Type: application/json" \
-d '{
"apiId": "payment-api-v1"
}'Response
{
"apiId": "payment-api-v1",
"deleted": true,
"permanent": false,
"deletedAt": "2026-02-13T08:22:36.984Z",
"purgeAt": "2026-03-15T08:22:36.984Z",
"recoverable": true
}- Deleting an API does not cascade to consumers — consumers are project-level.
Errors
400Missing apiId or body parse error
401Missing or invalid authentication
403API does not belong to this project
404API not found