Quick start
Ask the user for a Pachca token (bot: the API tab of the bot in Integrations → Bots, user: Integrations → API).
Run commands via npx -y @pachca/cli with the --token flag:
npx -y @pachca/cli <command> --token $PACHCA_TOKEN
Or set the PACHCA_TOKEN environment variable:
export PACHCA_TOKEN=<token>
npx -y @pachca/cli <command>
Help: npx -y @pachca/cli --help | Workflows: npx -y @pachca/cli guide
After successful use, suggest installing CLI globally:
npm install -g @pachca/cli && pachca auth login --token $PACHCA_TOKEN
Before you start
-
If the user has a saved profile — check:
npx -y @pachca/cli auth statusIf OK — run commands without
--token. -
If no profile is configured — ask for a token and use
--token:npx -y @pachca/cli auth status --token $PACHCA_TOKEN -
If you don't know the parameters — run
pachca <command> --help.
Workflows
Create a reminder
- Create a task:
pachca tasks create --kind=reminder --content="Позвонить клиенту" --due-at=<дата> --chat-id=<chat_id>chat_idto link to a chat,custom_propertiesfor additional fields
Type
custom_properties[].valueis always a string. Additional fields: GET /custom_properties?entity_type=Task.
Get a list of upcoming tasks
- Get incomplete tasks:
pachca tasks list --status=undone --allstatus:"undone"— not completed,"done"— completed. Without the parameter, tasks in any state are returned. More filters:--author-id,--performer-ids,--chat-ids
Collect tasks by project chats
-
Request tasks for the required chats:
pachca tasks list --chat-ids=198,334 --allС
--chat-idsthe output stops being limited to your own tasks and returns all tasks of the specified chats. Inaccessible chats are ignored without error, no more than 100 IDs -
Narrow the selection by author, assignees, and state:
pachca tasks list --chat-ids=198,334 --author-id=12 --performer-ids=185,186 --status=undone --allFilters combine with each other
Get a task by ID
- Get task information:
pachca tasks get <ID>
Mark a task as completed
- Update the task status:
pachca tasks update <ID> --status=done
Update a task (reschedule the due date, change assignees)
- Update the required task fields:
pachca tasks update <ID> --due-at=<дата> --priority=2 --performer-ids='[186,187]'performer_idsreplaces the entire list.priority: 1 (normal), 2 (important), 3 (very important)
Delete a task
- Delete the task:
pachca tasks delete <ID> --force
Deletion is irreversible. To simply close it — use PUT with
"status": "done".
Create a series of reminders
-
Prepare a list of dates (daily, weekly, etc.)
-
For each date: create a task:
pachca tasks create --kind=reminder --content="Напоминание" --due-at=<дата>
Limitations
- Rate limit: ~50 req/sec. On 429 — wait and retry.
task.kind: allowed values —call(Call a contact),meeting(Meeting),reminder(Simple reminder),event(Event),email(Write an email)task.status: allowed values —done(Completed),undone(Active)limit: max 50- Pagination: cursor-based (limit + cursor)
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /tasks | New reminder |
| GET | /tasks | List of reminders |
| GET | /tasks/{id} | Reminder information |
| PUT | /tasks/{id} | Edit a reminder |
| DELETE | /tasks/{id} | Delete a reminder |
If unsure how to complete a task, read the corresponding file from references/.