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": "SOURCE_IMPORT",
"isDraft": true
}'
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/knowledge/public/bulk",
headers={
"Authorization": "Bearer fini_your_api_key",
"Content-Type": "application/json",
},
json={
"documentIds": [
"5d9f67a8-d853-4af4-b7ce-23ebba1245e5",
"35b4838a-4136-4f6c-a530-8f17cb47566d",
],
"origin": "SOURCE_IMPORT",
"isDraft": True,
},
)
jobs = response.json()
const response = await fetch("https://api-prod.usefini.com/v2/knowledge/public/bulk", {
method: "POST",
headers: {
Authorization: "Bearer fini_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
documentIds: [
"5d9f67a8-d853-4af4-b7ce-23ebba1245e5",
"35b4838a-4136-4f6c-a530-8f17cb47566d",
],
origin: "SOURCE_IMPORT",
isDraft: true,
}),
});
const jobs = await response.json();
{
"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"
}
]
}
Knowledge generation
Bulk generate knowledge
Queue generate-and-save jobs for multiple source IDs in one request.
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": "SOURCE_IMPORT",
"isDraft": true
}'
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/knowledge/public/bulk",
headers={
"Authorization": "Bearer fini_your_api_key",
"Content-Type": "application/json",
},
json={
"documentIds": [
"5d9f67a8-d853-4af4-b7ce-23ebba1245e5",
"35b4838a-4136-4f6c-a530-8f17cb47566d",
],
"origin": "SOURCE_IMPORT",
"isDraft": True,
},
)
jobs = response.json()
const response = await fetch("https://api-prod.usefini.com/v2/knowledge/public/bulk", {
method: "POST",
headers: {
Authorization: "Bearer fini_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
documentIds: [
"5d9f67a8-d853-4af4-b7ce-23ebba1245e5",
"35b4838a-4136-4f6c-a530-8f17cb47566d",
],
origin: "SOURCE_IMPORT",
isDraft: true,
}),
});
const jobs = await response.json();
{
"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.
Use
This route only supports
origin: "SOURCE_IMPORT". It reads from the stored source content for each documentId, and isDraft defaults to true.Headers
string
required
Bearer token containing your Fini workspace API key. Format:
Bearer fini_... The key needs write scope.string
required
application/jsonBody parameters
array
required
Source IDs to generate from.
string
required
Must be
SOURCE_IMPORT on the bulk route.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.
string
Additional generation instructions.
string
Optional agent ID to scope the generated content to.
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.
| Value | Meaning |
|---|---|
ADD_ARTICLE_TO_FOLDER | Allow Fini to create a new article in an existing folder. |
UPDATE_ARTICLE | Allow Fini to update an existing article that the pipeline selects as the best match. |
DO_NOTHING | Allow Fini to decide that no knowledge change should be applied. When isDraft is true, this still creates a reviewable draft/no-op record. |
Response
array
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": "SOURCE_IMPORT",
"isDraft": true
}'
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/knowledge/public/bulk",
headers={
"Authorization": "Bearer fini_your_api_key",
"Content-Type": "application/json",
},
json={
"documentIds": [
"5d9f67a8-d853-4af4-b7ce-23ebba1245e5",
"35b4838a-4136-4f6c-a530-8f17cb47566d",
],
"origin": "SOURCE_IMPORT",
"isDraft": True,
},
)
jobs = response.json()
const response = await fetch("https://api-prod.usefini.com/v2/knowledge/public/bulk", {
method: "POST",
headers: {
Authorization: "Bearer fini_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
documentIds: [
"5d9f67a8-d853-4af4-b7ce-23ebba1245e5",
"35b4838a-4136-4f6c-a530-8f17cb47566d",
],
origin: "SOURCE_IMPORT",
isDraft: true,
}),
});
const jobs = await response.json();
{
"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
400 Bad Request
400 Bad Request
The request body is malformed,
documentIds is missing or empty, or origin is not SOURCE_IMPORT.401 Unauthorized
401 Unauthorized
The API key is missing, malformed, revoked, or invalid.
403 Forbidden
403 Forbidden
The API key does not include the
write scope.500 Internal Server Error
500 Internal Server Error
Fini failed while queueing or processing one or more generation jobs. Retry once, then inspect the job IDs with Check knowledge jobs.
Was this page helpful?

