Contacts
List Contacts
GET /api/contacts/
Parameters
inbox
❌
string
Deprecated: Use inboxes instead
inboxes
❌
string
Conversation platform ID (used to filter contacts from a specific inbox)
page
❌
integer
A page number within the paginated result set.
pageSize
❌
integer
Number of results to return per page.
query
❌
string
Search by name or source ID
search
❌
string
Full-text search
Code Examples
# API Call Example (Shell)
curl -X GET "https://api.maiagent.ai/api/contacts/?inbox=550e8400-e29b-41d4-a716-446655440000&inboxes=example&page=1&pageSize=1&query=example&search=example" \
-H "Authorization: Api-Key YOUR_API_KEY"
# Please replace YOUR_API_KEY and verify the request data before execution.const axios = require('axios');
// Set request headers
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY'
}
};
axios.get("https://api.maiagent.ai/api/contacts/?inbox=550e8400-e29b-41d4-a716-446655440000&inboxes=example&page=1&pageSize=1&query=example&search=example", config)
.then(response => {
console.log('Successfully received response:');
console.log(response.data);
})
.catch(error => {
console.error('An error occurred with the request:');
console.error(error.response?.data || error.message);
});Response Body
Status Code: 200
Response Schema Example
Response Example Value
Create Contact
POST /api/contacts/
Code Example
Response Body
Status Code: 201
Response Schema Example
Response Example Value
Get Contact Details
GET /api/contacts/{id}/
Parameters
id
✅
string
A UUID string identifying this Contact.
Code Examples
Response Body
Status Code: 200
Response Schema Example
Response Example Value
Update Contact
PUT /api/contacts/{id}/
Parameters
id
✅
string
A UUID string identifying this Contact.
Request Body
Request Parameters
name
string
No
Contact name
inboxes
array[object]
No
List of inboxes (new format)
inbox
object
No
Single inbox (old format, for backward compatibility)
inbox.id
string (uuid)
Yes
Inbox ID
avatar
string
No
Avatar URL
sourceId
string
No
Source ID
queryMetadata
string
No
Query metadata
Request Structure Example
Request Example Value
Code Examples
Response Body
Status Code: 200
Response Schema Example
Response Example Value
Update Contact
PATCH /api/contacts/{id}/
Parameters
id
✅
string
A UUID string identifying this Contact.
Request Body
Request Parameters
name
string
No
Contact name
inboxes
array[object]
No
List of inboxes (new format)
inbox
object
No
Single inbox (old format, for backward compatibility)
inbox.id
string (uuid)
Yes
Inbox ID
avatar
string
No
Avatar URL
sourceId
string
No
Source ID
queryMetadata
string
No
Query metadata
Request Structure Example
Request Example Value
Code Examples
Response Body
Status Code: 200
Response Schema Example
Response Example Value
Delete Contact
DELETE /api/contacts/{id}/
Parameters
id
✅
string
A UUID string identifying this Contact.
Code Examples
Response
204
No response body
400
The contact still has associated conversations and cannot be deleted
Last updated
Was this helpful?
