Contacts
Creates a new contact or updates an existing one if a contact with the same email or phone already exists. Optionally assigns segments and redeems a referral code.
Authorization
BearerAuth AuthorizationBearer <token>
API token obtained from the Informly dashboard
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "http://api.informly.co/api/v1/contacts" \ -H "Content-Type: application/json" \ -d '{}'{
"data": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"email": "string",
"phone": "string",
"contact": {
"firstname": "string",
"lastname": "string",
"jobtitle": "string",
"company": "string"
},
"segments": [
{
"segmentId": "f2f864fb-5d15-4f35-b9aa-83491924c4db",
"assignedAt": "2019-08-24T14:15:22Z"
}
],
"organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "string",
"details": [
{
"path": "string",
"message": "string"
}
]
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "string",
"details": [
{
"path": "string",
"message": "string"
}
]
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "string",
"details": [
{
"path": "string",
"message": "string"
}
]
}
}SDK
import { Informly } from "@informly/sdk";
const client = new Informly.Client({
token: "YOUR_API_TOKEN",
});
const response = await client.contacts.createContact({
email: "jane@example.com",
phone: "+1234567890",
firstname: "Jane",
lastname: "Doe",
jobtitle: "Engineer",
company: "Acme Inc",
segmentIds: "segmentIds",
referralCode: "referralCode",
});
console.log(response);