Skip to main content
POST
/
v2
/
knowledge
/
public
curl --request POST \
  --url 'https://api-prod.usefini.com/v2/knowledge/public' \
  --header 'Authorization: Bearer fini_your_api_key' \
  --header 'Content-Type: application/json' \
  --data '{
    "candidateKnowledge": "Customers on annual plans can cancel at the end of the current billing term.",
    "origin": "generated",
    "botId": "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3",
    "isDraft": true
  }'
{
  "backgroundJobId": "4cfcf2cc-7a06-4de2-b460-5b991fe6236a"
}
Use this route when you already have the candidate content you want to turn into knowledge and need Fini to process it as a single background job.
This route always requires candidateKnowledge. If you want Fini to generate directly from stored source content, use Bulk generate knowledge instead. isDraft defaults to true.

Origins

OriginUse it forExtra required field
generatedRaw candidate text that is not tied to another Fini recordNone
sourcesCandidate text you want to associate with one ingested source recorddocumentId
inboxCandidate text you want to associate with one inbox eventhcEventId

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

candidateKnowledge
string
required
Candidate content to turn into knowledge.
origin
string
required
Origin for the content. Allowed values are sources, generated, and inbox.
documentId
string
Required when origin is sources. This is the ingested source ID you want to link the generated result to.
hcEventId
string
Required when origin is inbox. This is the inbox event ID you want to link the generated result to.
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 the generated knowledge.
instructions
string
Additional generation instructions.
botId
string
Optional agent ID to scope the generated content to.
isDraft
boolean
default:true
Whether the generated result should remain a draft.

restrictedOps values

Use restrictedOps to limit the operation choices available to the knowledge-generation pipeline for that request.
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.
curl --request POST \
  --url 'https://api-prod.usefini.com/v2/knowledge/public' \
  --header 'Authorization: Bearer fini_your_api_key' \
  --header 'Content-Type: application/json' \
  --data '{
    "candidateKnowledge": "Customers on annual plans can cancel at the end of the current billing term.",
    "origin": "generated",
    "botId": "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3",
    "isDraft": true
  }'

Response

backgroundJobId
string
Background job ID for the queued generation request.
{
  "backgroundJobId": "4cfcf2cc-7a06-4de2-b460-5b991fe6236a"
}

Next step

Poll the queued job with Check knowledge jobs. If you left isDraft at its default true, review or publish the resulting draft before expecting live agent answers to change.

Errors

The request body is malformed, candidateKnowledge is missing, origin is invalid, or the origin-specific required field is missing.
The API key is missing, malformed, revoked, or invalid.
The API key does not include the write scope.
Expected when isDraft was left at its default true. Poll the job status, then review or publish the resulting draft through the article workflow.
Fini failed while queueing or processing the generation job. Retry once, then inspect the job with Check knowledge jobs.