Skip to content
Platform & IdentityAPI Keys

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.

Header Parameters

Authorization*string

OAuth 2.0 bearer token.

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://api.ecomiq.pe/api/v1/api-keys" \  -H "Authorization: Bearer <token>" \  -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": "7204558912004326314",    "name": "Mi tienda",    "prefix": "Mi tienda",    "keySuffix": "Mi tienda",    "applicationUrl": "https://mi-tienda.ecomiq.app/products/polo-de-algodon",    "isActive": true,    "isTestMode": false,    "expiresAt": "2026-09-28T15:30:00Z"  },  "plaintextKey": "Mi tienda"}