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

# Finalize a file upload

> <p>Confirm the bytes were uploaded; the file becomes available for use.</p>



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/indices/openapi.documented.yml post /v1beta/files/{file_id}/complete
openapi: 3.1.0
info:
  title: Indices API
  description: 'The Indices REST API. See docs for details: https://docs.indices.io'
  version: 0.0.1
servers:
  - url: https://api.indices.io
security:
  - ApiKeyAuth: []
tags:
  - name: Capture Sessions
    description: >-
      Record a browser session; a completed capture is a reusable input for
      building connectors.
  - name: Connectors
    description: Manage connectors.
  - name: Runs
    description: Execute a connector.
  - name: Secrets
    description: Manage secrets like login credentials and API keys.
paths:
  /v1beta/files/{file_id}/complete:
    post:
      tags:
        - Files
      summary: Finalize a file upload
      description: >-
        <p>Confirm the bytes were uploaded; the file becomes available for
        use.</p>
      operationId: completeFileUpload
      parameters:
        - name: file_id
          in: path
          required: true
          schema:
            type: string
            description: The ID of the pending file to finalize.
            title: File Id
          description: The ID of the pending file to finalize.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompleteFileUploadResponse'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Indices from 'indicesio';

            const client = new Indices({
              apiKey: process.env['INDICES_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.beta.files.finalize('file_id');

            console.log(response.file_id);
        - lang: Python
          source: |-
            import os
            from indices import Indices

            client = Indices(
                api_key=os.environ.get("INDICES_API_KEY"),  # This is the default and can be omitted
            )
            response = client.beta.files.finalize(
                "file_id",
            )
            print(response.file_id)
components:
  schemas:
    CompleteFileUploadResponse:
      properties:
        file_id:
          type: string
          description: ID of the finalized file.
        name:
          type: string
          description: User-facing filename.
        size_bytes:
          type: integer
          description: Size of the stored file in bytes, as reported by storage.
        content_type:
          type: string
          description: MIME type of the stored file.
        crc32c:
          type: string
          description: Base64-encoded CRC32C checksum reported by storage.
      type: object
      required:
        - file_id
        - name
        - size_bytes
        - content_type
        - crc32c
      title: CompleteFileUploadResponse
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Enter your API key as the bearer token. Set header: `Authorization` to
        `Bearer <api_key>`

````