companies_toggle_sync
Turn ANAF SPV / e-Factura synchronization on or off for a specific company by flipping its sync state with a single API call. Requires company edit permission and a valid ANAF token to enable syncing.
Instructions
Toggle ANAF SPV / e-Factura synchronization on or off for a specific company. Calls POST /api/v1/companies/{uuid}/toggle-sync — flips the company's syncEnabled boolean. Requires COMPANY_EDIT permission. Enabling fails with 422 (messageKey ERR_SYNC_ENABLE_NO_TOKEN) when the company has no valid ANAF OAuth token; connect via anaf_create_token_link first. Returns { syncEnabled, message }. To enable on a fresh company, the recipe is: companies_list → anaf_create_token_link (open the URL, complete OAuth) → anaf_validate_cif → companies_toggle_sync.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| companyId | Yes | Company UUID. Use companies_list to find available UUIDs. |