Skip to content

Sync an API template source

Request

You can start a sync of an API template source. Intercom fetches the knowledge base's pages again using the source's template and token, and updates the imported content. The response is the source, with the new sync in latest_sync.

Intercom also syncs each source automatically, about once a day, unless the vendor has rejected the token, so you only need this endpoint to sync sooner.

If the vendor has rejected the source's token, the response is a 422 with the code source_unauthorized. The source's token can't be replaced, and Intercom stops syncing the source automatically. To import with a new token, create a new source.

OAuth tokens must have the read_write_ai_content scope.

Security
bearerAuth
Path
idstringrequired

The unique identifier for the API template source, given by Intercom.

Example:4182
Headers
Intercom-Versionstring(intercom_version_preview)

Preview Intercom API version. Used for closed beta endpoints or other features under managed availability.

Default:"Preview"
Value:"Preview"
Example:Preview
curl -i -X POST \
  https://api.intercom.io/ai/api_template_sources/4182/sync \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Intercom-Version: Preview'

Responses

Sync started

Bodyapplication/json
typestringrequired

Always api_template_source.

Value:"api_template_source"
Example:"api_template_source"
idstringrequired

The unique identifier for the source, given by Intercom.

Example:"4182"
templateobject(API Template)required

The source's template, as saved. Top-level keys that aren't template fields are removed.

Example:
{ "name": "Example Docs", "base_url": "https://api.example.com/v1", "variables": [ "space_id" ], "auth": { "header": "Authorization", "value": "Bearer {token}" }, "tree": { "path": "/spaces/{space_id}/pages", "query": { … }, "nodes": [ … ], "children": "pages", "folder_if": [ … ], "folder_if_has_children": true, "content_if": [ … ] }, "item": { "path": "/spaces/{space_id}/pages/{page_id}", "node_values": { … } }, "mapping": { "id": [ … ], "title": [ … ], "body": [ … ], "updated_at": [ … ] }, "body_format": "html" }
variablesobjectrequired

The values of the template's variables, as strings. Values for names the template doesn't declare are removed.

Example:
{ "space_id": "help-center" }
created_atinteger, (date-time)required

The time the source was created.

Example:1792713600
latest_syncobject or nullrequired

The source's most recent sync, or null if no sync has started.

Example:
{ "id": "90817", "status": "in_progress", "created_at": 1792713601, "updated_at": 1792713601 }
Response
{ "type": "api_template_source", "id": "4182", "template": { "name": "Example Docs", "base_url": "https://api.example.com/v1", "variables": [ … ], "auth": { … }, "tree": { … }, "item": { … }, "mapping": { … }, "body_format": "html" }, "variables": { "space_id": "help-center" }, "created_at": 1792713600, "latest_sync": { "id": "90958", "status": "in_progress", "created_at": 1792800000, "updated_at": 1792800000 } }