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
Get your profile
- Get information about the current user:
pachca profile get
Returns
id,first_name,last_name,nickname,phone_number,department,title,role,suspended,invite_status,list_tags,custom_properties,user_status,bot,sso,created_at,last_activity_at,time_zone,image_url.
Check your token
- Get information about the token: scopes, creation date, lifetime:
pachca oauth token-info
Useful for diagnostics: which scopes are available to the token, when it expires.
Set status
- Set status:
pachca profile update-status --emoji="🏖️" --title="В отпуске" --is-away --away-message="Я в отпуске до 10 марта" --expires-at="2025-03-10T23:59:59.000Z"is_away: true— "Out of office" mode.expires_at— auto-reset (ISO-8601, UTC+0).away_message— max 1024 characters
Reset status
- Delete status:
pachca profile delete-status --force
Get custom profile fields
-
Get the list of additional fields for employees:
pachca custom-properties list --entity-type=UserAdd
entity_type=Userfor filtering -
Get the profile — in
custom_propertiescontains the field values:pachca profile get
Custom fields are configured by the space administrator.
Upload profile avatar
- Upload avatar from a file:
pachca profile update-avatar --file=<путь_к_файлу>The image file is sent in multipart/form-data format
Delete profile avatar
- Delete avatar:
pachca profile delete-avatar --force
Limitations
- Rate limit: ~50 req/sec. On 429 — wait and retry.
status.title: max 50 charactersstatus.away_message: max 1024 characters- Pagination: cursor-based (limit + cursor)
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /custom_properties | List of additional fields |
| GET | /profile | Your profile |
| PUT | /profile/avatar | Uploading your avatar |
| DELETE | /profile/avatar | Deleting your avatar |
| GET | /profile/status | Your status |
| PUT | /profile/status | New status for yourself |
| DELETE | /profile/status | Deleting your status |
If unsure how to complete a task, read the corresponding file from references/.