---
title: "Create an appointment by phone number"
description: "Looks up an existing contact by phone number in the workspace, or creates\na new one from the provided payload, and inserts an appointment row.\nCalendar links (Google, Outlook, iCal) are auto-generated by a database\ntrigger immediately after insert. The \"Appointment Booked\" flow trigger\nis fired automatically and any active sequences for the contact are stopped.\n\n**Required fields:** `phone_number`, `adate`, `atime`. Everything else is optional.\n\n**Timezone resolution priority (used to convert `adate`+`atime` to UTC):**\n1. Existing contact's `timezone` column (if the phone matches a contact that has a timezone set)\n2. Phone area code → IANA timezone (works for all US numbers via the built-in area code map)\n3. Caller-provided `adate_utc` (used as-is if neither of the above succeeds)\n4. UTC (treat `adate`+`atime` as UTC — last resort)\n\nThe resolved `booking_timezone` is stored on the appointment row so the\nLiveChat UI and calendar view can display times in the correct local zone.\n"
---

> Documentation Index
> Fetch the complete documentation index at: https://developer.channelautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Channel Automation API › Appointments

`POST /api/appointments`

Looks up an existing contact by phone number in the workspace, or creates
a new one from the provided payload, and inserts an appointment row.
Calendar links (Google, Outlook, iCal) are auto-generated by a database
trigger immediately after insert. The "Appointment Booked" flow trigger
is fired automatically and any active sequences for the contact are stopped.

**Required fields:** `phone_number`, `adate`, `atime`. Everything else is optional.

**Timezone resolution priority (used to convert `adate`+`atime` to UTC):**
1. Existing contact's `timezone` column (if the phone matches a contact that has a timezone set)
2. Phone area code → IANA timezone (works for all US numbers via the built-in area code map)
3. Caller-provided `adate_utc` (used as-is if neither of the above succeeds)
4. UTC (treat `adate`+`atime` as UTC — last resort)

The resolved `booking_timezone` is stored on the appointment row so the
LiveChat UI and calendar view can display times in the correct local zone.

## Authentication

Requires one of the following:

- `BearerAuth`, http, header `Authorization`, format `JWT`
- `ApiKeyAuth`, apiKey, in header, header `X-API-Key`, format `API_KEY`

## Request body

_Required._

- `phone_number` (`post/api/appointments.phone_number`; string, required) — Contact phone number. Accepts E.164 or legacy formats (e.g. "17198592496", "+17198592496", "(719) 859-2496"). The service searches multiple variants to avoid creating duplicate contacts.
  - example `"+17198592496"`
- `adate` (`post/api/appointments.adate`; string, required) — Local appointment date (YYYY-MM-DD).
  - example `"2026-04-15"`
- `atime` (`post/api/appointments.atime`; string, required) — Local appointment time (HH:MM, 24-hour).
  - example `"14:30"`
- `name` (`post/api/appointments.name`; string, optional) — Full name. Split into firstname/lastname on first space. Only used when creating a NEW contact; ignored if the phone matches an existing contact.
  - example `"Jane Doe"`
- `street` (`post/api/appointments.street`; string, optional) — Street address. Stored in `contacts.st_address`. Only applied when creating a NEW contact.
  - example `"123 Main St"`
- `city` (`post/api/appointments.city`; string, optional)
  - example `"Austin"`
- `state` (`post/api/appointments.state`; string, optional)
  - example `"TX"`
- `zipCode` (`post/api/appointments.zipCode`; string, optional) — ZIP / postal code. Stored in `contacts.zip`.
  - example `"78701"`
- `product` (`post/api/appointments.product`; string, optional) — Product or service the contact is interested in. Stored in `contacts.product`. Only applied when creating a NEW contact; ignored if the phone matches an existing contact (the existing product value is preserved). Used by AI appointment setter templates and merge fields like `{{contact.product}}`.
  - example `"Roofing"`
- `adate_utc` (`post/api/appointments.adate_utc`; string, optional) — Optional. Pre-computed UTC timestamp (ISO 8601). Only used as a fallback when the service cannot resolve a timezone for the contact (i.e. neither an existing contact timezone nor a recognized US phone area code). If omitted, the service will resolve a timezone from the contact or phone number, then compute UTC from `adate` + `atime`.
  - format `date-time`; example `"2026-04-15T19:30:00.000Z"`

## Example request

```json
{
  "phone_number": "+17198592496",
  "adate": "2026-04-15",
  "atime": "14:30",
  "name": "Jane Doe",
  "street": "123 Main St",
  "city": "Austin",
  "state": "TX",
  "zipCode": "78701",
  "product": "Roofing",
  "adate_utc": "2026-04-15T19:30:00.000Z"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.channelautomation.com/api/appointments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "phone_number": "+17198592496",
  "adate": "2026-04-15",
  "atime": "14:30",
  "name": "Jane Doe",
  "street": "123 Main St",
  "city": "Austin",
  "state": "TX",
  "zipCode": "78701",
  "product": "Roofing",
  "adate_utc": "2026-04-15T19:30:00.000Z"
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/appointments';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    phone_number: '+17198592496',
    adate: '2026-04-15',
    atime: '14:30',
    name: 'Jane Doe',
    street: '123 Main St',
    city: 'Austin',
    state: 'TX',
    zipCode: '78701',
    product: 'Roofing',
    adate_utc: '2026-04-15T19:30:00.000Z'
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.channelautomation.com/api/appointments"

payload = {
    "phone_number": "+17198592496",
    "adate": "2026-04-15",
    "atime": "14:30",
    "name": "Jane Doe",
    "street": "123 Main St",
    "city": "Austin",
    "state": "TX",
    "zipCode": "78701",
    "product": "Roofing",
    "adate_utc": "2026-04-15T19:30:00.000Z"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 201

Appointment created successfully. Existing contact was reused (or a new one was created), and the "Appointment Booked" flow trigger has been dispatched.

#### Example

```json
{
  "success": true,
  "appointment_id": "4f9236e3-fca8-42bd-b773-e873273d2155",
  "contact_id": "cc2b8604-151d-43ab-a63b-762ffa825f3e",
  "is_new_contact": false
}
```

- `success` (`post/api/appointments.response.201.success`; boolean, optional)
  - example `true`
- `appointment_id` (`post/api/appointments.response.201.appointment_id`; string, optional) — UUID of the newly created appointment row.
  - format `uuid`; example `"4f9236e3-fca8-42bd-b773-e873273d2155"`
- `contact_id` (`post/api/appointments.response.201.contact_id`; string, optional) — UUID of the contact the appointment is linked to (existing or newly created).
  - format `uuid`; example `"cc2b8604-151d-43ab-a63b-762ffa825f3e"`
- `is_new_contact` (`post/api/appointments.response.201.is_new_contact`; boolean, optional) — True if a new contact was created as part of this call. False if an existing contact was reused.
  - example `false`

### 400

Invalid request payload (missing phone number or datetime)

#### Example

```json
{
  "success": false,
  "error": "phone_number is required",
  "reason": "missing_phone"
}
```

- `success` (`post/api/appointments.response.400.success`; boolean, optional)
  - example `false`
- `error` (`post/api/appointments.response.400.error`; string, optional) — Human-readable error message.
  - example `"phone_number is required"`
- `reason` (`post/api/appointments.response.400.reason`; string, optional) — Short error code for programmatic handling. Possible values: - `missing_phone` - `missing_adate` - `missing_atime` - `missing_workspace` - `missing_workspace_context` - `contact_upsert_failed` - `contact_upsert_exception` - `datetime_resolution_failed` - `appointment_insert_failed` - `appointment_insert_exception` - `unhandled_exception` Additional values returned by PUT /api/appointments: - `missing_identifier` (neither contact_id nor phone_number provided) - `invalid_contact_id` (contact_id is not a valid UUID) - `contact_not_found` - `contact_lookup_failed` - `appointment_lookup_failed` - `appointment_update_failed` - `feature_disabled` (APPOINTMENT_UPDATE_API flag is off for the workspace)
  - example `"missing_phone"`

### 401

Authentication required

#### Example

```json
{
  "error": "Authentication required",
  "success": false
}
```

- `error` (`post/api/appointments.response.401.error`; string, optional)
  - example `"Authentication required"`
- `success` (`post/api/appointments.response.401.success`; boolean, optional)
  - example `false`

### 403

API key does not have `contacts.write` permission

### 500

Appointment creation failed (DB error, contact upsert failure, etc.)

#### Example

```json
{
  "success": false,
  "error": "phone_number is required",
  "reason": "missing_phone"
}
```

- `success` (`post/api/appointments.response.500.success`; boolean, optional)
  - example `false`
- `error` (`post/api/appointments.response.500.error`; string, optional) — Human-readable error message.
  - example `"phone_number is required"`
- `reason` (`post/api/appointments.response.500.reason`; string, optional) — Short error code for programmatic handling. Possible values: - `missing_phone` - `missing_adate` - `missing_atime` - `missing_workspace` - `missing_workspace_context` - `contact_upsert_failed` - `contact_upsert_exception` - `datetime_resolution_failed` - `appointment_insert_failed` - `appointment_insert_exception` - `unhandled_exception` Additional values returned by PUT /api/appointments: - `missing_identifier` (neither contact_id nor phone_number provided) - `invalid_contact_id` (contact_id is not a valid UUID) - `contact_not_found` - `contact_lookup_failed` - `appointment_lookup_failed` - `appointment_update_failed` - `feature_disabled` (APPOINTMENT_UPDATE_API flag is off for the workspace)
  - example `"missing_phone"`


Source: https://developer.channelautomations.com/api/post-api-appointments/index.md
