Create a new API key for a customer. The API key is only shown once in the response - save it securely!
POST
/admin/api-keys
curl \
--request POST 'http://localhost:7001/admin/api-keys' \
--header "X-Admin-Secret: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"customer_name":"Acme Corp","customer_email":"admin@acme.com","max_devices":10,"rate_limit_per_hour":5000}'
Request examples
{
"customer_name": "Acme Corp",
"customer_email": "admin@acme.com",
"max_devices": 10,
"rate_limit_per_hour": 5000
}
Response examples (201)
{
"status": true,
"code": 201,
"message": "API key created successfully",
"data": {
"id": 1,
"api_key": "ak_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"customer_name": "Acme Corp",
"max_devices": 10,
"rate_limit_per_hour": 1000
}
}
Response examples (401)
{
"status": false,
"code": 400,
"message": "Bad request",
"error": "Bad request"
}