Disconnect a file

SDK platic.agents.files.disconnect()

Remove a file from this agent by specifying its fileId in the URL. The change applies immediately, without publishing, and does not create a version. The file remains in the workspace and on other agents. To delete it from all agents, use Delete a file.

Example

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

Path parameters

ParameterTypeDescriptionRequired
agentIdstringAgent id✓
fileIdstringFile id✓

Request body

No body.

Response

204 No Content, with no body.

Errors

Statusdetails.codeWhen
403RESOURCE_NOT_ACCESSIBLEYou can't edit the agent.
404RESOURCE_NOT_ACCESSIBLEThe file isn't connected to this agent.

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

Notes

  • Being able to edit the agent is enough; Integrations isn't needed.
  • A file that no agent uses stays in the workspace, with no agents. It can be connected again or deleted.
  • What was scheduled on this connection is lost.
  • For the agent to stop using it without losing the connection, use Pause or schedule a file.
  • From an AI agent, the tool is disconnect_agent_file.