API Reference - API Keys
Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108131
← Back to API Reference | Getting Started
API Keys
API Keys are the credentials used to authenticate requests to the Brilliant Directories API. Each key has a name (for identification), a token (the secret value sent in the X-Api-Key header), and an active/inactive status. API keys can be created and managed from your admin panel under API Settings.
Model name in URL:
bd_api_keys — DB table: bd_api_keysThe API Key Object
| Field | Type | Description |
|---|---|---|
api_key_id | integer | Unique API key ID (primary key, read-only) |
api_name | string | Descriptive nickname for this API key (EG Zapier Integration, Mobile App); max 500 characters required on create |
api_token | string | The secret token value sent in the X-Api-Key request header; max 500 characters required on create |
api_status | integer | Whether this key is active; 1 = active, 0 = inactive. Inactive keys are rejected by the API |
added_by | integer | Foreign key referencing the administrator who created this key required on create |
created | datetime | Datetime when this API key was created |
List API Keys
GET /api/v2/bd_api_keys/get
Example Request
Copy
curl -X GET "https://www.yourdomain.com/api/v2/bd_api_keys/get?limit=25" \ -H "X-Api-Key: your-api-key-here"
Example Response
Copy
{
"status": "success",
"message": [
{
"api_key_id": "3",
"api_name": "Zapier",
"api_token": "f6fa665b2a5fe8dfbebf5d5eba3c3821",
"api_status": "1",
"added_by": "27",
"created": "2023-07-13 09:57:45"
},
{
"api_key_id": "8",
"api_name": "Mobile App",
"api_token": "b417400ae864ba5413f0d063e5027591",
"api_status": "1",
"added_by": "27",
"created": "2023-10-26 08:23:43"
}
],
"total": "7",
"current_page": 1,
"total_pages": 1
}Retrieve an API Key
GET /api/v2/bd_api_keys/get/{api_key_id}
Example Request
Copy
curl -X GET "https://www.yourdomain.com/api/v2/bd_api_keys/get/3" \ -H "X-Api-Key: your-api-key-here"
Example Response
Copy
{
"status": "success",
"message": [
{
"api_key_id": "3",
"api_name": "Zapier",
"api_token": "f6fa665b2a5fe8dfbebf5d5eba3c3821",
"api_status": "1",
"added_by": "27",
"created": "2023-07-13 09:57:45"
}
],
"total": "1",
"current_page": 1,
"total_pages": 1
}Create an API Key
POST /api/v2/bd_api_keys/create
Example Request
Copy
curl -X POST "https://www.yourdomain.com/api/v2/bd_api_keys/create" \ -H "X-Api-Key: your-api-key-here" \ -d "api_name=New+Integration" \ -d "api_token=a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6" \ -d "api_status=1" \ -d "added_by=27"
Example Response
Copy
{
"status": "success",
"message": {
"api_key_id": "14",
"api_name": "New Integration",
"api_token": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
"api_status": "1",
"added_by": "27",
"created": null
}
}Update an API Key
PUT /api/v2/bd_api_keys/update
Example Request
Copy
curl -X PUT "https://www.yourdomain.com/api/v2/bd_api_keys/update" \ -H "X-Api-Key: your-api-key-here" \ -d "api_key_id=14" \ -d "api_name=Updated+Integration" \ -d "api_status=0"
Example Response
Copy
{
"status": "success",
"message": {
"api_key_id": "14",
"api_name": "Updated Integration",
"api_token": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
"api_status": "0",
"added_by": "27",
"created": "0000-00-00 00:00:00"
}
}Delete an API Key
DELETE /api/v2/bd_api_keys/delete
Example Request
Copy
curl -X DELETE "https://www.yourdomain.com/api/v2/bd_api_keys/delete" \ -H "X-Api-Key: your-api-key-here" \ -d "api_key_id=14"
Example Response
Copy
{
"status": "success",
"message": "bd_api_keys record was deleted"
}