Get a file

SDK platic.files.get()

Retrieves file details. Use include to add its processed text, a download link or the list of agents that use it.

Example

await platic.files.get("file_123");

Path parameters

ParameterTypeDescriptionRequired
fileIdstringThe file✓

Query parameters

ParameterTypeDescription
includestringWhat to add, comma-separated and in this order: content, download, affectedAgents (for example content,affectedAgents).
affectedLimitintegerWith affectedAgents: how many agents per page, from 1 to 200.
affectedPageTokenstringWith affectedAgents: affectedAgents.nextPageToken of the previous page.
downloadTargetstringWith download: current (the text agents use, the default), original (the document as it was uploaded) or candidate (the text of a processing that did not finish).
uploadIdstringWith downloadTarget original or candidate: which processing.
acknowledgeUnreviewedstringWith downloadTarget original or candidate: true. Confirms you are asking for something that did not pass the security review.

original and candidate go alone (include=download), with uploadId and acknowledgeUnreviewed=true.

Response

{
  "status": "success",
  "data": {
    "fileId": "fH3kL9mQ2xR7",
    "title": "Return policies",
    "description": "Deadlines, conditions and exceptions for returning a product.",
    "kind": "url",
    "lifecycle": "available",
    "activeVersionId": "vr_2Lp9Qs",
    "pipelineStatus": "ready",
    "latestUploadId": "up_4Tn8Vb2Kc1",
    "attachmentCount": 2,
    "createdAt": "2026-10-30T16:02:11.000Z",
    "updatedAt": "2026-11-01T10:12:45.000Z",
    "sourceUrl": "https://acme.com/policies/returns",
    "refresh": {
      "intervalHours": 24,
      "nextRunAt": "2026-11-02T10:12:45.000Z",
      "lastRunAt": "2026-11-01T10:12:45.000Z",
      "lastResult": "unchanged",
      "lastError": null
    },
    "tags": [],
    "fileName": null,
    "contentType": null,
    "byteSize": 3420
  }
}

With include=content,affectedAgents these are added:

{
  "status": "success",
  "data": {
    "fileId": "fH3kL9mQ2xR7",
    "content": {
      "versionId": "vr_2Lp9Qs",
      "text": "# Returns\n\nYou have 30 days to return a product...",
      "mediaType": "text/markdown"
    },
    "affectedAgents": {
      "data": [
        { "agentId": "Xq8mTe2LwP4kZ1aB9cDf", "displayName": "Sales" },
        { "agentId": "Lm4Rt8Wq2Zp6Yb1Nc3Vd", "displayName": "Support" }
      ],
      "nextPageToken": null,
      "total": 2,
      "confirmationToken": "del1...."
    }
  }
}

Response fields

FieldTypeDescription
fileIdstringFile ID.
titlestringName, 1 to 200 characters.
descriptionstringWhat it is about and when to consult it, up to 1024 characters. It can be empty while it is being generated.
kindstringtext, url or file.
lifecyclestringavailable, or deleting while it is being deleted.
activeVersionIdstring | nullThe content agents use. null if there is no content ready yet.
pipelineStatusstring | nullThe state of the last processing (see states).
latestUploadIdstring | nullThe last processing. Use it to read its progress.
attachmentCountintegerHow many agents have it connected, with the connection active or paused.
createdAt, updatedAtstringDates in UTC.
sourceUrlstring | nullThe page of a url file. null in the others.
refreshobject | nullOnly in url files that are kept up to date; otherwise null.
refresh.intervalHoursintegerEvery how many hours the page is re-read.
refresh.nextRunAtstring | nullWhen the next read is due. null while a read is in progress.
refresh.lastRunAtstring | nullThe last time the page was read (automatic or with Reprocess a file).
refresh.lastResultstring | nullupdated (it changed and was updated), unchanged (it did not change) or failed.
refresh.lastErrorstring | nullWith failed: why.
tagsstring[]Organization tags in Storage. Agents do not see them.
fileNamestring | nullOriginal name of the document in file files; null in text and url.
contentTypestring | nullMIME type of the document in file files; null in text and url.
byteSizeinteger | nullSize in bytes that counts against the workspace's storage (null until it is calculated).
contentobject | nullWith include=content: the Markdown text agents use (versionId, text, mediaType). null without content ready.
downloadobject | nullWith include=download: url (valid for 5 minutes), expiresAt, target, uploadId, versionId, fileName (contenido.md or original.bin), mediaType, byteSize and reviewStatus (pending, approved or rejected).
affectedAgentsobjectWith include=affectedAgents: the agents that use it (agentId, displayName), in pages, with total.
affectedAgents.confirmationTokenstring | nullOnly on the last page: the permission to delete the file. Valid for 10 minutes.
deletionobjectOnly with lifecycle: "deleting": { operationId, status: "pending" }.

Errors

Statusdetails.codeWhen
400INVALID_INPUTA combination of parameters is not valid; for example, affectedLimit without include=affectedAgents.
403RESOURCE_NOT_ACCESSIBLEYou do not have Integrations nor can you edit all the agents that use it.
404RESOURCE_NOT_ACCESSIBLEThe file does not exist in this workspace.
409DOWNLOAD_NOT_READYYou asked to download something that is still being processed.
409DOWNLOAD_BLOCKEDThe content did not pass the review: it cannot be downloaded.
409FILE_UNAVAILABLEYou asked to download a file that is being deleted.
410FILE_DELETEDThe file was already deleted.
410DOWNLOAD_GONEWhat you asked to download no longer exists.
422CONTENT_REQUIRES_DOWNLOADThe text is over 1 MiB: ask for it with include=download.

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