> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.jelliu.co/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.jelliu.co/_mcp/server.

# Add a contact

POST https://api.jelliu.co/api/campaigns/{campaignId}/contacts
Content-Type: application/json

Adds one contact to a campaign that is not `completed`/`archived`. It is created `pending`. At
least one of `phoneNumber`, `email` or `whatsappNumber` is required. For more than a handful of
contacts use `POST /api/campaigns/{campaignId}/contacts/bulk`.

**Deduplication.** The contact is keyed by phone number inside the campaign:

* The phone already exists in this campaign: the existing row is returned (still 201). Blank
  `email`, `whatsapp_number` and `name` are filled in from the request, and values already
  stored are never overwritten.
* The contact was removed from this campaign earlier: it is restored as `pending` with the new
  values.
* Email-only request (no phone or WhatsApp) whose address already belongs to a contact anywhere
  in the workspace (case-insensitive): that contact is returned, with a blank `name` filled in.
  Its `campaign_id` can then be a different campaign.

Adding a contact to an `active` campaign does not queue it. Pause and activate the campaign to
reach it. A voice campaign can only call contacts with a real phone number; email-only contacts
end as `invalid` there.

**Side effects.** Inserts the contact, records its consent provenance (`api:manual`, no evidence)
and writes an audit entry. Nobody is contacted.

**Idempotency.** Safe to retry: the same phone (or the same address, for email-only contacts)
returns the same row.

**Webhook events.** `contact.created` for each new contact row (`{ contactId, campaignId, name, phoneNumber, email, whatsappNumber, status, source, createdAt }`, with `source` `api:manual`); not sent when an existing contact is returned. Delivered only to webhooks that name `contact.created` (the `"*"` wildcard does not include it). Also `audit.log_recorded` for webhooks subscribed to it. See [Webhooks](/webhooks).

**Access**

* **Required scope:** `write` (or `full`).
* **Rate limit:** General API — 120 requests/min per workspace on Starter or with no active plan, 200 on Growth, 300 on Business, 600 on Enterprise. The 5/min contacts-import limit does not apply to this route. See [Rate limits](/rate-limits).
* **Plan:** Counts against the workspace-wide contact cap (Starter 500, Growth 2,000, Business 20,000). Refused with 403 `BILLING_ERROR` when the cap is reached, even if the contact already exists.

Reference: https://developer.jelliu.co/api-reference/contacts/post-campaigns-by-campaign-id-contacts

## Authentication

- `Authorization` header (bearer token, required) — Workspace API key: `jl_` followed by 64 lowercase hex characters, created by the workspace owner in the dashboard (**Settings → API Keys**) and sent as `Authorization: Bearer jl_...`. The plaintext is shown once, at creation; Jelliu stores only a SHA-256 hash. A workspace can hold up to 25 active keys. | Scope | GET / HEAD | POST / PUT / PATCH / DELETE | Admin-only routes | | --- | --- | --- | --- | | `read` | Yes | No | No | | `write` | Yes | Yes | No | | `full` | Yes | Yes | Yes | Operations restricted to admins or owners reject keys without the `full` scope with `403`, and say so in their description. No key, whatever its scope, can mint or revoke API keys or rotate a webhook secret — that requires a signed-in owner session. A revoked key stops authenticating within about 10 seconds. See [Authentication](/authentication).

## Request

### Path parameters

- `campaignId` (string, required) — UUID of the campaign that receives the contact. An unknown, deleted or foreign campaign answers 404; a value that is not a UUID answers 400.

### Body (application/json)

This endpoint expects an object.

- `phoneNumber` (string, optional) — E.164 phone number with country code (`Must be E.164 format`). It is the dedup key in the campaign. Numbers shorter than 7 digits pass here but cannot be dialed and end as `invalid`.
- `email` (string, optional) — Email address (`Invalid email`). Required for email campaigns.
- `whatsappNumber` (string, optional) — E.164 WhatsApp number. Used as the dedup key when there is no `phoneNumber`.
- `name` (string, optional) — Contact's name; the first word feeds `contact.first_name`.
- `metadata` (map from string to string, optional) — Up to 20 keys matching `^[a-zA-Z0-9_-]+$`, string values up to 500 characters. The agent can read them, and tokens can use them as `contact.metadata.<key>`. Card-like and 9-digit ID-like numbers are redacted before storage.
- `crmExternalId` (string, optional) — Id of the matching record in an external CRM.
- `crmProvider` (string, optional) — CRM the external id belongs to.

## Response

### 201

The created, restored or existing contact.

- `data` (object, required) — A contact row as returned by `POST /api/campaigns/{campaignId}/contacts`. Keys are snake\_case. `phone_number` is always present: contacts saved with only a WhatsApp number use it, and email-only contacts get a synthetic key `em:<16 hex>`.
  - `id` (string, optional) — Unique identifier of the contact.
  - `tenant_id` (string, optional) — Workspace that owns the contact.
  - `campaign_id` (string, optional, nullable) — Campaign the contact belongs to. For an email-only save matched to an existing contact, this can be a different campaign than the one in the path.
  - `phone_number` (string, optional) — Dial target and dedup key inside the campaign. E.164, or a synthetic `em:<hash>` for email-only contacts.
  - `email` (string, optional, nullable) — Email address used by email campaigns.
  - `whatsapp_number` (string, optional, nullable) — E.164 WhatsApp number. Filled from `phone_number` when a WhatsApp campaign with a template is activated.
  - `name` (string, optional, nullable) — Contact's name, available to the agent and to the `contact.name` / `contact.first_name` tokens.
  - `status` (enum, optional) — Where the contact is in the campaign: `pending`, `called`, `converted`, `failed`, `dnc` or `invalid`. Only `pending` contacts are queued on activation.
    - Allowed values: `pending`, `called`, `converted`, `failed`, `dnc`, `invalid`
  - `metadata` (map from string to any, optional, nullable) — Free-form data the agent can read and tokens can use (`contact.metadata.<key>`). Card-like and 9-digit ID-like numbers are redacted on write. Values captured during conversations may be numbers or booleans.
  - `call_attempts` (integer, optional) — Call attempts recorded for the contact.
  - `last_called_at` (datetime, optional, nullable) — When the dialer or sender last claimed the contact.
  - `crm_external_id` (string, optional, nullable) — Id of the matching record in an external CRM.
  - `crm_provider` (string, optional, nullable) — CRM the external id belongs to, for example `hubspot`.
  - `sync_status` (string, optional) — CRM push state; `none` until the contact is first written to a CRM, then `synced`.
  - `last_synced_to_crm_at` (datetime, optional, nullable) — When the contact was last written to the CRM.
  - `sync_error` (string, optional, nullable) — Last CRM push error; `null` after a successful push.
  - `opted_out_at` (datetime, optional, nullable) — When the contact asked not to be contacted again; a non-null value blocks all outreach.
  - `opted_out_reason` (string, optional, nullable) — Why or how the contact opted out.
  - `created_at` (datetime, optional) — When the contact was created.
  - `updated_at` (datetime, optional) — Last change to the contact.
  - `deleted_at` (datetime, optional, nullable) — Always `null` in responses.

## Errors

### 400 Bad Request Error

The id is not a UUID, the body is invalid (Zod field map in `details`), or the campaign is completed/archived.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `PAYLOAD_TOO_LARGE`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields); * for a rejected multipart upload (file in an unexpected field, too many files), a list with the upload error `code` (for example `LIMIT_UNEXPECTED_FILE`) and the `field` name. Absent when the value was rejected outside the route's own validation: a malformed id, number or date the database could not read, or a JSON body that does not parse.
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps), `tier` alone (feature gates), or `tier` = `none` with `kind` = `subscription_required` when the workspace has no active subscription. See [Errors](/errors).

### 401 Unauthorized Error

No usable credential. Either the `Authorization` header is missing or is not a well-formed `Bearer jl_…` key, or the key is unknown, revoked or expired. Do not retry with the same key. See [Authentication](/authentication#401-unauthorized).

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `PAYLOAD_TOO_LARGE`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields); * for a rejected multipart upload (file in an unexpected field, too many files), a list with the upload error `code` (for example `LIMIT_UNEXPECTED_FILE`) and the `field` name. Absent when the value was rejected outside the route's own validation: a malformed id, number or date the database could not read, or a JSON body that does not parse.
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps), `tier` alone (feature gates), or `tier` = `none` with `kind` = `subscription_required` when the workspace has no active subscription. See [Errors](/errors).

### 403 Forbidden Error

The workspace contact cap is reached, or the API key lacks the `write` scope.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `PAYLOAD_TOO_LARGE`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields); * for a rejected multipart upload (file in an unexpected field, too many files), a list with the upload error `code` (for example `LIMIT_UNEXPECTED_FILE`) and the `field` name. Absent when the value was rejected outside the route's own validation: a malformed id, number or date the database could not read, or a JSON body that does not parse.
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps), `tier` alone (feature gates), or `tier` = `none` with `kind` = `subscription_required` when the workspace has no active subscription. See [Errors](/errors).

### 404 Not Found Error

The campaign does not exist, was deleted, or belongs to another workspace.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `PAYLOAD_TOO_LARGE`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields); * for a rejected multipart upload (file in an unexpected field, too many files), a list with the upload error `code` (for example `LIMIT_UNEXPECTED_FILE`) and the `field` name. Absent when the value was rejected outside the route's own validation: a malformed id, number or date the database could not read, or a JSON body that does not parse.
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps), `tier` alone (feature gates), or `tier` = `none` with `kind` = `subscription_required` when the workspace has no active subscription. See [Errors](/errors).

### 429 Too Many Requests Error

General API rate limit exceeded.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `PAYLOAD_TOO_LARGE`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields); * for a rejected multipart upload (file in an unexpected field, too many files), a list with the upload error `code` (for example `LIMIT_UNEXPECTED_FILE`) and the `field` name. Absent when the value was rejected outside the route's own validation: a malformed id, number or date the database could not read, or a JSON body that does not parse.
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps), `tier` alone (feature gates), or `tier` = `none` with `kind` = `subscription_required` when the workspace has no active subscription. See [Errors](/errors).

## Examples

### Contacts_postCampaignsByCampaignIdContacts_example

**Request**

```json
undefined
```

**Response**

```json
{
  "data": {
    "id": "3f2e1d0c-9b8a-4776-8554-433221100fed",
    "tenant_id": "0e9d7c3b-8a1f-4c55-b7a2-3c4d5e6f7a8b",
    "campaign_id": "5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10",
    "phone_number": "+573001234567",
    "email": "maria.gomez@example.com",
    "whatsapp_number": null,
    "name": "María Gómez",
    "status": "pending",
    "metadata": {
      "ciudad": "Medellín",
      "plan": "prepago",
      "saldo_pendiente": "45900"
    },
    "call_attempts": 0,
    "last_called_at": null,
    "crm_external_id": null,
    "crm_provider": null,
    "sync_status": "none",
    "last_synced_to_crm_at": null,
    "sync_error": null,
    "opted_out_at": null,
    "opted_out_reason": null,
    "created_at": "2026-09-15T10:11:12.000Z",
    "updated_at": "2026-09-15T10:11:12.000Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python Contacts_postCampaignsByCampaignIdContacts_example
import requests

url = "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Contacts_postCampaignsByCampaignIdContacts_example
const url = 'https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Contacts_postCampaignsByCampaignIdContacts_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Contacts_postCampaignsByCampaignIdContacts_example
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Contacts_postCampaignsByCampaignIdContacts_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Contacts_postCampaignsByCampaignIdContacts_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Contacts_postCampaignsByCampaignIdContacts_example
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Contacts_postCampaignsByCampaignIdContacts_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Phone contact with metadata

**Request**

```json
{
  "phoneNumber": "+573001234567",
  "email": "maria.gomez@example.com",
  "name": "María Gómez",
  "metadata": {
    "ciudad": "Medellín",
    "plan": "prepago",
    "saldo_pendiente": "45900"
  }
}
```

**Response**

```json
{
  "data": {
    "id": "3f2e1d0c-9b8a-4776-8554-433221100fed",
    "tenant_id": "0e9d7c3b-8a1f-4c55-b7a2-3c4d5e6f7a8b",
    "campaign_id": "5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10",
    "phone_number": "+573001234567",
    "email": "maria.gomez@example.com",
    "whatsapp_number": null,
    "name": "María Gómez",
    "status": "pending",
    "metadata": {
      "ciudad": "Medellín",
      "plan": "prepago",
      "saldo_pendiente": "45900"
    },
    "call_attempts": 0,
    "last_called_at": null,
    "crm_external_id": null,
    "crm_provider": null,
    "sync_status": "none",
    "last_synced_to_crm_at": null,
    "sync_error": null,
    "opted_out_at": null,
    "opted_out_reason": null,
    "created_at": "2026-09-15T10:11:12.000Z",
    "updated_at": "2026-09-15T10:11:12.000Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python Phone contact with metadata
import requests

url = "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts"

payload = {
    "phoneNumber": "+573001234567",
    "email": "maria.gomez@example.com",
    "name": "María Gómez",
    "metadata": {
        "ciudad": "Medellín",
        "plan": "prepago",
        "saldo_pendiente": "45900"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Phone contact with metadata
const url = 'https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"phoneNumber":"+573001234567","email":"maria.gomez@example.com","name":"María Gómez","metadata":{"ciudad":"Medellín","plan":"prepago","saldo_pendiente":"45900"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Phone contact with metadata
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts"

	payload := strings.NewReader("{\n  \"phoneNumber\": \"+573001234567\",\n  \"email\": \"maria.gomez@example.com\",\n  \"name\": \"María Gómez\",\n  \"metadata\": {\n    \"ciudad\": \"Medellín\",\n    \"plan\": \"prepago\",\n    \"saldo_pendiente\": \"45900\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Phone contact with metadata
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"phoneNumber\": \"+573001234567\",\n  \"email\": \"maria.gomez@example.com\",\n  \"name\": \"María Gómez\",\n  \"metadata\": {\n    \"ciudad\": \"Medellín\",\n    \"plan\": \"prepago\",\n    \"saldo_pendiente\": \"45900\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Phone contact with metadata
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"phoneNumber\": \"+573001234567\",\n  \"email\": \"maria.gomez@example.com\",\n  \"name\": \"María Gómez\",\n  \"metadata\": {\n    \"ciudad\": \"Medellín\",\n    \"plan\": \"prepago\",\n    \"saldo_pendiente\": \"45900\"\n  }\n}")
  .asString();
```

```php Phone contact with metadata
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts', [
  'body' => '{
  "phoneNumber": "+573001234567",
  "email": "maria.gomez@example.com",
  "name": "María Gómez",
  "metadata": {
    "ciudad": "Medellín",
    "plan": "prepago",
    "saldo_pendiente": "45900"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Phone contact with metadata
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"phoneNumber\": \"+573001234567\",\n  \"email\": \"maria.gomez@example.com\",\n  \"name\": \"María Gómez\",\n  \"metadata\": {\n    \"ciudad\": \"Medellín\",\n    \"plan\": \"prepago\",\n    \"saldo_pendiente\": \"45900\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Phone contact with metadata
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "phoneNumber": "+573001234567",
  "email": "maria.gomez@example.com",
  "name": "María Gómez",
  "metadata": [
    "ciudad": "Medellín",
    "plan": "prepago",
    "saldo_pendiente": "45900"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### WhatsApp-only contact

**Request**

```json
{
  "whatsappNumber": "+525512345678",
  "name": "Jorge Ramírez"
}
```

**Response**

```json
{
  "data": {
    "id": "3f2e1d0c-9b8a-4776-8554-433221100fed",
    "tenant_id": "0e9d7c3b-8a1f-4c55-b7a2-3c4d5e6f7a8b",
    "campaign_id": "5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10",
    "phone_number": "+573001234567",
    "email": "maria.gomez@example.com",
    "whatsapp_number": null,
    "name": "María Gómez",
    "status": "pending",
    "metadata": {
      "ciudad": "Medellín",
      "plan": "prepago",
      "saldo_pendiente": "45900"
    },
    "call_attempts": 0,
    "last_called_at": null,
    "crm_external_id": null,
    "crm_provider": null,
    "sync_status": "none",
    "last_synced_to_crm_at": null,
    "sync_error": null,
    "opted_out_at": null,
    "opted_out_reason": null,
    "created_at": "2026-09-15T10:11:12.000Z",
    "updated_at": "2026-09-15T10:11:12.000Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python WhatsApp-only contact
import requests

url = "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts"

payload = {
    "whatsappNumber": "+525512345678",
    "name": "Jorge Ramírez"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript WhatsApp-only contact
const url = 'https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"whatsappNumber":"+525512345678","name":"Jorge Ramírez"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go WhatsApp-only contact
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts"

	payload := strings.NewReader("{\n  \"whatsappNumber\": \"+525512345678\",\n  \"name\": \"Jorge Ramírez\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby WhatsApp-only contact
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"whatsappNumber\": \"+525512345678\",\n  \"name\": \"Jorge Ramírez\"\n}"

response = http.request(request)
puts response.read_body
```

```java WhatsApp-only contact
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"whatsappNumber\": \"+525512345678\",\n  \"name\": \"Jorge Ramírez\"\n}")
  .asString();
```

```php WhatsApp-only contact
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts', [
  'body' => '{
  "whatsappNumber": "+525512345678",
  "name": "Jorge Ramírez"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp WhatsApp-only contact
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"whatsappNumber\": \"+525512345678\",\n  \"name\": \"Jorge Ramírez\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift WhatsApp-only contact
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "whatsappNumber": "+525512345678",
  "name": "Jorge Ramírez"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Contact linked to a CRM record

**Request**

```json
{
  "phoneNumber": "+13055550142",
  "name": "Ana Lucía Torres",
  "crmExternalId": "18234097",
  "crmProvider": "hubspot"
}
```

**Response**

```json
{
  "data": {
    "id": "3f2e1d0c-9b8a-4776-8554-433221100fed",
    "tenant_id": "0e9d7c3b-8a1f-4c55-b7a2-3c4d5e6f7a8b",
    "campaign_id": "5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10",
    "phone_number": "+573001234567",
    "email": "maria.gomez@example.com",
    "whatsapp_number": null,
    "name": "María Gómez",
    "status": "pending",
    "metadata": {
      "ciudad": "Medellín",
      "plan": "prepago",
      "saldo_pendiente": "45900"
    },
    "call_attempts": 0,
    "last_called_at": null,
    "crm_external_id": null,
    "crm_provider": null,
    "sync_status": "none",
    "last_synced_to_crm_at": null,
    "sync_error": null,
    "opted_out_at": null,
    "opted_out_reason": null,
    "created_at": "2026-09-15T10:11:12.000Z",
    "updated_at": "2026-09-15T10:11:12.000Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python Contact linked to a CRM record
import requests

url = "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts"

payload = {
    "phoneNumber": "+13055550142",
    "name": "Ana Lucía Torres",
    "crmExternalId": "18234097",
    "crmProvider": "hubspot"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Contact linked to a CRM record
const url = 'https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"phoneNumber":"+13055550142","name":"Ana Lucía Torres","crmExternalId":"18234097","crmProvider":"hubspot"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Contact linked to a CRM record
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts"

	payload := strings.NewReader("{\n  \"phoneNumber\": \"+13055550142\",\n  \"name\": \"Ana Lucía Torres\",\n  \"crmExternalId\": \"18234097\",\n  \"crmProvider\": \"hubspot\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Contact linked to a CRM record
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"phoneNumber\": \"+13055550142\",\n  \"name\": \"Ana Lucía Torres\",\n  \"crmExternalId\": \"18234097\",\n  \"crmProvider\": \"hubspot\"\n}"

response = http.request(request)
puts response.read_body
```

```java Contact linked to a CRM record
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"phoneNumber\": \"+13055550142\",\n  \"name\": \"Ana Lucía Torres\",\n  \"crmExternalId\": \"18234097\",\n  \"crmProvider\": \"hubspot\"\n}")
  .asString();
```

```php Contact linked to a CRM record
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts', [
  'body' => '{
  "phoneNumber": "+13055550142",
  "name": "Ana Lucía Torres",
  "crmExternalId": "18234097",
  "crmProvider": "hubspot"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Contact linked to a CRM record
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"phoneNumber\": \"+13055550142\",\n  \"name\": \"Ana Lucía Torres\",\n  \"crmExternalId\": \"18234097\",\n  \"crmProvider\": \"hubspot\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Contact linked to a CRM record
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "phoneNumber": "+13055550142",
  "name": "Ana Lucía Torres",
  "crmExternalId": "18234097",
  "crmProvider": "hubspot"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10/contacts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```