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

# Create Shareable Asset

> Create a shareable asset. Public assets (the default) are viewable by anyone with the link; private assets are restricted to members of the owning account and stream via a signed, token-gated playback url. A file (or file segment) can have at most one active share per visibility — one public and one private — each with its own stable URL; creating a second of the same visibility returns 409.



## OpenAPI

````yaml POST /share
openapi: 3.0.0
info:
  title: Cloudglue API
  description: API for Cloudglue
  license:
    name: Apache License 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 0.7.8
servers:
  - url: https://api.cloudglue.dev/v1
security:
  - bearerAuth: []
paths:
  /share:
    post:
      tags:
        - Share
      summary: Create a shareable asset
      description: >-
        Create a shareable asset. Public assets (the default) are viewable by
        anyone with the link; private assets are restricted to members of the
        owning account and stream via a signed, token-gated playback url. A file
        (or file segment) can have at most one active share per visibility — one
        public and one private — each with its own stable URL; creating a second
        of the same visibility returns 409.
      operationId: createShareableAsset
      requestBody:
        description: Shareable asset creation request parameters
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateShareableAssetRequest'
        required: true
      responses:
        '200':
          description: Shareable asset created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareableAsset'
        '400':
          description: Invalid request parameters or configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: File or file segment not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Shareable asset already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: An unexpected error occurred on the server
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateShareableAssetRequest:
      type: object
      required:
        - file_id
      properties:
        file_id:
          type: string
          format: uuid
          description: The ID of the file the shareable asset will be created for
        file_segment_id:
          type: string
          format: uuid
          description: >-
            The ID of the file segment the shareable asset will be created for.
            When provided, the shareable asset will be created for the file
            segment.
        title:
          type: string
          description: The title of the shareable asset
        description:
          type: string
          description: The description of the shareable asset
        metadata:
          type: object
          description: The metadata of the shareable asset
        visibility:
          type: string
          enum:
            - public
            - private
          default: public
          description: >-
            Visibility of the shareable asset. Defaults to 'public'. 'private'
            restricts the share page to members of the owning account and serves
            a signed, token-gated stream. Cannot be changed after creation.
    ShareableAsset:
      type: object
      required:
        - id
        - file_id
        - url
        - created_at
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier of the shareable asset
        file_id:
          type: string
          format: uuid
          description: The ID of the file the shareable asset belongs to
        file_segment_id:
          type: string
          format: uuid
          description: The ID of the file segment the shareable asset belongs to (optional)
        title:
          type: string
          description: The title of the shareable asset
        description:
          type: string
          description: The description of the shareable asset
        metadata:
          type: object
          description: The metadata of the shareable asset
        visibility:
          type: string
          enum:
            - public
            - private
          description: >-
            The visibility of the shareable asset. 'public' assets are viewable
            by anyone with the link; 'private' assets are restricted to members
            of the owning account and stream via a signed, token-gated playback
            url.
        preview_url:
          type: string
          description: The thumbnail url of the shareable asset
        media_download_url:
          type: string
          description: >-
            The signed media download url of the shareable asset. For private
            assets this url is short-lived (a few minutes) and should be used
            promptly.
        media_download_expires_at:
          type: number
          nullable: true
          description: The timestamp of when the media download url will expire
        share_url:
          type: string
          description: >-
            This is the url that can be used to share the shareable asset. For
            private assets the page requires sign-in and membership of the
            owning account.
        stream_url:
          type: string
          description: >-
            The HLS stream url of the shareable asset. Available when the stream
            has finished processing. For private assets this is a signed,
            token-gated url that should be treated as short-lived.
        status:
          type: string
          enum:
            - pending
            - processing
            - completed
            - failed
          description: The status of the shareable asset
        asset_type:
          type: string
          enum:
            - file
            - file_segment
          description: The type of asset the shareable asset belongs to
        created_at:
          type: number
          description: The timestamp of when the shareable asset was created
        object:
          type: string
          enum:
            - share
          description: Object type, always 'share'
    Error:
      required:
        - error
      type: object
      properties:
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````