Base URL: https://{tenant-domain}.agentcis.com/api/v2/clients |
All endpoints require authentication using Bearer token
A Bearer token is a secret string sent in an HTTP request header that authenticates the user
curl -X GET "https://demoagency.agentcisapp.com/api/v2/clients" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Accept: application/json" |
Endpoint: /list
Method: POST
Description: Retrieve paginated list of all clients
Permissions: manage.webleads|only.view.clients|manage.assigned.office.clients
Payload:
{ "page": int , //type int (optional, default: 1) "per_page": int , //type int (optional, default: 10) "filters": {} }
|
Response:
{ "data": [ { "id": 1, "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com", "phone": "+1234567890", "status": "active", "assigned_to": "user_id", "created_at": "2024-01-01T00:00:00Z" } ], “permissions”: { ....... }, "link": { …………… } "meta": { …………… } } |
Endpoint: /
Method: POST
Description: Create a new prospect record after starting application of this prospect turns into client (here in this case email is mandatory)
Permissions: manage.clients
Payload:
{ "first_name": "John",//required "last_name": "Smith", //required "email": "john.smith@example.com", "phone": "+1234567890", “secondary_email”:””, “first_point_of_contact”:””, “street”:”” , “city”:””, “ zip_code”:””, “ state state”:””, "assignee": "user_id", //required “id”: ”this users id”, “preferred_intake”: , visa_expiry_date, visa_type, country, custom, country_of_passport, service:{}, referrer, passport_number "source": { }, "gender": "male" , }, from_conversation |
Response
{ "data": { "id": 1, "name": "John Smith", }, "message": "You\u2019ve successfully added a Prospect." } |
Status: 201
Endpoint: /{client_id}
Method: GET
Description: Retrieve detailed information about a specific client
Permissions: Client-specific permissions
Response
{ "data": { "id": 1, "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com", "phone": "+1234567890", "dob": "1990-01-01", "gender": "male", "status": "active", "rating": 5, "assigned_to": "user_id", "branch_id": "branch_id", "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-01T00:00:00Z" } } |
Status: 404, 403, 200
Endpoint: /{client_id}
Method: POST
Description: Update an existing client record
Permissions: Client-specific permissions
Payload:
{ "first_name": "John", "last_name": "Smith", "email": "john.smith@example.com", "phone": "+1234567890", “secondary_email”:””, “first_point_of_contact”:””, “street”:”” , “city”:””, “ zip_code”:””, “ state state”:””, "assignee": "user_id", “id”: ”this users id”, “preferred_intake”: , visa_expiry_date, visa_type, country, country_of_passport, service:{}, followers:null //default value, passport_number "rating": 4, tags "source": { }, "gender": "male" , “_method”: “PUT” } |
Response
{message: "You’ve successfully updated your client’s information."}
|
Status: 400, 403, 200
Endpoint: /{client_id}/application
Method: POST
Description: Start an application of existing prospect
Permissions: Client-specific permissions
Payload:
{ "service_id":3, "product_id":1571, "vendor_branch_id":124, "vendor_id":30 } |
Response
{ “data”:{}, "message": "Application added successfully" } |
Status: 400, 403, 200
Endpoint: /{client_id}/application
Method: GET
Description: List of all the applied applications by client
Permissions: Client-specific permissions
Payload:
{ "service_id":3, "product_id":1571, "vendor_branch_id":124, "vendor_id":30 } |
Response
{ “data”:{}, "message": "Application added successfully" } |
Status: 400, 403, 200