> 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.

# Reach a contact on WhatsApp

POST https://api.jelliu.co/api/whatsapp/reach
Content-Type: application/json

Delivers something to the contact on WhatsApp without the caller having to know whether
WhatsApp's 24-hour window is open. Built for AI agents and automations.

- **Window open** (the contact wrote to your line in the last 24 hours): `message` is sent as
  written. `form` is `freeform`.
- **Window closed:** the workspace's **newest approved template** in `language` is sent
  instead, with no variables. It opens the thread but does **not** carry `message`. `form`
  is `template`, and `note` says the content still has to be sent once the person replies.
  If there is no approved template in that language, the call fails with
  `422 NO_TEMPLATE_AVAILABLE` and nothing is sent.

`note` is written for an AI agent to relay honestly. Show or speak what it says, and never
claim the material was delivered when `form` is `template`. All the guards of
`POST /api/whatsapp/send` apply (compliance, opt-out, daily cap, sender). The message is not
added to a conversation thread.

**Side effects.** Sends a real WhatsApp message, either freeform or a
business-initiated template that WhatsApp bills. Consumes one unit of the daily WhatsApp send
cap, refunded if the telephony carrier rejects it. Does not draw on the AI-message allowance. Writes an
audit entry.

**Idempotency.** Not idempotent. A retry sends again. After a template fallback, a retry
sends the template a second time.

**Webhook events.** `audit.log_recorded` for subscribers that selected it explicitly. See [Webhooks](/webhooks).

**Access**
- **Required scope:** `write`.
- **Rate limit:** Outbound — 20 requests/min per workspace, fail-closed **and** the configuration-mutations limiter — 10 requests/min per workspace, shared. See [Rate limits](/rate-limits).
- **Plan:** Available on every plan. Requires a WhatsApp sender in `ONLINE` status, and an approved template in `language` to reach contacts outside the window.


Reference: https://developer.jelliu.co/api-reference/whats-app/post-whatsapp-reach

## 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

### Body (application/json)

This endpoint expects an object.

- `contactId` (string, required) — Contact to reach. Must belong to the workspace and have a `whatsapp_number`.
- `message` (string, required) — Text to send when the window is open. Not sent when the template fallback is used.
- `language` (string, optional, default: es) — Language code of the fallback template, matched exactly against the template's language (e.g. `es`, `en`, `pt_BR`).

## Response

### 200

A message was sent. `form` says which kind.

- `data` (object, required)
  - `messageSid` (string, required) — Carrier message id.
  - `status` (string, required) — The carrier's initial message status.
  - `form` (enum, required) — What was sent. - `freeform`: `message` was delivered as written. - `template`: the window was closed, so an approved opener template was sent instead of `message`.
    - Allowed values: `freeform`, `template`
  - `note` (string, required) — English instruction for an AI agent describing what actually went out and what to tell the person.

## Errors

### 400 Bad Request Error

Body failed validation (`Invalid input`, field map in `details`), `NO_WHATSAPP_NUMBER` or `INVALID_RECIPIENT`.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `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).
    - 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) or `tier` and `feature` (feature gates).

### 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`, `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).
    - 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) or `tier` and `feature` (feature gates).

### 403 Forbidden Error

The contact opted out, 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`, `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).
    - 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) or `tier` and `feature` (feature gates).

### 409 Conflict Error

The WhatsApp sender is still being approved or is offline (`SENDER_NOT_REGISTERED`).

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `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).
    - 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) or `tier` and `feature` (feature gates).

### 422 Unprocessable Entity Error

`NO_TEMPLATE_AVAILABLE` (window closed and no approved template in `language`, so nothing was sent), `TEMPLATE_NOT_APPROVED`, or `SENDER_NOT_REGISTERED`.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `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).
    - 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) or `tier` and `feature` (feature gates).

### 423 Locked Error

`COMPLIANCE_BLOCKED`: do-not-contact list, blocked prefix, or outside allowed hours.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `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).
    - 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) or `tier` and `feature` (feature gates).

### 429 Too Many Requests Error

A request limiter was exceeded, `DAILY_CAP_REACHED`, or provider throttling (`RATE_LIMITED`).

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `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).
    - 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) or `tier` and `feature` (feature gates).

### 502 Bad Gateway Error

`WHATSAPP_SEND_FAILED`: unmapped carrier error.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `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).
    - 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) or `tier` and `feature` (feature gates).

## Examples

### Window open, text delivered

**Request**

```json
undefined
```

**Response**

```json
{
  "data": {
    "messageSid": "SM0123456789abcdef0123456789abcdef",
    "status": "queued",
    "form": "freeform",
    "note": "Sent on WhatsApp, in full. Tell the person it is already in their WhatsApp."
  }
}
```

**SDK Code**

```python Window open, text delivered
import requests

url = "https://api.jelliu.co/api/whatsapp/reach"

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

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

print(response.json())
```

```javascript Window open, text delivered
const url = 'https://api.jelliu.co/api/whatsapp/reach';
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 Window open, text delivered
package main

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

func main() {

	url := "https://api.jelliu.co/api/whatsapp/reach"

	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 Window open, text delivered
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/whatsapp/reach")

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 Window open, text delivered
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jelliu.co/api/whatsapp/reach")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Window open, text delivered
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jelliu.co/api/whatsapp/reach', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Window open, text delivered
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/whatsapp/reach");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Window open, text delivered
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/whatsapp/reach")! 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()
```

### Window closed, template sent instead

**Request**

```json
undefined
```

**Response**

```json
{
  "data": {
    "messageSid": "SMa1b2c3d4e5f60718293a4b5c6d7e8f90",
    "status": "queued",
    "form": "template",
    "note": "WhatsApp only allows an approved template until the person writes to the line first, so an opening message was sent — NOT the material. Tell the person exactly that: you just wrote to them on WhatsApp, and if they reply there you will send the whole thing. Do not claim the information itself has been sent."
  }
}
```

**SDK Code**

```python Window closed, template sent instead
import requests

url = "https://api.jelliu.co/api/whatsapp/reach"

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

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

print(response.json())
```

```javascript Window closed, template sent instead
const url = 'https://api.jelliu.co/api/whatsapp/reach';
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 Window closed, template sent instead
package main

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

func main() {

	url := "https://api.jelliu.co/api/whatsapp/reach"

	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 Window closed, template sent instead
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/whatsapp/reach")

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 Window closed, template sent instead
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jelliu.co/api/whatsapp/reach")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Window closed, template sent instead
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jelliu.co/api/whatsapp/reach', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Window closed, template sent instead
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/whatsapp/reach");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Window closed, template sent instead
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/whatsapp/reach")! 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()
```

### Default (Spanish fallback template)

**Request**

```json
{
  "contactId": "7d6c5b4a-3f2e-4d1c-8b9a-0e1f2a3b4c5d",
  "message": "Hola Andrés, aquí tienes la información del plan Empresarial: 3 líneas, 1.500 minutos y soporte prioritario por $450.000 COP al mes."
}
```

**Response**

```json
{
  "data": {
    "messageSid": "SM0123456789abcdef0123456789abcdef",
    "status": "queued",
    "form": "freeform",
    "note": "Sent on WhatsApp, in full. Tell the person it is already in their WhatsApp."
  }
}
```

**SDK Code**

```python Default (Spanish fallback template)
import requests

url = "https://api.jelliu.co/api/whatsapp/reach"

payload = {
    "contactId": "7d6c5b4a-3f2e-4d1c-8b9a-0e1f2a3b4c5d",
    "message": "Hola Andrés, aquí tienes la información del plan Empresarial: 3 líneas, 1.500 minutos y soporte prioritario por $450.000 COP al mes."
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Default (Spanish fallback template)
const url = 'https://api.jelliu.co/api/whatsapp/reach';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"contactId":"7d6c5b4a-3f2e-4d1c-8b9a-0e1f2a3b4c5d","message":"Hola Andrés, aquí tienes la información del plan Empresarial: 3 líneas, 1.500 minutos y soporte prioritario por $450.000 COP al mes."}'
};

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

```go Default (Spanish fallback template)
package main

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

func main() {

	url := "https://api.jelliu.co/api/whatsapp/reach"

	payload := strings.NewReader("{\n  \"contactId\": \"7d6c5b4a-3f2e-4d1c-8b9a-0e1f2a3b4c5d\",\n  \"message\": \"Hola Andrés, aquí tienes la información del plan Empresarial: 3 líneas, 1.500 minutos y soporte prioritario por $450.000 COP al mes.\"\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 Default (Spanish fallback template)
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/whatsapp/reach")

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  \"contactId\": \"7d6c5b4a-3f2e-4d1c-8b9a-0e1f2a3b4c5d\",\n  \"message\": \"Hola Andrés, aquí tienes la información del plan Empresarial: 3 líneas, 1.500 minutos y soporte prioritario por $450.000 COP al mes.\"\n}"

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

```java Default (Spanish fallback template)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jelliu.co/api/whatsapp/reach")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"contactId\": \"7d6c5b4a-3f2e-4d1c-8b9a-0e1f2a3b4c5d\",\n  \"message\": \"Hola Andrés, aquí tienes la información del plan Empresarial: 3 líneas, 1.500 minutos y soporte prioritario por $450.000 COP al mes.\"\n}")
  .asString();
```

```php Default (Spanish fallback template)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jelliu.co/api/whatsapp/reach', [
  'body' => '{
  "contactId": "7d6c5b4a-3f2e-4d1c-8b9a-0e1f2a3b4c5d",
  "message": "Hola Andrés, aquí tienes la información del plan Empresarial: 3 líneas, 1.500 minutos y soporte prioritario por $450.000 COP al mes."
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Default (Spanish fallback template)
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/whatsapp/reach");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"contactId\": \"7d6c5b4a-3f2e-4d1c-8b9a-0e1f2a3b4c5d\",\n  \"message\": \"Hola Andrés, aquí tienes la información del plan Empresarial: 3 líneas, 1.500 minutos y soporte prioritario por $450.000 COP al mes.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Default (Spanish fallback template)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "contactId": "7d6c5b4a-3f2e-4d1c-8b9a-0e1f2a3b4c5d",
  "message": "Hola Andrés, aquí tienes la información del plan Empresarial: 3 líneas, 1.500 minutos y soporte prioritario por $450.000 COP al mes."
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/whatsapp/reach")! 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()
```

### Explicit fallback language

**Request**

```json
{
  "contactId": "e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b",
  "message": "Olá Beatriz, segue a proposta que conversamos por telefone.",
  "language": "pt_BR"
}
```

**Response**

```json
{
  "data": {
    "messageSid": "SM0123456789abcdef0123456789abcdef",
    "status": "queued",
    "form": "freeform",
    "note": "Sent on WhatsApp, in full. Tell the person it is already in their WhatsApp."
  }
}
```

**SDK Code**

```python Explicit fallback language
import requests

url = "https://api.jelliu.co/api/whatsapp/reach"

payload = {
    "contactId": "e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b",
    "message": "Olá Beatriz, segue a proposta que conversamos por telefone.",
    "language": "pt_BR"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Explicit fallback language
const url = 'https://api.jelliu.co/api/whatsapp/reach';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"contactId":"e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b","message":"Olá Beatriz, segue a proposta que conversamos por telefone.","language":"pt_BR"}'
};

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

```go Explicit fallback language
package main

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

func main() {

	url := "https://api.jelliu.co/api/whatsapp/reach"

	payload := strings.NewReader("{\n  \"contactId\": \"e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b\",\n  \"message\": \"Olá Beatriz, segue a proposta que conversamos por telefone.\",\n  \"language\": \"pt_BR\"\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 Explicit fallback language
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/whatsapp/reach")

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  \"contactId\": \"e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b\",\n  \"message\": \"Olá Beatriz, segue a proposta que conversamos por telefone.\",\n  \"language\": \"pt_BR\"\n}"

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

```java Explicit fallback language
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jelliu.co/api/whatsapp/reach")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"contactId\": \"e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b\",\n  \"message\": \"Olá Beatriz, segue a proposta que conversamos por telefone.\",\n  \"language\": \"pt_BR\"\n}")
  .asString();
```

```php Explicit fallback language
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jelliu.co/api/whatsapp/reach', [
  'body' => '{
  "contactId": "e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b",
  "message": "Olá Beatriz, segue a proposta que conversamos por telefone.",
  "language": "pt_BR"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Explicit fallback language
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/whatsapp/reach");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"contactId\": \"e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b\",\n  \"message\": \"Olá Beatriz, segue a proposta que conversamos por telefone.\",\n  \"language\": \"pt_BR\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Explicit fallback language
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "contactId": "e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b",
  "message": "Olá Beatriz, segue a proposta que conversamos por telefone.",
  "language": "pt_BR"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/whatsapp/reach")! 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()
```