---
title: "Put a library item to a question"
method: POST
path: "/workspaces/{id}/questions/{questionId}/sources"
tags: ["sources"]
---

# Put a library item to a question

`POST /workspaces/{id}/questions/{questionId}/sources`

## Request

- Base URL: `https://api.swingfactor.ai/v1`
- URL: `https://api.swingfactor.ai/v1/workspaces/{id}/questions/{questionId}/sources`
- Auth: HTTP bearer

A document or a web page already in the workspace’s library. Add one at /workspaces/{id}/content first: an upload, or a page by its address.

## Path parameters

- `id` string, uuid, required
- `questionId` string, uuid, required

## Headers

- `Idempotency-Key` string

## Request body

- SourceBody
  - `itemId` string, uuid, required: A ready item of kind `sources` in this workspace’s library: add a document or a page at /workspaces/{id}/content first.
  - `reason` string: Why — kept in the history.

## Response `201`

The source.

- QuestionSource
  - `id` string, uuid, required: Its place on the question: what is taken off.
  - `workspaceId` string, uuid, required
  - `questionId` string, uuid, required
  - `createdAt` string, required: When it was put to the question.
  - `evidenceCount` integer, required: Pieces of this question’s evidence citing it.
  - `item` object, required: The library item it is: a document somebody uploaded, or a web page. Read, changed and deleted at /workspaces/{id}/content.
    - `id` string, uuid, required
    - `kind` 'sources', required
    - `origin` 'upload' | 'web', required: Where its bytes come from: an upload, or a web page.
    - `name` string, required: A file’s name; a page’s title, or its address until it is read.
    - `note` string, nullable, required: What it is for, in the words of whoever added it.
    - `url` string, nullable, required: A page’s address. Null for an upload.
    - `status` 'pending' | 'ready', required
    - `contentType` string, nullable, required
    - `size` integer, nullable, required: Bytes: as declared while an upload is pending, as stored once ready.
    - `currentVersionId` string, uuid, nullable, required: The version it reads as now.
    - `readStatus` 'waiting' | 'reading' | 'read' | 'no_text' | 'failed' | 'not_read' | 'null', nullable, required: For a kind that is read: how far reading its text has got.
    - `readError` string, nullable, required: Why the last reading came to nothing, in words.
    - `textChars` integer, nullable, required: Characters of text read out.
    - `readAt` string, nullable, required
    - `checkedAt` string, nullable, required: When its origin was last asked whether it changed.
    - `addedBy` string, uuid, nullable, required
    - `addedByName` string, nullable, required: Kept when the account that added it is gone.
    - `addedByActor` string, nullable, required: What added it where no person did: the product, for what its model found.
    - `createdAt` string, required
    - `links` ContentItemLinks, required: Relative /v1 URLs to follow.
      - `self` string, required
      - `workspace` string, required
      - `download` string
      - `complete` string
      - `upload` string
  - `links` QuestionSourceLinks, required: Relative /v1 URLs to follow.
    - `self` string, required
    - `question` string, required

## Other responses

- `400`: `already_a_source`: it is already a source of this question.
- `401`: No token, or not a valid one: `unauthorized`.
- `404`: No such question, or nothing with that id in the library.

---

[API](https://skmtc.dev/swingfactor/apis/swingfactor-api.md) · [All operations](https://skmtc.dev/swingfactor/apis/swingfactor-api/llms.txt) · [OpenAPI document](https://skmtc.dev/swingfactor/apis/swingfactor-api/revisions/c2fe881a39c3?raw)
