Create a contact

Creates a new contact and returns it with a 201 status. Use this endpoint to create a contact through the Samva email API.

POST
/v1/contacts

Creates a new contact and returns it with a 201 status.

x-api-key<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

type*string

Value in

  • "human"
  • "system"
name*string
displayName?string|null|null
avatar?string|null|null
identities?array<>|null
humanProfile?|null|null
capabilities?array<string>|null
tags?array<string>|null
accessLevel?|null
accessConfig?|null|null
preferences?|null|null
status?|null
statusReason?string|null|null
externalId?string|null|null
metadata?|null|null
createdBy?|null|null
lastModifiedBy?|null|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/contacts" \  -H "Content-Type: application/json" \  -d '{    "type": "human",    "name": "string"  }'
{  "id": "string",  "organizationId": "string",  "type": "human",  "name": "string",  "displayName": "string",  "avatar": "string",  "identities": [    {      "channel": "email",      "identifier": "string",      "verified": true    }  ],  "humanProfile": {    "firstName": "string",    "lastName": "string",    "email": "string",    "phone": "string",    "company": "string",    "jobTitle": "string",    "location": {      "country": "string",      "state": "string",      "city": "string",      "timezone": "string"    },    "customFields": {},    "source": "api",    "sourceDetails": {}  },  "capabilities": [    "string"  ],  "tags": [    "string"  ],  "accessLevel": "public",  "accessConfig": {    "paymentRequired": {      "amount": 1,      "currency": "string",      "validityHours": 1,      "message": "string"    },    "rateLimit": {      "messagesPerHour": 1,      "messagesPerDay": 1,      "cooldownMinutes": 1    },    "allowedContacts": [      "string"    ],    "blockedContacts": [      "string"    ],    "availability": {      "timezone": "string",      "schedule": [        {          "days": [            0          ],          "startTime": "string",          "endTime": "string"        }      ],      "outOfOfficeMessage": "string"    }  },  "preferences": {    "preferredChannels": [      "email"    ],    "language": "string",    "timezone": "string",    "notifications": {      "email": true,      "quiet_hours": {        "start": "string",        "end": "string"      }    },    "messageFormats": {      "preferMarkdown": true,      "preferPlainText": true,      "maxMessageLength": 1    }  },  "status": "active",  "statusReason": "string",  "externalId": "string",  "metadata": {},  "createdAt": "string",  "updatedAt": "string",  "createdBy": "string",  "lastModifiedBy": "string"}