PT EN

Calendário: Fontes

URL base: $BUSINESS_API

Listar fontes do calendário

Registos

GET /calendar/sources

Lists the configured calendar sources of the tenant in a data array without pagination. A source records where holiday data comes from (manual, file, url, connector or template_version), its reference, refresh schedule, whether imports from it apply automatically, and whether it is enabled. Requires automations:read.

Parâmetros

limitinteger · consulta · opcional

Maximum resources to return (default 20, maximum 100).

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

Devolve

200 Sources

Permissões automations:read · Funções: admin, analyst, customer_service, finance, operations, owner

curl -X GET "$BUSINESS_API/calendar/sources" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200

Sources

Adicionar uma fonte ao calendário

Registos

POST /calendar/sources

Registers a calendar source and returns it with 201. kind must be manual, file, url, connector or template_version; the source is enabled unless enabled is false. Imports created with this source's id track which days and rules came from it, so later imports can report what the source removed. Requires automations:write.

Corpo application/json

kindstring · obrigatório

um de manual, file, url, connector, template_version

referencestring · opcional
refresh_schedulestring · opcional
auto_applyboolean · opcional
enabledboolean · opcional

Devolve

201 Created source

Permissões automations:write · Funções: admin, finance, operations, owner

curl -X POST "$BUSINESS_API/calendar/sources" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "kind": "manual",
  "reference": "REF-2026-000142",
  "refresh_schedule": "refresh schedule",
  "auto_apply": true,
  "enabled": true
}'
Resposta 201

Created source

Actualizar uma fonte do calendário

Registos

PATCH /calendar/sources/{id}

Changes only the fields sent on a calendar source and returns it. Disabling a source makes new imports and applies that reference it fail with 400. An invalid kind returns 400 and an unknown id returns 404. Requires automations:write.

Parâmetros

idstring · caminho · obrigatório

Id of the calendar source to update (prefix csr).

Corpo application/json

kindstring · opcional

um de manual, file, url, connector, template_version

referencestring · opcional
refresh_schedulestring · opcional
auto_applyboolean · opcional
enabledboolean · opcional

Devolve

200 Updated source

Erros 404

Permissões automations:write · Funções: admin, finance, operations, owner

curl -X PATCH "$BUSINESS_API/calendar/sources/{id}" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "kind": "manual",
  "reference": "REF-2026-000142",
  "refresh_schedule": "refresh schedule",
  "auto_apply": true,
  "enabled": true
}'
Resposta 200

Updated source

Remover uma fonte do calendário

Registos

DELETE /calendar/sources/{id}

Deletes a calendar source and returns 204 with no body. Days and rules already imported from it stay in the calendar. Returns 404 when the source is not in this tenant. Requires automations:write.

Parâmetros

idstring · caminho · obrigatório

Id of the calendar source to delete (prefix csr).

Devolve

204 Deleted

Permissões automations:write · Funções: admin, finance, operations, owner

curl -X DELETE "$BUSINESS_API/calendar/sources/{id}" \
  -H "Authorization: Bearer sk_test_..."
Resposta 204

Deleted