Create API key
Create a new API key. The full key is only returned once in the response.
Create a new API key. The full key is only returned once in the response.
Authorization
ApiKeyAuth x-api-key<token>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
name*string
expiresInDays*integer
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api-keys" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "expiresInDays": 365 }'{ "success": true, "data": { "id": "string", "name": "string", "apiKey": "string", "prefix": "string", "expiresAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "object": "api_key", "livemode": true }}{ "success": false, "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "success": false, "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "success": false, "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}