Add a contact identity

Adds an address the contact is reached at and returns the contact.

POST
/v1/contacts/{id}/identities

Adds an address the contact is reached at and returns the contact. Adding an address the contact already has updates whether it is verified. An address another contact holds is a conflict.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^contact_[0-9a-hjkmnp-tv-z]{16,24}$

Request Body

application/json
  1. body
type*string
Value in"email""phone"
identifier*string
verified?boolean|null

Response Body

Contact

application/json
  1. response
id*ContactId
Match^contact_[0-9a-hjkmnp-tv-z]{16,24}$
namespaceId*|null
name*string
displayName*string|null
avatar*string|null
status*string
Value in"active""paused""blocked""archived"
statusReason*string|null
externalId*string|null
identities*array<>
profile*|null
preferences*|null
tags*array<string>
metadata*|null
importProvenance*|null
createdAt*string
updatedAt*string
Example Request
import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.contacts.addIdentity({  "id": "example",  "type": "email",  "identifier": "example"});
Example Response
{  "id": "string",  "namespaceId": "string",  "name": "string",  "displayName": "string",  "avatar": "string",  "status": "active",  "statusReason": "string",  "externalId": "string",  "identities": [    {      "id": "string",      "type": "email",      "identifier": "string",      "verified": true,      "channels": [        {          "channel": "sms",          "reachability": "unknown",          "consent": {            "status": "opted_in",            "source": "string",            "capturedAt": "string",            "proof": {              "property1": "string",              "property2": "string"            }          }        }      ]    }  ],  "profile": {    "firstName": "string",    "lastName": "string",    "company": "string",    "jobTitle": "string",    "location": {      "country": "string",      "state": "string",      "city": "string",      "timezone": "string"    },    "customFields": {      "property1": "string",      "property2": "string"    },    "source": "api"  },  "preferences": {    "preferredChannels": [      "sms"    ],    "language": "string",    "timezone": "string",    "notifications": {      "email": true,      "sms": true,      "whatsapp": true,      "quiet_hours": {        "start": "string",        "end": "string"      }    }  },  "tags": [    "string"  ],  "metadata": {    "property1": "string",    "property2": "string"  },  "importProvenance": {    "first": {      "jobId": "string",      "topicId": "string",      "preset": "beehiiv",      "importedAt": "string",      "summary": {        "signupAt": {          "value": "string",          "kind": "time"        },        "sources": [          "string"        ],        "omittedSources": 0      },      "evidence": [        {          "file": "string",          "row": -9007199254740991,          "declared": {            "kind": "status_column"          },          "suppressionFree": true,          "sourceStatus": "string",          "signupAt": "string",          "source": "string"        }      ]    },    "latest": {      "jobId": "string",      "topicId": "string",      "preset": "beehiiv",      "importedAt": "string",      "summary": {        "signupAt": {          "value": "string",          "kind": "time"        },        "sources": [          "string"        ],        "omittedSources": 0      },      "evidence": [        {          "file": "string",          "row": -9007199254740991,          "declared": {            "kind": "status_column"          },          "suppressionFree": true,          "sourceStatus": "string",          "signupAt": "string",          "source": "string"        }      ]    }  },  "createdAt": "string",  "updatedAt": "string"}

Related documentation