> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Workspace: File Share

> Publish a file from the agent's workspace to a public CDN URL

Publish a file from the per-agent workspace to a public CDN URL that can be shared externally (for example, to return a download link from an agent response).

## Path Parameters

<ParamField path="agent_id" type="string" required>
  Agent ID (UUID)
</ParamField>

## Request Body

<ParamField body="path" type="string" required>
  Path to the file in the workspace to publish.
</ParamField>

## Response

<ResponseField name="status" type="string">
  Result status (e.g., `ok`).
</ResponseField>

<ResponseField name="url" type="string">
  Public CDN URL for the shared file.
</ResponseField>

<ResponseField name="path" type="string">
  Original workspace file path.
</ResponseField>

## Example Request

```bash theme={"dark"}
curl -X POST "https://api.xpander.ai/v1/agents/<agent-id>/workspace/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

* [Workspace: File Write](/api-reference/v1/agents/workspace/file-write)
* [Workspace: File Read](/api-reference/v1/agents/workspace/file-read)


## OpenAPI

````yaml POST /v1/agents/{agent_id}/workspace/file_share
openapi: 3.1.0
info:
  title: xpander.ai API Service
  description: |2-

        The xpander.ai API Service provides a unified REST API for managing AI agents,
        executing tasks, managing knowledge bases, and integrating with external systems.
        
        Features:
        - Agent Management: Create, update, deploy, and delete AI agents
        - Task Execution: Invoke agents with support for sync, async, and streaming modes
        - Knowledge Bases: Manage knowledge bases and documents for RAG workflows
        - Tools: Discover, connect, and attach tools (connectors, custom functions, MCP servers, sub-agents, workflows) to agents and workflows
        - MCP Integration: Model Context Protocol support for standardized AI interactions
        
        Authentication: All endpoints require authentication via either an API key (`x-api-key`) or an OAuth2 JWT (`Authorization: Bearer <jwt>`).
        
  version: '0.001'
servers:
  - url: https://api.xpander.ai
security: []
paths:
  /v1/agents/{agent_id}/workspace/file_share:
    post:
      tags:
        - API v1
        - Agents
        - Agents Workspace
      summary: 'Workspace: File Share'
      description: >-
        Publish a file from the agent's workspace to a public CDN URL for
        sharing.
      operationId: Workspace__File_Share_v1_agents__agent_id__workspace_file_share_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileShareRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileShareResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    FileShareRequest:
      properties:
        path:
          type: string
          title: Path
          description: Relative path to the file in the workspace to share publicly.
          examples:
            - output/report.csv
      type: object
      required:
        - path
      title: FileShareRequest
    FileShareResponse:
      properties:
        url:
          type: string
          title: Url
          description: Public CDN URL for the shared file
      type: object
      required:
        - url
      title: FileShareResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: API Key for authentication
      in: header
      name: x-api-key

````