---
title: "Sources endpoints"
description: "The sources your facts are cited from and the repositories that hold them: list, read, create, edit, merge and delete. Library writes need the citation manager (Researcher plan and up)."
canonical: "https://kleiobase.com/developers/docs/reference/sources"
---

# Sources endpoints

The sources your facts are cited from and the repositories that hold them: list, read, create, edit, merge and delete. Library writes need the citation manager (Researcher plan and up).

Paths are relative to https://kleiobase.com/api/v1. Request and response schemas are in the OpenAPI document at https://kleiobase.com/api/v1/openapi.json.

## List sources

`GET /workspaces/{workspace_id}/sources`

By title. Includes the sources created automatically from confirmed records. Free on every plan.

Parameters:

- `workspace_id` (path, required): The workspace (project) id.
- `limit` (query, optional): Page size. Default 25, max 100.
- `cursor` (query, optional): The next_cursor of the previous page. Opaque.
- `q` (query, optional): Matches the title, ignoring case. Up to 200 characters.
- `type` (query, optional): A source type, for example marriage_register or book.

Responses:

- `200`: Sources.
- `401`: Missing, malformed, unknown or revoked API key.
- `403`: The key's account is not on the Professional plan.
- `404`: The workspace does not exist or is not visible to this key's owner.
- `422`: Invalid limit, cursor, q or type.
- `429`: Rate limit exceeded. Wait the number of seconds in Retry-After.
- `500`: Unexpected error. Retry later and quote request_id if it persists.

## Create a source

`POST /workspaces/{workspace_id}/sources`

Every plan can create a source with a title and type. Author, publication, fields, text, notes and repositories need the citation manager (Researcher plan and up). Replays of an Idempotency-Key return the original body and request_id; headers are not replayed.

Parameters:

- `workspace_id` (path, required): The workspace (project) id.
- `Idempotency-Key` (header, optional): Makes the write safe to retry (1-255 characters, kept 24 hours). Same key and same request replays the original response; a different request with the same key is a 409.

Takes a request body; see the OpenAPI document for its schema.

Responses:

- `201`: The created source.
- `401`: Missing, malformed, unknown or revoked API key.
- `403`: The key's account is not on the Professional plan, or the key is read-only (a read_write key is required). Also: a field that needs the citation manager.
- `404`: The workspace does not exist or is not visible to this key's owner.
- `409`: The workspace is archived (writes are refused). Also: Idempotency-Key was reused with a different request, or a request with it is still in progress.
- `422`: Validation failed. A bad Idempotency-Key (1-255 characters) is also a 422. Also: Invalid body.
- `429`: Rate limit exceeded. Wait the number of seconds in Retry-After.
- `500`: Unexpected error. Retry later and quote request_id if it persists.

## Get a source

`GET /workspaces/{workspace_id}/sources/{source_id}`

The source, its repositories and its citations, 50 at a time. citation_count is the total.

Parameters:

- `workspace_id` (path, required): The workspace (project) id.
- `source_id` (path, required): The source id.
- `citations_limit` (query, optional): Citations per page, 1 to 50 (default 50).
- `citations_cursor` (query, optional): citations_next_cursor from the previous page.
- `summary` (query, optional): true: each record of the source with its page and citation count, instead of the citations.

Responses:

- `200`: The source.
- `401`: Missing, malformed, unknown or revoked API key.
- `403`: The key's account is not on the Professional plan.
- `404`: The workspace does not exist or is not visible to this key's owner. Also: The source is not in this workspace.
- `422`: Invalid citations_limit, citations_cursor or summary.
- `429`: Rate limit exceeded. Wait the number of seconds in Retry-After.
- `500`: Unexpected error. Retry later and quote request_id if it persists.

## Update a source

`PATCH /workspaces/{workspace_id}/sources/{source_id}`

Needs the citation manager. repositories replaces the source's repository links. Replays of an Idempotency-Key return the original body and request_id; headers are not replayed.

Parameters:

- `workspace_id` (path, required): The workspace (project) id.
- `source_id` (path, required): The source id.
- `Idempotency-Key` (header, optional): Makes the write safe to retry (1-255 characters, kept 24 hours). Same key and same request replays the original response; a different request with the same key is a 409.

Takes a request body; see the OpenAPI document for its schema.

Responses:

- `200`: The source.
- `401`: Missing, malformed, unknown or revoked API key.
- `403`: The key's account is not on the Professional plan, or the key is read-only (a read_write key is required). Also: the plan does not include the citation manager.
- `404`: The workspace does not exist or is not visible to this key's owner. Also: The source is not in this workspace.
- `409`: The workspace is archived (writes are refused). Also: Idempotency-Key was reused with a different request, or a request with it is still in progress.
- `422`: Validation failed. A bad Idempotency-Key (1-255 characters) is also a 422. Also: Invalid body.
- `429`: Rate limit exceeded. Wait the number of seconds in Retry-After.
- `500`: Unexpected error. Retry later and quote request_id if it persists.

## Delete a source

`DELETE /workspaces/{workspace_id}/sources/{source_id}`

Deletes the source and every citation of it. Records and facts are kept. Needs the citation manager. Replays of an Idempotency-Key return the original body and request_id; headers are not replayed.

Parameters:

- `workspace_id` (path, required): The workspace (project) id.
- `source_id` (path, required): The source id.
- `Idempotency-Key` (header, optional): Makes the write safe to retry (1-255 characters, kept 24 hours). Same key and same request replays the original response; a different request with the same key is a 409.

Responses:

- `200`: Deleted.
- `401`: Missing, malformed, unknown or revoked API key.
- `403`: The key's account is not on the Professional plan, or the key is read-only (a read_write key is required). Also: the plan does not include the citation manager.
- `404`: The workspace does not exist or is not visible to this key's owner. Also: The source is not in this workspace.
- `409`: The workspace is archived (writes are refused). Also: Idempotency-Key was reused with a different request, or a request with it is still in progress.
- `422`: Validation failed. A bad Idempotency-Key (1-255 characters) is also a 422.
- `429`: Rate limit exceeded. Wait the number of seconds in Retry-After.
- `500`: Unexpected error. Retry later and quote request_id if it persists.

## Merge a source into another

`POST /workspaces/{workspace_id}/sources/{source_id}/merge`

Moves every citation of this source onto into_id and deletes this source. Needs the citation manager. Replays of an Idempotency-Key return the original body and request_id; headers are not replayed.

Parameters:

- `workspace_id` (path, required): The workspace (project) id.
- `source_id` (path, required): The source id.
- `Idempotency-Key` (header, optional): Makes the write safe to retry (1-255 characters, kept 24 hours). Same key and same request replays the original response; a different request with the same key is a 409.

Takes a request body; see the OpenAPI document for its schema.

Responses:

- `200`: Merged.
- `401`: Missing, malformed, unknown or revoked API key.
- `403`: The key's account is not on the Professional plan, or the key is read-only (a read_write key is required). Also: the plan does not include the citation manager.
- `404`: The workspace does not exist or is not visible to this key's owner. Also: Either source is not in this workspace.
- `409`: The workspace is archived (writes are refused). Also: Idempotency-Key was reused with a different request, or a request with it is still in progress.
- `422`: Validation failed. A bad Idempotency-Key (1-255 characters) is also a 422. Also: Invalid body, or into_id is this source.
- `429`: Rate limit exceeded. Wait the number of seconds in Retry-After.
- `500`: Unexpected error. Retry later and quote request_id if it persists.

## List repositories

`GET /workspaces/{workspace_id}/repositories`

Archives, churches, courts and websites that hold the workspace's sources, by name. Not paginated: next_cursor is always null.

Parameters:

- `workspace_id` (path, required): The workspace (project) id.

Responses:

- `200`: Repositories.
- `401`: Missing, malformed, unknown or revoked API key.
- `403`: The key's account is not on the Professional plan.
- `404`: The workspace does not exist or is not visible to this key's owner.
- `429`: Rate limit exceeded. Wait the number of seconds in Retry-After.
- `500`: Unexpected error. Retry later and quote request_id if it persists.

## Create a repository

`POST /workspaces/{workspace_id}/repositories`

Needs the citation manager. Replays of an Idempotency-Key return the original body and request_id; headers are not replayed.

Parameters:

- `workspace_id` (path, required): The workspace (project) id.
- `Idempotency-Key` (header, optional): Makes the write safe to retry (1-255 characters, kept 24 hours). Same key and same request replays the original response; a different request with the same key is a 409.

Takes a request body; see the OpenAPI document for its schema.

Responses:

- `201`: The created repository.
- `401`: Missing, malformed, unknown or revoked API key.
- `403`: The key's account is not on the Professional plan, or the key is read-only (a read_write key is required). Also: the plan does not include the citation manager.
- `404`: The workspace does not exist or is not visible to this key's owner.
- `409`: The workspace is archived (writes are refused). Also: Idempotency-Key was reused with a different request, or a request with it is still in progress.
- `422`: Validation failed. A bad Idempotency-Key (1-255 characters) is also a 422. Also: Invalid body.
- `429`: Rate limit exceeded. Wait the number of seconds in Retry-After.
- `500`: Unexpected error. Retry later and quote request_id if it persists.

## Update a repository

`PATCH /workspaces/{workspace_id}/repositories/{repository_id}`

Needs the citation manager. Replays of an Idempotency-Key return the original body and request_id; headers are not replayed.

Parameters:

- `workspace_id` (path, required): The workspace (project) id.
- `repository_id` (path, required): The repository id.
- `Idempotency-Key` (header, optional): Makes the write safe to retry (1-255 characters, kept 24 hours). Same key and same request replays the original response; a different request with the same key is a 409.

Takes a request body; see the OpenAPI document for its schema.

Responses:

- `200`: The repository.
- `401`: Missing, malformed, unknown or revoked API key.
- `403`: The key's account is not on the Professional plan, or the key is read-only (a read_write key is required). Also: the plan does not include the citation manager.
- `404`: The workspace does not exist or is not visible to this key's owner. Also: The repository is not in this workspace.
- `409`: The workspace is archived (writes are refused). Also: Idempotency-Key was reused with a different request, or a request with it is still in progress.
- `422`: Validation failed. A bad Idempotency-Key (1-255 characters) is also a 422. Also: Invalid body.
- `429`: Rate limit exceeded. Wait the number of seconds in Retry-After.
- `500`: Unexpected error. Retry later and quote request_id if it persists.

## Delete a repository

`DELETE /workspaces/{workspace_id}/repositories/{repository_id}`

The sources it held are kept. Needs the citation manager. Replays of an Idempotency-Key return the original body and request_id; headers are not replayed.

Parameters:

- `workspace_id` (path, required): The workspace (project) id.
- `repository_id` (path, required): The repository id.
- `Idempotency-Key` (header, optional): Makes the write safe to retry (1-255 characters, kept 24 hours). Same key and same request replays the original response; a different request with the same key is a 409.

Responses:

- `200`: Deleted.
- `401`: Missing, malformed, unknown or revoked API key.
- `403`: The key's account is not on the Professional plan, or the key is read-only (a read_write key is required). Also: the plan does not include the citation manager.
- `404`: The workspace does not exist or is not visible to this key's owner. Also: The repository is not in this workspace.
- `409`: The workspace is archived (writes are refused). Also: Idempotency-Key was reused with a different request, or a request with it is still in progress.
- `422`: Validation failed. A bad Idempotency-Key (1-255 characters) is also a 422.
- `429`: Rate limit exceeded. Wait the number of seconds in Retry-After.
- `500`: Unexpected error. Retry later and quote request_id if it persists.

## Merge a repository into another

`POST /workspaces/{workspace_id}/repositories/{repository_id}/merge`

Moves every source of this repository onto into_repository_id and deletes this repository. A source already held by both keeps the kept repository's call number (filled from this one when empty). Needs the citation manager. Replays of an Idempotency-Key return the original body and request_id; headers are not replayed.

Parameters:

- `workspace_id` (path, required): The workspace (project) id.
- `repository_id` (path, required): The repository id.
- `Idempotency-Key` (header, optional): Makes the write safe to retry (1-255 characters, kept 24 hours). Same key and same request replays the original response; a different request with the same key is a 409.

Takes a request body; see the OpenAPI document for its schema.

Responses:

- `200`: Merged.
- `401`: Missing, malformed, unknown or revoked API key.
- `403`: The key's account is not on the Professional plan, or the key is read-only (a read_write key is required). Also: the plan does not include the citation manager.
- `404`: The workspace does not exist or is not visible to this key's owner. Also: Either repository is not in this workspace.
- `409`: The workspace is archived (writes are refused). Also: Idempotency-Key was reused with a different request, or a request with it is still in progress.
- `422`: Validation failed. A bad Idempotency-Key (1-255 characters) is also a 422. Also: Invalid body, or into_repository_id is this repository.
- `429`: Rate limit exceeded. Wait the number of seconds in Retry-After.
- `500`: Unexpected error. Retry later and quote request_id if it persists.

Canonical: https://kleiobase.com/developers/docs/reference/sources
