> For the complete documentation index, see [llms.txt](https://answeringservicecare.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://answeringservicecare.com/docs/api-reference/user-portal-apis/to-dos/create-a-to-do.md).

# Create a To Do

## Create a To Do

> Create a new To Do. Set \`delivery\_type\` to \`sms\`, \`email\`, \`call\` or \`ai\_outbound\_call\`, and give a \`schedule\`: \`rule: immediately\` sends once right away, \`rule: today\` sends today at each of \`times\`, and leaving \`rule\` out makes a recurring To Do driven by \`frequency\`, \`times\`, \`interval\` and \`days\`. The fields each channel needs are listed under the request body.

```json
{"openapi":"3.0.3","info":{"title":"Answering Service Care API","version":"1.0.0"},"tags":[{"name":"Create a To Do"}],"servers":[{"url":"https://secure.answeringservicecare.com","description":"Answering Service Care host"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API token","description":"Answering Service Care uses bearer token authentication. Generate API tokens from your user profile under **Application Keys**."}},"schemas":{"ToDoEnvelope":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ToDo"}}},"ToDo":{"type":"object","description":"A To Do record, with its schedule.","properties":{"id":{"type":"integer"},"name":{"type":"string","nullable":true,"description":"The To Do's name. Defaults to the creation time when none is sent."},"phone_id":{"type":"integer","nullable":true},"delivery_type":{"type":"string","enum":["sms","email","call","ai_outbound_call"]},"instructions":{"type":"string","nullable":true,"description":"Omitted on `ai_outbound_call` To Dos."},"contact":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"message_text":{"type":"string"},"times":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Run times for one-time To Dos. Null for recurring To Dos, which carry a `schedule` instead."},"is_sending":{"type":"boolean"},"run_at":{"type":"string","format":"date-time","nullable":true},"from":{"type":"string"},"subject":{"type":"string","nullable":true},"from_email":{"type":"string","nullable":true},"sender_name":{"type":"string","nullable":true},"ai_assistant_id":{"type":"string","nullable":true,"description":"The AI Assistant this To Do dials with: the one pinned on the To Do, or failing that the one set on the phone or the account. Set only on `ai_outbound_call` To Dos."},"variables":{"type":"object","additionalProperties":{"type":"string"},"nullable":true,"description":"The per-call values sent to the assistant. Returned on `ai_outbound_call` To Dos."},"amd_detection":{"type":"string","enum":["off","standard","premium"],"nullable":true,"description":"Returned on `ai_outbound_call` To Dos."},"amd_machine_action":{"type":"string","enum":["hang_up","leave_message"],"nullable":true,"description":"Returned on `ai_outbound_call` To Dos."},"schedule":{"allOf":[{"$ref":"#/components/schemas/ScheduleRecord"}],"nullable":true,"description":"The recurring schedule. Null for one-time To Dos (`rule` of `immediately` or `today`), which carry `times` instead."}}},"ScheduleRecord":{"type":"object","properties":{"id":{"type":"integer"},"schedulable_id":{"type":"integer"},"schedulable_type":{"type":"string"},"rule":{"type":"object","additionalProperties":true,"description":"The recurrence rule: its type, interval and day validations."},"times":{"type":"array","items":{"type":"string"}},"previous_occurrence":{"type":"string","format":"date-time","nullable":true},"next_occurrence":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ErrorSimple":{"type":"object","description":"Compact error response (used for 401/422/400).","properties":{"error":{"type":"string"}}},"ToDoRequest":{"type":"object","required":["account_number","delivery_type","schedule"],"properties":{"account_number":{"type":"string","description":"Account number linked to the To Do."},"delivery_type":{"type":"string","enum":["sms","email","call","ai_outbound_call"],"description":"Delivery channel. `ai_outbound_call` places an outbound call handled by one of your AI Assistants; it needs the AI Assistant feature on the account and an AI Assistant set on the To Do, the phone or the account."},"contact":{"type":"string","description":"Recipient: a phone number for `sms` and `ai_outbound_call`, an email address for `email`."},"message_text":{"type":"string","description":"Message content. Required for `sms` and `email`."},"schedule":{"$ref":"#/components/schemas/ToDoSchedule"},"from":{"type":"string","description":"Sender phone number for SMS To Dos."},"instructions":{"type":"string","description":"What the agent should say. Required for `call`. **Not accepted for `ai_outbound_call`:** an AI call follows the assistant's published prompt, and sending `instructions` returns 422. Use `variables` instead."},"sender_name":{"type":"string","description":"Email sender name for email To Dos."},"from_email":{"type":"string","description":"Email sender address for email To Dos."},"subject":{"type":"string","description":"Email subject line for email To Dos."},"ai_assistant_id":{"type":"string","description":"`ai_outbound_call` only. The AI Assistant to call with, which pins this To Do to that assistant. Leave it out and the To Do uses the assistant set on the phone, or failing that on the account, at the moment it runs."},"variables":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"maxProperties":20,"description":"`ai_outbound_call` only. Your own values for this one call; the assistant's prompt or greeting refers to them by name in double braces, e.g. `{{customer_name}}`. Names are lowercase, start with a letter, and use only letters, numbers and underscores (40 characters at most). Values are 1000 characters at most and cannot be empty. Some names are built in: they are filled in on every call and cannot be used here. `contact` is the `contact` you send and `contact_number` is that number in E.164 format, such as `+15555551234`; `account_number` is the To Do's account number; `company_name` is the account's company name; `to_do_id`, `to_do_task_id` and `to_do_name` identify the To Do and this run of it; `answered_by` is `human`, `machine` or `unknown`, from machine detection."},"amd_detection":{"type":"string","enum":["off","standard","premium"],"default":"off","description":"`ai_outbound_call` only. Whether the call tries to tell a person from a machine. `standard` detects a machine and reports when its greeting ends. `premium` is higher accuracy and also handles phone-screening prompts. Detection needs to be enabled on the account, and `premium` also needs premium detection; without them the call runs with detection off."},"amd_machine_action":{"type":"string","enum":["hang_up","leave_message"],"default":"hang_up","description":"`ai_outbound_call` only. What to do when a machine answers."}},"description":"Flat create payload; there is no `to_do` wrapper. `account_number`, `delivery_type` and `schedule` are always required; the rest depend on the channel: `sms` needs `from`, `contact` and `message_text`; `email` needs `contact`, `message_text` and `from_email`; `call` needs `instructions`; `ai_outbound_call` needs `contact`."},"ToDoSchedule":{"type":"object","description":"When the To Do runs. `rule: immediately` sends once right away. `rule: today` sends once today at each of `times`. Any other `rule`, or none, makes a recurring To Do driven by `frequency`, `times`, `interval` and `days`.","properties":{"rule":{"type":"string","description":"`immediately` (no `times` needed) or `today` (once today at each of `times`, in the phone's time zone). Leave it out, or send any other value such as `recurring`, for a recurring To Do."},"frequency":{"type":"string","enum":["daily","weekly","monthly","yearly"],"description":"How often a recurring To Do repeats. Required for a recurring To Do."},"times":{"type":"array","items":{"type":"string"},"description":"One or more times of day, such as `9:00 AM`. Required unless `rule` is `immediately`."},"interval":{"type":"integer","default":1,"description":"Repeat every N units of `frequency`, for example every 2 weeks. Defaults to 1."},"days":{"type":"array","items":{"type":"string","enum":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},"description":"Days of the week a recurring To Do runs on, matched case-insensitively. Day names only, also for `monthly`. An empty array returns 422."}}}},"responses":{"ToDoValidationError":{"description":"Missing or invalid parameter, for example a missing `contact`, `message_text`, `from`, `from_email`, `instructions` or `times`, an unknown `account_number`, or an empty `days`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorSimple"}}}}}},"paths":{"/api/v2/to-dos":{"post":{"summary":"Create a To Do","description":"Create a new To Do. Set `delivery_type` to `sms`, `email`, `call` or `ai_outbound_call`, and give a `schedule`: `rule: immediately` sends once right away, `rule: today` sends today at each of `times`, and leaving `rule` out makes a recurring To Do driven by `frequency`, `times`, `interval` and `days`. The fields each channel needs are listed under the request body.","tags":["Create a To Do"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToDoEnvelope"}}}},"400":{"description":"The To Do could not be saved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorSimple"}}}},"401":{"description":"Missing or invalid token, the account is not one of yours, or SMS is not enabled on the sending number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorSimple"}}}},"422":{"$ref":"#/components/responses/ToDoValidationError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToDoRequest"}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://answeringservicecare.com/docs/api-reference/user-portal-apis/to-dos/create-a-to-do.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
