For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HomeGet API key
DocumentationIntegrationsAPI Reference
DocumentationIntegrationsAPI Reference
  • API Reference
      • GETList Contacts
      • POSTCreate Contact
      • GETGet Contact
      • DELDelete Contact
      • PATCHUpdate Contact
LogoLogo
HomeGet API key
API Referencecontacts

Create Contact

POST
https://api.agentphone.ai/v1/contacts
POST
/v1/contacts
1const url = 'https://api.agentphone.ai/v1/contacts';
2const options = {
3 method: 'POST',
4 headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
5 body: '{"phoneNumber":"+14155552671","name":"Alice Johnson"}'
6};
7
8try {
9 const response = await fetch(url, options);
10 const data = await response.json();
11 console.log(data);
12} catch (error) {
13 console.error(error);
14}
1{
2 "id": "a3f1c9e2-7b4d-4f8a-9d3e-2b6f5c7a8d9e",
3 "phoneNumber": "+14155552671",
4 "name": "Alice Johnson",
5 "createdAt": "2024-01-15T09:30:00Z",
6 "updatedAt": "2024-01-15T09:30:00Z",
7 "email": "alice.johnson@example.com",
8 "notes": "Met at the tech conference in 2023."
9}
Create a new contact. Phone number is normalized to E.164 format. Returns 409 if a contact with this phone number already exists for the project.
Was this page helpful?
Previous

Get Contact

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
phoneNumberstringRequired
namestringRequired
emailstring or nullOptional
notesstring or nullOptional

Response

Successful Response
idstring
phoneNumberstring
namestring
createdAtdatetime
updatedAtdatetime
emailstring or null
notesstring or null

Errors

422
Unprocessable Entity Error