Skip to content
Guides
API reference
stableapi_key:create

Create an API key

Creates an API key and returns its plaintext value once. This does not create an OAuth application, and documented Admin, Storefront, and Auth operations do not accept this key.

POST/v1/api-keys

Creates an API key and returns its plaintext value once. This does not create an OAuth application, and documented Admin, Storefront, and Auth operations do not accept this key.

Authorization

bearerAuth
AuthorizationBearer <token>

OAuth2 access token issued by Ecomiq Auth.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/v1/api-keys" \  -H "Content-Type: application/json" \  -d '{    "name": "ERP de producción",    "isTestMode": false,    "scopes": [      "api_admin"    ],    "allowedIps": [      "203.0.113.10"    ],    "expiresAt": null,    "applicationUrl": "https://erp.example.com"  }'
{  "apiKey": {    "id": "string",    "name": "string",    "prefix": "string",    "keySuffix": "string",    "applicationUrl": null,    "isActive": true,    "isTestMode": true,    "expiresAt": null,    "lastUsedAt": null,    "scopes": [      "string"    ],    "allowedIps": [      "string"    ],    "createdOn": "2019-08-24T14:15:22Z",    "createdBy": null,    "userId": null  },  "plaintextKey": "string"}