- Sync an API template source
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.
Preview Intercom API version. Used for closed beta endpoints or other features under managed availability.
- The production API serverhttps://api.intercom.io/ai/api_template_sources/{id}/sync
- The european API serverhttps://api.eu.intercom.io/ai/api_template_sources/{id}/sync
- The australian API serverhttps://api.au.intercom.io/ai/api_template_sources/{id}/sync
curl -i -X POST \
https://api.intercom.io/ai/api_template_sources/4182/sync \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Intercom-Version: Preview'Sync started
Always api_template_source.
The source's template, as saved. Top-level keys that aren't template fields are removed.
{ "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" }
The values of the template's variables, as strings. Values for names the template doesn't declare are removed.
{ "space_id": "help-center" }
{ "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 } }