# Quickstart

Set two variables first:

```bash
export CRM=https://apac.zocton.com/entayo-crm/api   # your data centre
export KEY=zk_…                                      # your API key (zk_… or entayo_…)
```

## 1. Check the key

```bash
curl -s $CRM/auth/me -H "Authorization: Bearer $KEY"
```

## 2. See the columns of a person

```bash
curl -s $CRM/master/people/fields -H "Authorization: Bearer $KEY"
```

Use these `slug`s as keys in `values`.

## 3. Add a person

```bash
curl -s -X POST $CRM/master/people \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"values":{"first_name":"Ada","last_name":"Lovelace","email":"ada@example.com"}}'
```

The answer has two ids:

- `id` — the **master id**. Lists and campaigns use it.
- `entity_id` — the **record id**. Activity, tasks and every `/entities/{id}`
  call use it.

## 4. Find people

```bash
curl -s "$CRM/master/people?search=lovelace&limit=20" -H "Authorization: Bearer $KEY"
```

## 5. Log a phone call

Find the activity type's id first:

```bash
curl -s $CRM/activity-types -H "Authorization: Bearer $KEY"
```

Then log it on the person's record id:

```bash
curl -s -X POST $CRM/entities/9121/activities \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"activity_type_id":7,"direction":"outbound","subject":"Intro call","body":"Talked about the rollout."}'
```

## 6. Create a follow-up task

```bash
curl -s -X POST $CRM/tasks \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"title":"Send the proposal","entity_id":9121,"priority":"high","due_date":"2026-11-05T09:00:00Z"}'
```

## 7. Put the person in a list

```bash
curl -s -X POST $CRM/lists \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"name":"Webinar Nov 2026","kind":"person","master_ids":[312]}'
```

Everything else is in the [API reference](https://www.entayo.com/docs/api/entayo-crm).

<section aria-labelledby="faq" class="faq">

## FAQ

<details>
<summary>What is the difference between id and entity_id?</summary>

`id` is the master id, used by lists and campaigns. `entity_id` is the record id, used by activity, tasks and `/entities/{id}`.

</details>
<details>
<summary>How do I know which fields a person has?</summary>

Call `GET /master/people/fields` and use the `slug`s as keys in `values`.

</details>
<details>
<summary>Where are all the endpoints?</summary>

In the [API reference](https://www.entayo.com/docs/api/entayo-crm), with a Try it box on each.

</details>

</section>
