Create Contact

Overview

Creates a new contact in a specified list.

Authentication

This request requires a Authorization header with a valid token.

URL: POST https://api3.blocksurvey.io/contact/create-contact

Request Headers

Key
Value
Description

Authorization

Bearer <api_key>

API key for authentication.

Request Body

Field
Type
Required
Description

teamId

String

Yes

ID of the team owning the list.

listId

String

Yes

ID of the list to add the contact.

listPublicKey

String

Yes

Public key for encryption.

Email

String

Yes

Email address of the contact.

First Name

Last Name

Phone Number

Country

String

No

Additional column data.

cURL Example

curl -X POST https://api3.blocksurvey.io/contact/create-contact
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
    "teamId": "team-123",
    "listId": "list-456",
    "listPublicKey": "base64-public-key",
    "Email": "[email protected]",
    "First Name": "John",
    "Last Name": "Doe"
}'

Response

Successful Response

{
    "success": true,
    "recordId": "contact-id"
}

Errors

Error Message
Status Code
Description

400

Missing required fields

Required fields are missing.

401

Unauthorized

Invalid or missing API key.

404

List not found

The specified list does not exist.

409

Contact already exists

The contact already exists.

500

Internal server error

An unexpected error occurred.

Last updated