Adding a Contact

You can manually add a new contact based on a wallet address, email, or phone number.

POST /contacts

Body

FieldTypeDescription

primaryIdentifier

'email' | 'phoneNumber' | 'walletAddress'

The primary identifier for the new contact.

value

string

The value of the primary identifier.

Response

CODEDescription

200

A contact with that identifier already existed so it returns the existing contact.

201

A new contact was created with the primary identifier and it returns the new contact.

400

The data passed in was invalid. It returns an error object with with the error message for each field.

500

Internal Sever Error

Contact Object

{
  id: string;
  createdAt: number;
  updatedAt: number;
  email?: string;
  twitterHandle?: string;
  discordUsername?: string;
  phoneNumber?: string;
  birthday?: number;
  smsOptOut?: boolean;
  agreementTimestamp?: number;
  agreedToAds?: boolean;
}

Error Object

{
    primaryIdentifier?: string;
    value?: string;
}

// Example 200 Response

{
    "id": "f2790129-2ad0-4fd8-a8d9-5ac85c07705d", // <- existing contact id
    "createdAt": "1667482286769",
    "updatedAt": "1667482286769",
    "email": "email@holder.xyz"
}

// Example 201 Response

{
    "id": "234845e8-1dc6-4902-a384-8788516bdd8b", // <- new contact id
    "createdAt": "1667482286769",
    "updatedAt": "1667482286769",
    "phoneNumber": "+13175551234"
}

// Example 400 Response

{
    "primaryIdentifier": "Primary identifier must be one of these: email, phoneNumber, or walletAddress",
    "value": "A value for the primary identifier is required."
}

Last updated