Skip to main content
POST
/
v1
/
agents
/
{agent_id}
/
sandbox
/
file_share
Sandbox: File Share
curl --request POST \
  --url https://api.xpander.ai/v1/agents/{agent_id}/sandbox/file_share \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "path": "output/report.csv"
}
'
{
  "status": "ok",
  "stdout": "<string>",
  "stderr": "<string>",
  "exit_code": 123,
  "content": "<string>",
  "path": "<string>",
  "matches": [
    {}
  ],
  "url": "<string>",
  "error": "<string>"
}
Publish a file from the per-agent sandbox to a public CDN URL that can be shared externally (for example, to return a download link from an agent response).

Path Parameters

agent_id
string
required
Agent ID (UUID)

Request Body

path
string
required
Path to the file in the sandbox to publish.

Response

status
string
Result status (e.g., ok).
url
string
Public CDN URL for the shared file.
path
string
Original sandbox file path.

Example Request

curl -X POST "https://api.xpander.ai/v1/agents/<agent-id>/sandbox/file_share" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{
    "path": "output/report.csv"
  }'

Notes

  • Shared URLs are unauthenticated — treat them as public links. Do not share files containing secrets.
  • The returned URL is served from the xpander CDN and is safe to include in agent responses or webhooks.

See Also

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

agent_id
string
required

Agent UUID

Body

application/json

Request body for publishing a sandbox file to a public CDN URL.

path
string
required

Path to the file in the sandbox to publish.

Example:

"output/report.csv"

Response

Successful Response

Generic response wrapper returned by agent sandbox endpoints. Not every field is populated for every tool.

status
string

Result status of the sandbox operation.

Example:

"ok"

stdout
string | null

Standard output captured from the sandbox command. Present for bash.

stderr
string | null

Standard error captured from the sandbox command. Present for bash.

exit_code
integer | null

Process exit code returned by the sandbox. Present for bash.

content
string | null

File contents. Present for file_read.

path
string | null

File path affected by the operation. Present for file_write, file_edit, multi_edit, file_share.

matches
Matches · object[] | null

Match results. Present for glob and grep.

url
string<uri> | null

Public CDN URL. Present for file_share.

error
string | null

Error message when the operation fails.