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

# Get a file download URL

> Return a temporary download URL for a file the authenticated affiliate can access.

Returns a temporary download URL for a file the authenticated affiliate can access.


## OpenAPI

````yaml GET /public/file/{fileId}
openapi: 3.0.1
info:
  title: Commenda Public APIs
  description: >-
    APIs for Commenda entity management, partner incorporation, indirect tax,
    compliance, and corporate operations.
  license:
    name: NONE
    url: NONE
  version: 1.0.0
servers:
  - url: https://api.prod.commenda.io/api/v1
    description: Commenda platform APIs, including Partner Incorporation and Commenda OS.
  - url: https://transaction-tax.api.in.commenda.io/api/v1
    description: Global Indirect Tax API.
security:
  - bearerAuth: []
paths:
  /public/file/{fileId}:
    get:
      summary: Get a file download URL
      description: >-
        Return a temporary download URL for a file the authenticated affiliate
        can access.
      operationId: getAffiliateFileSignedUrl
      parameters:
        - name: fileId
          in: path
          required: true
          schema:
            type: integer
          description: File identifier returned by Commenda document APIs.
      responses:
        '200':
          description: Signed URL created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateFileSignedUrlResponse'
        '401':
          description: Missing or invalid affiliate API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliatePublicError'
        '403':
          description: File is not accessible to the affiliate
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliatePublicError'
        '404':
          description: File not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliatePublicError'
      security:
        - xApiKeyAuth: []
      servers:
        - url: https://api.prod.commenda.io/api/v1
components:
  schemas:
    AffiliateFileSignedUrlResponse:
      type: object
      required:
        - signedUrl
      properties:
        signedUrl:
          type: string
          format: uri
          description: Temporary signed download URL for the file.
          example: https://bucket.s3.amazonaws.com/file.pdf?X-Amz-Signature=example
    AffiliatePublicError:
      type: object
      required:
        - statusCode
        - message
        - error
      properties:
        statusCode:
          type: integer
          example: 403
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          example: Company does not belong to this affiliate firm
        error:
          type: string
          example: Forbidden
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    xApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````