Skip to main content
POST
/
v2
/
knowledge
/
public
/
bulk
curl --request POST \
  --url 'https://api-prod.usefini.com/v2/knowledge/public/bulk' \
  --header 'Authorization: Bearer fini_your_api_key' \
  --header 'Content-Type: application/json' \
  --data '{
    "documentIds": [
      "5d9f67a8-d853-4af4-b7ce-23ebba1245e5",
      "35b4838a-4136-4f6c-a530-8f17cb47566d"
    ],
    "origin": "sources",
    "isDraft": true
  }'
{
  "jobs": [
    {
      "documentId": "5d9f67a8-d853-4af4-b7ce-23ebba1245e5",
      "backgroundJobId": "4cfcf2cc-7a06-4de2-b460-5b991fe6236a"
    },
    {
      "documentId": "35b4838a-4136-4f6c-a530-8f17cb47566d",
      "backgroundJobId": "1b18f1d5-f5cc-4fc2-8d5b-38d4a7c5f28b"
    }
  ]
}
Use this route when you want Fini to generate knowledge directly from ingested source records at scale. This is the main self-serve route for source-backed knowledge creation and refresh.
This route only supports origin: "sources". It reads from the stored source content for each documentId, and isDraft defaults to true.

Headers

Authorization
string
required
Bearer token containing your Fini workspace API key. Format: Bearer fini_... The key needs write scope.
Content-Type
string
required
application/json

Body parameters

documentIds
array
required
Source IDs to generate from.
origin
string
required
Must be sources on the bulk route.
restrictedOps
array
Optional operation restrictions passed through to the generation pipeline. Use this to limit what Fini is allowed to do when it decides how to apply each source.
instructions
string
Additional generation instructions.
botId
string
Optional agent ID to scope the generated content to.
isDraft
boolean
default:true
Whether the generated results should remain drafts.

restrictedOps values

Use restrictedOps to limit the operation choices available to the knowledge-generation pipeline for every source in the batch.
ValueMeaning
ADD_ARTICLE_TO_FOLDERAllow Fini to create a new article in an existing folder.
UPDATE_ARTICLEAllow Fini to update an existing article that the pipeline selects as the best match.
DO_NOTHINGAllow Fini to decide that no knowledge change should be applied. When isDraft is true, this still creates a reviewable draft/no-op record.

Response

jobs
array
One queued job per input source.
curl --request POST \
  --url 'https://api-prod.usefini.com/v2/knowledge/public/bulk' \
  --header 'Authorization: Bearer fini_your_api_key' \
  --header 'Content-Type: application/json' \
  --data '{
    "documentIds": [
      "5d9f67a8-d853-4af4-b7ce-23ebba1245e5",
      "35b4838a-4136-4f6c-a530-8f17cb47566d"
    ],
    "origin": "sources",
    "isDraft": true
  }'
{
  "jobs": [
    {
      "documentId": "5d9f67a8-d853-4af4-b7ce-23ebba1245e5",
      "backgroundJobId": "4cfcf2cc-7a06-4de2-b460-5b991fe6236a"
    },
    {
      "documentId": "35b4838a-4136-4f6c-a530-8f17cb47566d",
      "backgroundJobId": "1b18f1d5-f5cc-4fc2-8d5b-38d4a7c5f28b"
    }
  ]
}

Refresh existing knowledge from changed sources

If existing sources already back knowledge in Fini and the upstream content changes, the refresh sequence is:
1

Refresh the existing source IDs

Call Refresh sources with the source IDs you already have.
2

Poll until the source refresh finishes

Use List sources or Get source until linkedJobStatus moves to COMPLETED.
3

Filter to the sources that actually changed

Call List sources with changed=true. If you only want web content, also pass source=web. Keep the source records that already have a linkedKnowledgeId.
4

Bulk generate and save knowledge for those changed source IDs

Call this route with the changed documentIds. Use isDraft: true if you want to review the updates first. Use isDraft: false only if you want the updated knowledge saved live immediately.
5

Poll job status, then review if drafts were created

Call Check knowledge jobs with the returned job IDs until the jobs finish. If you created drafts, review and publish them before expecting live answers to change.
After a successful source-backed save, Fini syncs the source’s linked knowledge reference and clears the changed flag on that source record.

Errors

The request body is malformed, documentIds is missing or empty, or origin is not sources.
The API key is missing, malformed, revoked, or invalid.
The API key does not include the write scope.
Fini failed while queueing or processing one or more generation jobs. Retry once, then inspect the job IDs with Check knowledge jobs.