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

# Upload a public workspace asset

> Uploads a file and creates a workspace-scoped Asset that can be used as a Hive Agent source.



## OpenAPI

````yaml /openapi.yaml post /v1/public/workspaces/{workspace_id}/assets
openapi: 3.0.1
info:
  title: Fetch Hive Public API
  version: v1
  description: Customer-facing Fetch Hive API endpoints for public API keys.
servers:
  - url: https://api.fetchhive.com
security: []
paths:
  /v1/public/workspaces/{workspace_id}/assets:
    parameters:
      - name: workspace_id
        in: path
        required: true
        description: Workspace UUID
        schema:
          type: string
          format: uuid
    post:
      tags:
        - Assets
      summary: Upload a public workspace asset
      description: >-
        Uploads a file and creates a workspace-scoped Asset that can be used as
        a Hive Agent source.
      parameters: []
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: string
              format: binary
        required: true
        description: The file to upload
      responses:
        '200':
          description: asset uploaded
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Asset uploaded successfully.
                  asset:
                    $ref: '#/components/schemas/asset_object'
                required:
                  - message
                  - asset
        '422':
          description: no file provided
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  error_code:
                    type: string
                    example: missing_required_field
                required:
                  - error
                  - message
                  - error_code
      security:
        - bearer_auth: []
components:
  schemas:
    asset_object:
      type: object
      properties:
        id:
          type: string
          format: uuid
        file_name:
          type: string
          example: image.png
        file_url:
          type: string
          example: https://cdn.fetchhive.com/image.png
        file_type:
          type: string
          example: image/png
        file_size:
          type: integer
          example: 204800
        asset_type:
          type: string
          example: image
        workspace_id:
          type: string
          format: uuid
          nullable: true
        uploaded_at:
          type: string
          format: date-time
        error_message:
          type: string
          nullable: true
      required:
        - id
        - file_name
        - file_url
        - asset_type
        - uploaded_at
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: 'Workspace API key sent as `Authorization: Bearer <api_key>`.'

````