Skip to main content
POST
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
api-keys
Create API Key
curl --request POST \
  --url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/api-keys \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "apiKey": "<string>"
}
'
Creates a new API key for a project. The key value is only returned once in the creation response and cannot be retrieved later.

Path Parameters

organizationId
string
required
Organization ID
projectId
string
required
Project ID

Request Body

name
string
required
Descriptive name for the API key (e.g., “iOS Production App”)
apiKey
string
Custom key value (optional, system-generated if not provided)

Example Request

{
  "name": "Android Production App"
}

Response

Returns the created API Key object including the key value.
{
  "id": "afd8012b-d81e-41c6-92cd-eed0c6cb3676",
  "name": "Android Production App",
  "key": "7zvFJw9L0qEoYdKx2mBt1sLpZj3nX7gW",
  "status": "active",
  "createdAt": "2024-03-20T10:00:00Z",
  "updatedAt": "2024-03-20T10:00:00Z"
}
Store the key value securely. This is the only time it will be returned. If lost, you must create a new API key.

Error Responses

Name Already Exists

{
  "error": {
    "code": "NAME_ALREADY_EXISTS",
    "message": "An API key with this name already exists",
    "details": {
      "name": "Android Production App"
    }
  }
}

Code Examples

curl -X POST "https://api.metabind.ai/v1/organizations/org123/projects/proj456/api-keys" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Android Production App"
  }'