Add source
POST/api/v2/projects/:slug/sources/
Add sources to a project. Supports files, URLs, sitemaps, hosted sites (ZIP), GitHub repositories, OpenAPI specifications, and Confluence spaces. All sources are indexed for search and chat.
Use multipart/form-data when uploading binary content (files or site ZIPs). Use application/json for everything else, including private GitHub repositories and private Confluence spaces that need credentials.
Required permission: sources_create
| Source type | Limits / notes |
|---|---|
| Files (PDF, MD, TXT, DOCX, XLSX, CSV, YAML, JSON, RST, HTML, CSS, JS, XML) | 10 MB per file. multipart/form-data only |
| URLs | Must be publicly accessible |
| Sitemaps | Must end in .xml |
| Hosted sites (ZIP) | 250 MB per ZIP. multipart/form-data only. site_name is required |
| GitHub repositories | Public repos work via either content type. Private repos require a personal access token (JSON only) |
| OpenAPI specifications | JSON or YAML URL |
| Confluence spaces | Public spaces work via either content type. Private spaces require username + API token (JSON only) |
If a value is wrong, such as a sitemap URL that doesn't end in .xml, the request returns 400 with the errors listed by field name. If the values look right but the source still can't be added, such as an unsupported file type or a corrupt ZIP, the request returns 422 with a single error message explaining why.
Request
Responses
- 201
- 400
- 403
- 404
- 422
Sources created successfully
Validation error. Field-level errors keyed by field name.
Forbidden. Missing permissions.
Resource not found.
Unprocessable. The request was valid, but it cannot be completed.