Agents Contacts
API endpoints for Agents Contacts
GET
/api/agents/{agent_id}/contacts List returns captured contacts for an agent.
Returns paginated list of captured contacts with filtering options for status, channel, date range, and search.
Response Codes
| Status Code | Description |
|---|---|
| 200 | Success |
| 404 | Resource not found |
| 500 | Internal server error |
Success
Response
Paginated response with data wrapped in a top-level 'data' key and pagination metadata in 'meta'
| Property | Type | Description |
|---|---|---|
| data.data[].id | integer (int64) | Unique contact identifier |
| data.data[].session_id | integer (int64) | ID of chat session where contact was captured |
| data.data[].channel | string | Channel where contact was captured (widget, slack, api) |
| data.data[].contact_email | string | null | Contact's email address |
| data.data[].contact_data | any | Complete contact form data |
| data.data[].contact_captured_at | string (date-time) | null | Timestamp when contact was captured |
| data.data[].contact_exported_at | string (date-time) | null | Timestamp when contact was exported |
| data.data[].status | string | Contact status (new, exported, etc.) |
| data.data[].email | string | Contact's email address (extracted from contact data) |
| data.data[].name | string | Contact's name (extracted from contact data) |
| data.data[].company | string | Contact's company (extracted from contact data) |
| data.data[].phone | string | Contact's phone number (extracted from contact data) |
| data.data[].created_at | string (date-time) | Timestamp when contact was created |
| data.meta | string | Pagination metadata |
| meta.current_page | integer | Current page number (1-indexed) |
| meta.last_page | integer | Last page number |
| meta.per_page | integer | Number of items per page |
| meta.total | integer (int64) | Total number of items across all pages |
GET
/api/agents/{agent_id}/contacts/{id} Get returns a single contact by ID.
Returns the contact details including captured data, channel, and status information.
Response Codes
| Status Code | Description |
|---|---|
| 200 | Success |
| 400 | Invalid request |
| 404 | Resource not found |
Success
Response response.Contact
Contact
| Property | Type | Description |
|---|---|---|
| id | integer (int64) | Unique contact identifier |
| session_id | integer (int64) | ID of chat session where contact was captured |
| channel | string | Channel where contact was captured (widget, slack, api) |
| contact_email | string | null | Contact's email address |
| contact_data | any | Complete contact form data |
| contact_captured_at | string (date-time) | null | Timestamp when contact was captured |
| contact_exported_at | string (date-time) | null | Timestamp when contact was exported |
| status | string | Contact status (new, exported, etc.) |
string | Contact's email address (extracted from contact data) | |
| name | string | Contact's name (extracted from contact data) |
| company | string | Contact's company (extracted from contact data) |
| phone | string | Contact's phone number (extracted from contact data) |
| created_at | string (date-time) | Timestamp when contact was created |
GET
/api/agents/{agent_id}/contacts/export.{format} Export exports contacts as CSV or JSON.
Downloads all contacts matching the filter criteria in the specified format. This operation is idempotent and does not modify contact state.
Response Codes
| Status Code | Description |
|---|---|
| 400 | Invalid request |
| 404 | Resource not found |
| 500 | Internal server error |
DELETE
/api/agents/{agent_id}/contacts/{id} Delete removes a contact.
Soft deletes the chat session associated with the contact. Returns 204 No Content on success.
Response Codes
| Status Code | Description |
|---|---|
| 204 | Success with no content |
| 400 | Invalid request |
| 404 | Resource not found |
| 500 | Internal server error |