Bitrix24 with your AI agent, step by step
Common Bitrix24 CLI tasks step by step: the first sync, keeping the copy fresh, safe agent writes.
Each scenario is a common task in order: the commands to run, why each one runs and what to look at in the answer. The same scenarios are in the terminal: b24 guide lists them, and b24 guide first-sync prints one.
Commands that use an account start with your profile, the name you gave the account at login, such as b24 personal ….
First sync and the pipeline board
Copy your deals and leads into the local store and see where each one stands.
-
b24 work session startpaste the portal's incoming webhook address. b24 checks it against the portal and keeps it in the keyring
-
b24 work session status --checkthe employee the webhook acts as, and whether they are a Bitrix24 administrator
-
b24 work users listyour own user id and the ids of your colleagues
-
b24 work config set crm.bitrix24:example.bitrix24.ru.unassigned 3327,4410optional. To copy a colleague's deals too, list their id and your own, with your portal's host in place of example.bitrix24.ru. Without this, a sync copies your own deals and leads
-
b24 work synccopies the deals and leads, with their clients. The next sync takes only the changes
-
b24 work pipelines show Salesthe pipeline as a board, how many deals stand in each stage and how many reached it
-
b24 work deals list status:openthe open deals with stage, amount and owner, from the store, offline too
What to look at:
- scope in the sync answer, which says whose deals and leads it copied
- issues in the sync answer, such as a user it could not take or a scope the webhook lacks
- the stage where most deals wait
work is the profile, the name you gave your portal's sign-in. example.bitrix24.ru stands for your portal's host,
and 3327,4410 for your colleague's id and your own. The list replaces your own user, so a list without your id
leaves your deals out.
In the terminal: b24 guide first-sync
Keep the copy up to date
Have the local store follow the portal on its own, and search it beside your other WireCat tools.
-
b24 work schedule command crm --every 1h -- synca timer on this computer that runs sync every hour. Each run reads only what changed
-
b24 work schedule listthe schedule, when it runs next and how its last run went
-
b24 work store statushow far each kind's sync is, how many records are stored and when it last ran
-
b24 work search all kitchenstored deals and leads beside your messages, notes and meetings from other WireCat tools
What to look at:
- a schedule whose last run failed
- a kind in store status that is partial, which the next sync goes on with
In the terminal: b24 guide keep-in-sync
Let an agent change the CRM without surprises
Give an agent your CRM over MCP while the writes that reach clients or cannot be undone stay yours.
-
b24 work config set permissions.deals.move readonlya stage change can start the portal's robots, which write to clients. Over MCP nobody answers ask, so only readonly stops the move
-
b24 work config set permissions.deals.delete denyno agent deletes a deal, whatever it is asked
-
b24 work mcp add claude-code --permission leads.delete=deny --allow-writesadds this profile to Claude Code. This server also refuses lead deletes, and --allow-writes says you accept the writes it still offers
-
b24 work config showeach permission with its level and where it came from
-
b24 work runs listwhat the agent ran, refused writes too
What to look at:
- the levels of deals.move, deals.delete and leads.delete in config show
- refused runs in runs list, and which command asked
At a terminal ask still asks before the write. Over MCP nobody is there to answer, so a write at ask goes ahead.
Set readonly or deny, or turn on approval of b24_write in the agent client.
In the terminal: b24 guide safe-agent-writes