# Create API key Creates a new API key with the specified scopes and expiration time. Endpoint: POST /api/admin/api-keys Version: EAP Security: APIKey, AdminToken ## Header parameters: - `x-idempotency-key` (string) Optional idempotency key to prevent duplicate processing Example: "order_12345_retry_001" ## Request fields (application/json): - `expiration_time` (integer) Specifies how many seconds after creation the API key will expire automatically. Example: 3600 - `scopes` (array, required) A list of scopes that the API key will have access to. Enum: "admin:api-keys:create", "admin:api-keys:read", "admin:api-keys:update", "admin:api-keys:delete", "pci:tokens:create", "pci:tokens:read", "pci:tokens:update", "pci:tokens:delete", "pci:tokens:forward", "network:tokens:create", "network:tokens:read", "network:tokens:delete", "network:tokens:use", "metadata:inquiry:create" ## Response 200 fields (application/json): - `id` (string, required) Example: "123e4567-e89b-12d3-a456-426614174000" - `created_at` (string, required) Example: "2023-10-01T10:00:00Z" - `expires_at` (string) Example: "2023-10-01T11:00:00Z" - `key_value` (string, required) The generated API key value. It will only be returned once with this response. Example: "key_1234567890ABCDEF" - `scopes` (array, required) A list of scopes that the API key will have access to. Enum: "admin:api-keys:create", "admin:api-keys:read", "admin:api-keys:update", "admin:api-keys:delete", "pci:tokens:create", "pci:tokens:read", "pci:tokens:update", "pci:tokens:delete", "pci:tokens:forward", "network:tokens:create", "network:tokens:read", "network:tokens:delete", "network:tokens:use", "metadata:inquiry:create" ## Response 401 fields (application/json): - `code` (integer) The corresponding HTTP status code for the error - `classifier` (string) Technical code that helps to identify the error - `message` (string) Human readable representation of the error ## Response 403 fields (application/json): - `code` (integer) The corresponding HTTP status code for the error - `classifier` (string) Technical code that helps to identify the error - `message` (string) Human readable representation of the error ## Response 422 fields (application/json): - `code` (integer) The corresponding HTTP status code for the error - `classifier` (string) Technical code that helps to identify the error - `message` (string) Human readable representation of the error - `validation_errors` (array) - `validation_errors.path` (string) Json-path in the request which points to the validation error - `validation_errors.message` (string) Human readable validation message