Pause or schedule a file

SDK platic.agents.files.setState()

Choose when an agent uses a file. Send state to pause or activate it now, and schedule to schedule activation or pausing. The change applies without publishing and does not create a version. Only this agent’s connection changes; pausing keeps the file connected.

Example

await platic.agents.files.setState("agent_123", "file_123", "paused");

Path parameters

ParameterTypeDescriptionRequired
agentIdstringAgent id✓
fileIdstringFile id✓

Request body

Send state, schedule or both.

FieldTypeDescriptionRequired
statestringactive or paused.-
scheduleobject | nullScheduled activation and pause dates. null removes both.-
schedule.activateAtstring | nullWhen to activate it, in UTC with milliseconds (2026-12-01T15:00:00.000Z). null removes it; if you don't send it, it is kept.-
schedule.pauseAtstring | nullWhen to pause it. Same as activateAt.-

The dates have to be in the future and at most 366 days away.

Pause or resume

{ "state": "paused" }

Schedule

It will activate on December 1 at 9:00 (Mexico City time) and pause on December 31:

{
  "schedule": {
    "activateAt": "2026-12-01T15:00:00.000Z",
    "pauseAt": "2026-12-31T15:00:00.000Z"
  }
}

To remove just one date, send it as null; the one you don't send stays as it is. To remove both:

{ "schedule": null }

Response

200 OK with the connection:

{
  "status": "success",
  "data": {
    "agentId": "Xq8mTe2LwP4kZ1aB9cDf",
    "fileId": "fH3kL9mQ2xR7",
    "state": "paused",
    "attachedAt": "2026-10-30T16:02:11.000Z",
    "activateOnReady": false,
    "schedule": {
      "activateAt": "2026-12-01T15:00:00.000Z",
      "pauseAt": "2026-12-31T15:00:00.000Z",
      "last": null
    }
  }
}

data is the connection, with the fields from List agent files.

How what is scheduled is applied

  • Platica checks the schedule every few minutes. The change takes effect shortly after the scheduled time, rather than at the exact second.
  • Pausing is always applied.
  • Activating is applied only if the file has content ready and whoever scheduled it can still edit the agent. If not, nothing changes and schedule.last ends up with outcome: "failed" and the reason in message.
  • Each completed scheduled date is cleared from schedule and recorded in schedule.last.
  • Pausing or resuming manually does not clear the schedule.

Errors

Statusdetails.codeWhen
400INVALID_INPUTThe body is empty or a value isn't valid.
403RESOURCE_NOT_ACCESSIBLEYou can't edit the agent.
404RESOURCE_NOT_ACCESSIBLEThe file isn't connected to this agent.
409FILE_NOT_READYResuming a file that doesn't have content ready yet.
422INVALID_INPUTA date has already passed or is more than 366 days away (details.fields, for example ["schedule.activateAt"]).

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

Notes

  • Being able to edit the agent is enough; Integrations isn't needed.
  • In the SDK, to pause or activate use platic.agents.files.setState(agentId, fileId, "paused") and to schedule use platic.agents.files.schedule(agentId, fileId, { activateAt, pauseAt }) (it accepts Date objects or UTC date strings; pass null instead of the object to clear both dates).
  • To remove the connection, use Disconnect a file.
  • From an AI agent, the tools are set_agent_file_state and schedule_agent_file.