---
title: "Add sources to a collection"
method: POST
path: "/library/collections/{collectionId}/sources"
tags: ["Library"]
---

# Add sources to a collection

`POST /library/collections/{collectionId}/sources`

## Request

- Base URL: `https://elicit.com/api/v2`
- URL: `https://elicit.com/api/v2/library/collections/{collectionId}/sources`
- Auth: HTTP bearer

Adds up to 500 of your sources to a collection you own or can edit. `addedCount` is the number added.

A source is skipped if it is already in the collection, or if a paper in the collection is the same paper. Papers match by Elicit id, DOI, title, or identical PDF. Each skipped source appears in `duplicates` with `duplicateOf`, the id of the paper already in the collection (its own id when it was already a member). Each added source appears in `added` with `collectionSourceId`, the id the collection holds for it: in a group collection the collection gets its own copy of each added source, under its own id, and your source stays yours.

If any id is not a source you own, the request returns `404` and adds nothing.

### Example

```bash
curl -X POST https://elicit.com/api/v2/library/collections/{collectionId}/sources \
  -H "Authorization: Bearer elk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"sourceIds":["8e2d4d52-3b8a-4f6c-9e1a-2c7b6d5e4f30"]}'
```

## Path parameters

- `collectionId` string, uuid, required

## Request body

- object
  - `sourceIds` string[], required: Ids of your library sources.

## Response `200`

How many sources were newly added.

- AddLibraryCollectionSourcesResponse
  - `addedCount` integer, required: Sources newly added; sources already in the collection are skipped.
  - `added` object[], required: The sources this call added.
    - `sourceId` string, uuid, required
    - `collectionSourceId` string, uuid, required: Id of the paper inside the collection. A group collection keeps its own copy, so this differs from sourceId; a personal collection holds the source itself.
  - `duplicates` object[], required: Sources that were not added because the collection already has the same paper. Papers match by Elicit id, DOI, title, or identical PDF.
    - `sourceId` string, uuid, required
    - `duplicateOf` string, uuid, required: The id of the source that is already in the collection; the source itself when it was already a member.

## Other responses

- `400`: A malformed id, or an unknown or invalid query parameter.
- `401`: Authentication failed. The API key is missing, invalid, revoked, or expired.
- `403`: API access is unavailable on your plan, or your role does not allow this action.
- `404`: The collection is not visible to you, or a sourceId is not a source you own. Nothing is applied.
- `429`: Rate limit exceeded. More than 100 requests per minute were received from your IP address; further requests are blocked for 5 minutes.
- `500`: An unexpected error occurred. Retry reads with backoff; before retrying a write, check whether it took effect. See Error Handling for retry guidance.

## Changes

- **2026-10-16** `22847bf7e65d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/elicitlabs/apis/elicit-labs-api/changes/library/collections/:collectionId/sources/post.md)

---

[API](https://skmtc.dev/elicitlabs/apis/elicit-labs-api.md) - [All operations](https://skmtc.dev/elicitlabs/apis/elicit-labs-api/llms.txt) - [OpenAPI document](https://skmtc.dev/elicitlabs/apis/elicit-labs-api/revisions/cbbe29509d04?raw)
