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
Request Body
Descriptive name for the API key (e.g., “iOS Production App”)
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"
}'