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

# Share

> Generate an instantly shareable URL for a single file.

Returns an instantly shareable URL to any single file. Byteport does not cache
or prefetch — if the source is offline, the URL will be unable to pull the
file and will instead show *a fallback message*.

### Body parameters

<ParamField body="file" type="string" required>
  Filename to share. Regex supported, but the request will return *a specific
  error code* if it matches to more than one source file.
</ParamField>

<ParamField body="password" type="string">
  Text password required to unlock the provided URL.
</ParamField>

### Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.byteport.com/share \
    -H "Authorization: Bearer bp_xxxxxxxxx" \
    -H "User-Agent: my-app/1.0" \
    -H "Content-Type: application/json" \
    -d '{
      "file":     "Production Bucket/reports/Q1.pdf",
      "password": "hunter2"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "url": "https://byteport.link/s/abc123"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml POST /share
openapi: 3.1.0
info:
  title: Byteport API
  description: >-
    The Byteport API lets you move, share, and manage files across every storage
    location connected to your workspace through a single HTTP interface.
  version: 1.0.0
servers:
  - url: https://api.byteport.com
security:
  - bearerAuth: []
paths:
  /share:
    post:
      summary: Share
      description: >-
        Returns an instantly shareable URL for a single file. The link streams
        directly from the source — nothing is cached or prefetched.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  description: Filename to share.
                password:
                  type: string
                  description: Password required to unlock the provided URL.
      responses:
        '200':
          description: Shareable URL returned
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    format: uri
        '400':
          $ref: '#/components/responses/Error'
components:
  responses:
    Error:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: integer
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````