title: Create Flowplate Api Key keywords: - create flowplate api key - post - create - flowplate - api - key # Create Flowplate Api Key Create a hidden API key for a Flowplate user+org. #### Headers **`x-flowplate-master-key`** string required Flowplate master API key for internal service authentication. #### Request Body **`user_id`** string required Aitronos user ID **`organization_id`** string required Organization ID **`metadata`** object optional Optional metadata for the key ## Returns **`key`** string Raw API key (returned ONCE only, store securely!) **`key_id`** string Unique key identifier (flk_...) **`key_prefix`** string Key prefix for identification (fl_user_{env}_{first_8}) **`user_id`** string User ID who owns the key **`organization_id`** string Organization ID **`created_at`** string Creation timestamp Example ```bash cURL curl -X POST "https://api.aitronos.com/v1/flowplate/api-keys" \ -H "X-API-Key: $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "user_id": "your_user_id", "organization_id": "org_abc123" }' ``` ```python Python import os import requests api_key = os.environ["FREDDY_API_KEY"] response = requests.post( "https://api.aitronos.com/v1/flowplate/api-keys", headers={"X-API-Key": api_key}, json={'user_id': 'your_user_id', 'organization_id': 'your_organization_id'} ) print(response.json()) ``` ```javascript JavaScript const apiKey = process.env.FREDDY_API_KEY; const response = await fetch('https://api.aitronos.com/v1/flowplate/api-keys', { method: 'POST', headers: { 'X-API-Key': apiKey, 'Content-Type': 'application/json' }, body: JSON.stringify({"user_id": "your_user_id", "organization_id": "org_abc123"}) }); const data = await response.json(); console.log(data); ``` **Response:** ```json 201 OK { "key": "fl_user_prod_a1b2c3d4...", "key_id": "flk_abc123def456", "key_prefix": "fl_user_prod_a1b2c3d4", "user_id": "usr_abc123def456", "organization_id": "org_abc123def456", "created_at": "2025-11-15T10:30:00Z" } ``` Errors ```json 401 Unauthorized { "success": false, "error": { "code": "AUTHENTICATION_REQUIRED", "message": "Authentication required. Please provide a valid API key.", "system_message": "Missing or invalid authorization header", "type": "authentication_error", "status": 401, "trace_id": "req_abc123xyz", "timestamp": "2025-11-11T10:30:00Z", "details": {} } } ``` ```json 403 Forbidden { "success": false, "error": { "code": "INSUFFICIENT_PERMISSIONS", "message": "You do not have permission to access this resource.", "system_message": "Insufficient permissions for this operation", "type": "authorization_error", "status": 403, "trace_id": "req_def456uvw", "timestamp": "2025-11-11T10:30:00Z", "details": {} } } ``` ## Related Resources - [Refresh Flowplate API Key](/docs/api-reference/flowplate/refresh-flowplate-api-key) - [Revoke Flowplate API Key](/docs/api-reference/flowplate/revoke-flowplate-api-key) - [Revoke All User Keys](/docs/api-reference/flowplate/revoke-all-user-keys)