# DoneTalk API

The API lets your system (ERP, CRM, website, automation) do in DoneTalk what people do on screen: create and send WhatsApp campaigns, add and update contacts, send messages, follow and close conversations, book appointments and receive webhooks for everything that happens.

- **Address:** `https://api.donetalk.com/v1/c/{company}`, where `{company}` is your company's identifier in DoneTalk.
- **Format:** JSON, dates in ISO 8601 (UTC), ids as UUIDs, money in micros (1,000,000 = 1 unit of currency).
- **Full specification:** [OpenAPI](https://api.donetalk.com/v1/openapi.json?lang=en), to generate code or import into Postman.

## Get started

1. An administrator creates the key in **Settings › API** in DoneTalk and ticks what it may do. To start with no risk, choose **Test**: it simulates everything and sends nothing.
2. Check the key:

```bash
curl https://api.donetalk.com/v1/c/{company}/me \
  -H "Authorization: Bearer $DONETALK_KEY"
```

3. Create a campaign with the contact list in the call itself, review its cost and send it. The [Campaigns, start to finish](/en/developers/campaigns/) guide shows each step.
4. Register an address of your system to receive [webhooks](/en/developers/webhooks/): delivered, read, replied, conversation closed with its outcome.

## Try it now, no account needed

The demo company `demo` accepts the public test key below. Everything is simulated: answers have the real shape, with example data, and nothing is stored or sent.

```bash
export DONETALK_KEY=dt_test_demo_zRZ6twAhj4u9dZT0hEBrNFzr
curl -X POST https://api.donetalk.com/v1/c/demo/campaigns \
  -H "Authorization: Bearer $DONETALK_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "First campaign", "audience": {"kind": "contacts", "people": [{"phone": "+5548999990001", "name": "Ana"}]}}'
```

## What the API covers

| Area                                                                                            | What you can do                                                                                                                  |
| ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| [Campaigns](/en/developers/reference/campaigns/)                                                      | create, review cost and rules, test, send or schedule, pause, resume, cancel, retry failures, see each recipient and the results |
| [Segments](/en/developers/reference/segments/)                                                        | groups of contacts by conditions, count and search                                                                               |
| [Contacts](/en/developers/reference/contacts/)                                                        | create, update or import up to 1,000 at a time, tags, consent, context cards, erase at the person's request                      |
| [Fields](/en/developers/reference/contact-fields/)                                                    | read and create contact fields                                                                                                   |
| [Templates](/en/developers/reference/templates/)                                                      | the templates Meta approved, with variables and buttons                                                                          |
| [Messages](/en/developers/reference/messages/) and [conversations](/en/developers/reference/conversations/) | send a template to a phone, text and files within the 24-hour window, close with an outcome                                      |
| [Numbers, teams and tags](/en/developers/reference/numbers-teams-and-tags/)                           | to pick the number that sends and the team that gets the replies                                                                 |
| [Scheduling](/en/developers/reference/scheduling/)                                                    | free times, book, move and cancel                                                                                                |
| [Webhooks](/en/developers/reference/webhooks/)                                                        | create and follow the addresses that receive the events                                                                          |

## Before going live

- Use one key per system, with only the scopes it needs ([Keys and scopes](/en/developers/keys-and-scopes/)).
- Send `Idempotency-Key` on creations and sends and respect the limit of 600 calls per minute ([Errors and limits](/en/developers/errors-and-limits/)).
- Check every webhook's signature ([Webhooks](/en/developers/webhooks/)).
