Fetch Contacts (AI Chat Bot)
Revision as of 15:30, 21 July 2026 by Ashley DeBon (talk | contribs) (→Fetch Contacts (AI Chat Bot))
Contents
Mobile_API »Fetch Contacts (AI Chat Bot)
Base URL
https://apimobile.callproof.com
Endpoint
/api/ai/chat-bot/fetch-contacts
Purpose
Finds contacts for AI chat-bot flows by searching company names that match the given name, then returning contacts created by the specified user under those companies.
HTTP Method
POST
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer access token |
Security
- Yes – Requires Bearer Token authentication.
Parameters
Path Parameters
None.
Query Parameters
None.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | integer | Yes | User ID used to find contacts created by that user |
| companyId | integer | Yes | Company ID to search within |
| name | string | Yes | Company name search text (case-insensitive partial match; maximum 255 characters) |
Successful Response (200)
Returns matching contact records.
| Field | Type | Description |
|---|---|---|
| clientStatusCode | integer | Status indicator for the client (for example, 200) |
| user_id | integer | Identifier of the authenticated user |
| company_id | integer | Identifier of the authenticated user’s company |
| data | array | List of matching contact records |
| uri | string | Requested resource URI |
data[]
| Field | Type | Description |
|---|---|---|
| id | integer | Unique identifier of the contact |
| company_id | integer | Company identifier |
| contact_company_id | integer | Linked contact-company identifier |
| created_by_id | integer | User who created the contact |
| address / address2 / city / state_id / zip / country_id | mixed | Contact address fields |
| email / website / title / account | string | Common contact profile fields |
| latitude / longitude | number/string | Contact location coordinates, when available |
| … | mixed | Additional contact fields returned from the contact record |
Error Responses
| Status Code | Meaning |
|---|---|
| 200 | Validation failed – response body uses clientStatusCode 422 with the first validation error message
|
| 400 | Bad Request – contacts could not be retrieved |
| 401 | Unauthorized – missing, invalid, or expired Bearer token |
- Validation (HTTP 200, clientStatusCode 422) – Missing/invalid
userId,companyId, orname. - 400 – No matching contacts ("No contacts found."), invalid parameters ("Invalid input parameters."), or another fetch error.
- 401 – Authentication failed or the access token is missing/expired.