Repository API¶
Find the Knowledge Bases accessible to your API identity. The public API retains the repositories endpoint name even though the platform UI uses Knowledge Bases.
List Repositories¶
Endpoint: GET /repositories
Query Parameters¶
| Parameter | Description |
|---|---|
search | Case-insensitive partial match on the repository name. |
sort | field:direction, with asc or desc; omitted direction defaults to asc. Multiple fields can be comma-separated. |
Sortable fields documented in the current schema are name, createdAt, updatedAt and repository_type.
Example¶
curl --fail-with-body --max-time 30 --get \
"https://PLATFORM-URL-PLACEHOLDER/v1/api/repositories" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "search=Product" \
--data-urlencode "sort=name:asc"
Response¶
The list response contains a data array and meta.pagination. Each item has an internal numeric id and nested attributes; use attributes.repository_id as the external repository identifier.
Abbreviated example with synthetic values:
{
"data": [
{
"id": 123,
"attributes": {
"name": "Example Knowledge Base",
"repository_id": "550e8400-e29b-41d4-a716-446655440000",
"repository_type": "Knowledge"
}
}
],
"meta": {
"pagination": {"page": 1, "pageSize": 25, "pageCount": 1, "total": 1}
}
}
Filter Repositories¶
Use the documented search parameter to filter by name. Do not substitute generic filters[name] syntax without checking the current endpoint contract.
Pagination¶
The response schema includes meta.pagination, but the inspected list operation does not declare pagination request parameters. Consult the interactive schema before implementing page traversal; response metadata alone does not establish accepted query syntax.
Sorting¶
For the most recently updated repositories, use sort=updatedAt:desc. For multiple sort fields, use a comma-separated value such as name:asc,createdAt:desc.
Get a Repository¶
Endpoint: GET /repositories/{repositoryId}
Use the external repository_id UUID returned by the list operation. The current schema also allows the legacy numeric primary key; other values produce 400.
curl --fail-with-body --max-time 30 \
"https://PLATFORM-URL-PLACEHOLDER/v1/api/repositories/REPOSITORY_UUID" \
-H "Authorization: Bearer YOUR_API_KEY"
The detail response is a repository object at the top level, including name, repository_id, repository_type and configuration fields. It does not use the list's data[].attributes envelope. A 404 can mean no repository with that identifier is accessible to the caller.
Best Practices¶
- Copy identifiers from API responses rather than deriving them from a UI slug or display name.
- Check HTTP status and the endpoint-specific response shape before using returned fields.
- Preserve the intended identity when making follow-up document requests; see API authentication.
- Do not assume a response contains
documentCount; that field is not in the inspected repository schema.
Related Topics¶
- Document API — documents within a repository.
- Knowledge — Knowledge Bases in the platform.
- API Overview — authentication and setup.