API Reference - Contacts
Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108079
← Back to API Reference | Getting Started
Contacts
Contacts are individuals stored in your directory's address book. They are separate from member accounts and are typically used to track leads, clients, or other contacts associated with your site. Contacts can be linked to other records via the Contact Links model.
Model name in URL:
contacts — DB table: contactsThe Contact Object
| Field | Type | Description |
|---|---|---|
contact_id | integer | Unique contact ID (primary key, read-only) |
first_name | string | Contact's first name |
last_name | string | Contact's last name |
email | string | Email address |
company | string | Company or organization name |
phone_number | string | Primary phone number |
fax_number | string | Fax number |
address1 | string | Primary address line |
address2 | string | Secondary address line (suite, unit, etc.) |
city | string | City |
zip_code | string | Postal/ZIP code |
state_code | string | State or province code (EG FL, CA) |
country_code | string | Two-letter country code (EG US) |
website | string | Contact's website URL |
twitter | string | Twitter handle or profile URL |
facebook | string | Facebook profile URL |
linkedin | string | LinkedIn profile URL |
blog | text | Blog URL or notes |
active | integer | Active status: 1 active, 0 inactive |
token | string | Unique contact token |
position | string | Job title or position |
profession | string | Profession or industry |
dob | string | Date of birth |
date_created | string | Date record was created (format: YYYYMMDDHHmmss) |
created_by | string | Who created the contact (EG Website, admin) |
date_updated | string | Date record was last updated (format: YYYYMMDDHHmmss) |
updated_by | string | Who last updated the contact |
rel_db | string | Related database table name (for linking to another record) |
rel_id | integer | Related record ID in the rel_db table |
additional | text | Additional notes or data |
additional_fields | text | JSON-encoded custom field values |
ip | string | IP address of the submitter |
revision_timestamp | timestamp | Timestamp of last record modification (auto-managed) |
user_consent | text | Record of user consent (GDPR/privacy compliance) |
cid | string | Virtual filter field for contact grouping |
after | string | Cursor pagination field |
bucket | string | Virtual filter field for contact bucketing |
List Contacts
GET /api/v2/contacts/get
Example Request
Copy
curl -X GET "https://www.yourdomain.com/api/v2/contacts/get?limit=25" \ -H "X-Api-Key: your-api-key-here"
Example Response
Copy
{
"status": "success",
"message": [
{
"contact_id": "1",
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"company": "Acme Corp",
"phone_number": "555-123-4567",
"fax_number": null,
"address1": "123 Main St",
"address2": null,
"city": "Miami",
"zip_code": "33101",
"state_code": "FL",
"country_code": "US",
"website": "https://example.com",
"twitter": null,
"facebook": null,
"linkedin": null,
"blog": "",
"active": "1",
"token": "",
"position": "Manager",
"profession": "",
"dob": "",
"date_created": "20240301120000",
"created_by": "Website",
"date_updated": "20240301120000",
"updated_by": "Website",
"rel_db": "",
"rel_id": "0",
"additional": "",
"additional_fields": "",
"ip": "",
"revision_timestamp": "2024-03-01 12:00:00",
"user_consent": ""
}
],
"total": "238",
"current_page": 1,
"total_pages": 10,
"next_page": "MipfKjI1"
}Retrieve a Contact
GET /api/v2/contacts/get/{contact_id}
Example Request
Copy
curl -X GET "https://www.yourdomain.com/api/v2/contacts/get/1" \ -H "X-Api-Key: your-api-key-here"
Example Response
Copy
{
"status": "success",
"message": [
{
"contact_id": "1",
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"company": "Acme Corp",
"phone_number": "555-123-4567",
"city": "Miami",
"state_code": "FL",
"zip_code": "33101",
"country_code": "US",
"active": "1",
"date_created": "20240301120000",
"revision_timestamp": "2024-03-01 12:00:00"
}
],
"total": "238",
"current_page": 1,
"total_pages": 10
}Create a Contact
POST /api/v2/contacts/create
Example Request
Copy
curl -X POST "https://www.yourdomain.com/api/v2/contacts/create" \ -H "X-Api-Key: your-api-key-here" \ -d "first_name=Jane" \ -d "last_name=Smith" \ -d "email=jane@example.com" \ -d "phone_number=555-123-4567" \ -d "company=Acme+Corp" \ -d "city=Miami" \ -d "state_code=FL" \ -d "zip_code=33101" \ -d "country_code=US"
Example Response
Copy
{
"status": "success",
"message": {
"contact_id": "239",
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"company": null,
"phone_number": "555-123-4567",
"fax_number": null,
"address1": null,
"address2": null,
"city": "Miami",
"zip_code": "33101",
"state_code": "FL",
"country_code": "US",
"website": null,
"twitter": null,
"facebook": null,
"linkedin": null,
"blog": null,
"active": null,
"token": null,
"position": null,
"profession": null,
"dob": null,
"date_created": null,
"created_by": null,
"date_updated": null,
"updated_by": null,
"rel_db": null,
"rel_id": null,
"additional": null,
"additional_fields": null,
"ip": null,
"revision_timestamp": null,
"user_consent": null
}
}Update a Contact
PUT /api/v2/contacts/update
Example Request
Copy
curl -X PUT "https://www.yourdomain.com/api/v2/contacts/update" \ -H "X-Api-Key: your-api-key-here" \ -d "contact_id=239" \ -d "city=Orlando" \ -d "phone_number=555-987-6543"
Example Response
Copy
{
"status": "success",
"message": {
"contact_id": "239",
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"company": "Acme Corp",
"phone_number": "555-987-6543",
"city": "Orlando",
"state_code": "FL",
"zip_code": "33101",
"country_code": "US",
"active": "1",
"revision_timestamp": "2024-03-02 09:15:00"
}
}Delete a Contact
DELETE /api/v2/contacts/delete
Example Request
Copy
curl -X DELETE "https://www.yourdomain.com/api/v2/contacts/delete" \ -H "X-Api-Key: your-api-key-here" \ -d "contact_id=239"
Example Response
Copy
{
"status": "success",
"message": "contacts record was deleted"
}