Get a processing

SDK platic.files.job()

Check whether file content is ready after creating, replacing or reprocessing it, or automatically refreshing a page. Poll its uploadId every few seconds until terminal is true. If you can only read the agent that uses the file, use the agent’s route.

Example

await platic.files.job("file_123", "upload_123");

Path parameters

ParameterTypeDescriptionRequired
fileIdstringThe file✓
uploadIdstringThe processing (uploadId from the 202 response, or the file's latestUploadId)✓

Response

{
  "status": "success",
  "data": {
    "fileId": "fH3kL9mQ2xR7",
    "uploadId": "up_4Tn8Vb2Kc1",
    "status": "ready",
    "terminal": true,
    "hasUsableContent": true,
    "activeVersionId": "vr_2Lp9Qs",
    "error": null,
    "createdAt": "2026-11-01T10:00:00.000Z",
    "updatedAt": "2026-11-01T10:01:12.000Z",
    "moderation": {
      "status": "approved",
      "reasonCode": null,
      "message": null,
      "checkedAt": "2026-11-01T10:00:58.000Z",
      "policyVersion": "ingestion_common_v1"
    },
    "trigger": "create",
    "result": "updated"
  }
}

A processing that failed answers 200 with its reason in data.error:

{
  "status": "success",
  "data": {
    "fileId": "kP7wQ2sN5tY1",
    "uploadId": "up_9Rf3Jd6Hx2",
    "status": "failed",
    "terminal": true,
    "hasUsableContent": false,
    "activeVersionId": null,
    "error": { "code": "UPLOAD_EXPIRED", "message": "The upload did not finish in time" },
    "createdAt": "2026-11-01T10:00:00.000Z",
    "updatedAt": "2026-11-01T11:00:04.000Z",
    "moderation": {
      "status": "pending",
      "reasonCode": "INPUT_NOT_CHECKED",
      "message": null,
      "checkedAt": null,
      "policyVersion": null
    },
    "trigger": "create",
    "result": null
  }
}

The response’s status ("success") means the query succeeded. data.status is the processing job’s state.

Response fields

FieldTypeDescription
fileId, uploadIdstringThe file and the processing.
statusstringawaiting_upload, queued, parsing, chunking, embedding, ready or failed (see processing).
terminalbooleantrue with ready or failed. Stop asking.
hasUsableContentbooleanThe file has content agents can use (from this processing or an earlier one).
activeVersionIdstring | nullThe content agents use now.
errorobject | nullOnly with failed: code and message. See the table below.
moderationobjectThe security review: status (pending, approved or rejected), reasonCode, message, checkedAt and policyVersion.
triggerstringWhat opened it: create, replace, reprocess, refresh (automatic page refresh) or migration.
resultstring | nullWith ready: updated (agents use the new content) or unchanged (the text was the same; nothing changed). null until it finishes.
createdAt, updatedAtstringDates in UTC.

Why a processing fails

error.codeWhat happenedWhat to do
PROCESSING_FAILEDThe content could not be processed.Reprocess it.
PROCESSING_TIMEOUTIt took too long.Reprocess it.
SOURCE_INVALIDThe document or the page cannot be read.Check the source and replace it.
UPLOAD_EXPIREDThe bytes of an upload did not arrive within an hour.Replace it with a new upload.
AUTHORITY_REVOKEDThe permission of whoever requested it changed before it finished.Request it again with permission.
SOURCE_LIMIT_EXCEEDEDThe content is too large.Split it into several files.
SOURCE_PAGE_LIMIT_EXCEEDEDIt has too many pages.Split it.
SOURCE_DERIVED_LIMIT_EXCEEDEDThe resulting text is too long.Split it.
STORAGE_LIMIT_EXCEEDEDThe workspace reached its storage limit.Delete files you no longer use.
SOURCE_CONTENT_MISMATCHThe content does not match the declared type.Send the correct contentType.
SOURCE_FORMAT_REJECTEDThat format cannot be used.Convert it to one from the list.
SOURCE_CONTAINER_INVALIDThe document is damaged inside.Export it again.
SOURCE_CONTAINER_LIMIT_EXCEEDEDThe document has too much content inside.Split it.
SOURCE_INSPECTION_INCOMPLETEThe whole document could not be checked.Reprocess it.
CONTENT_POLICY_REJECTEDThe content did not pass the security review (moderation.status: "rejected").Change the content.
CONTENT_REVIEW_UNAVAILABLEThe review was not available.Reprocess it later.
CONTENT_REVIEW_INCOMPLETEThe review did not finish.Reprocess it.

If the file already had content, a failed processing does not touch it: agents keep using the previous one.

Errors

Statusdetails.codeWhen
403RESOURCE_NOT_ACCESSIBLEYou do not have Integrations nor can you edit all the agents that use it.
404RESOURCE_NOT_ACCESSIBLEThat file or that processing does not exist.
410JOB_GONEThe processing is old and no longer stored. Read the file.

The ones that apply to all operations are in common errors.

Notes

  • In the SDK, platic.files.job(fileId, uploadId) reads the state once. If you want to wait until it finishes without writing your own loop, use await platic.files.waitForJob(fileId, uploadId) (it returns the job even if status is failed).