To keep records in sync from an automation tool or your own scripts, you can also send them through the API.
Setup
- Go to Knowledge > Sources and click Create New Source.
- Enter a name and select
jsonas the Source Type. - Map the fields (see below) and click Save.
- Open the source. In the Content tab, click Import Content, select up to 10
.jsonfiles (20 MB each), and upload them.
Configuration
Use dot notation for nested fields, for example
author.name.
File format
The file can contain:- An array of objects
- An object with a
data,recordsoritemsarray - A single object, imported as one record
Example
question, Content Fields answer and category, and ID Field id, this creates a document titled “How do I reset my password?” with this content:
Send records through the API
Automation tools such as n8n or Zapier, or your own scripts, can send records to the source through the Public API v1 instead of uploading files. Give each document apage_id: your own identifier for the record. Sending the same page_id again updates the document instead of creating a duplicate, so you can rerun the same sync as often as you like.
not_found list in the response contains page_id values, so you can match it against your own records.
Both endpoints accept up to 100 items per request and need an API key with the
knowledge:write scope. Records sent through the API use the title and content you send: the field mapping configured on the source does not apply.Tips
- Use the same fields in every object.
- Pick a readable title field, not an ID or code.
- Convert HTML to plain text or Markdown before export when you can.
- Split very large exports into several files.
Troubleshooting
Upload fails or no documents are created
Upload fails or no documents are created
- Check the file is valid JSON (no trailing commas, quoted strings).
- Check the file is UTF-8 encoded.
- Check the records are in an array, or in a
data,recordsoritemsarray.
Missing content
Missing content
- Check the field names in Content Fields match exactly, including case.
- Check the exclude prefixes don’t match the fields you need.
Duplicate documents
Duplicate documents
- Give every record a unique value in the ID field.
- To start over, empty the source, then upload again.
Related
- Public API v1 Reference: full API documentation
- XML Import: similar import from an XML feed
- Knowledge AI Ingestion: turn unstructured content into knowledge
- Knowledge Source Management: managing sources
