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

# Update Application Version API

> API endpoint to update the version of an existing application in Autonoma.



## OpenAPI

````yaml patch /application/{application_id}
openapi: 3.0.3
info:
  title: Autonoma API
  description: |
    API for managing test runs and test definitions in the Autonoma platform.

    **Important Note:** Media URLs (images, videos) expire after 1 hour.
  version: 1.0.0
  contact:
    name: Autonoma Support
servers:
  - url: https://autonoma.app/api
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /application/{application_id}:
    patch:
      summary: Update application version
      description: >-
        Create a new version of an existing application by uploading a new file
        or updating web application details
      parameters:
        - name: application_id
          in: path
          required: true
          description: The ID of the application to update
          schema:
            type: string
            example: cm7dbowr80042waka7thyjhkq
        - name: x-platform
          in: header
          required: true
          description: Application platform type
          schema:
            type: string
            enum:
              - android
              - ios
              - web
            example: android
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: Application file (APK for Android, ZIP for iOS)
                tag:
                  type: string
                  description: Version tag
                  enum:
                    - main
                    - staging
                    - other
                  example: staging
                cookies:
                  type: string
                  description: Optional cookies for web applications
                  example: session=xyz789
                version:
                  type: string
                  description: Version name (required for web applications)
                  example: 2.0.0
                path:
                  type: string
                  description: URL path (required for web applications)
                  example: https://myapp.com/v2
                geolocation:
                  type: string
                  description: JSON string containing geolocation data
                  example: '{"latitude": 40.7128, "longitude": -74.0060}'
                customID:
                  type: string
                  description: >-
                    Optional custom identifier for the version (e.g.,
                    "build-123", "release-v2.0")
                  example: build-123
            examples:
              update_android:
                summary: Update Android App
                description: Example of updating an Android application
                value:
                  file: '@/path/to/updated_app.apk'
                  tag: main
                  appName: My Android App v2.0
              update_ios:
                summary: Update iOS App
                description: Example of updating an iOS application
                value:
                  file: '@/Users/axel/Downloads/autonoma-bank-v2.zip'
                  tag: staging
                  appName: TestApiIOS v2.0
      responses:
        '200':
          description: Application version created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  application_version_id:
                    type: string
                    example: cm7dbowr80042waka7thyjhks
                  message:
                    type: string
                    example: App uploaded successfully
              examples:
                update_success:
                  summary: Successful update
                  value:
                    application_version_id: cm7dbowr80042waka7thyjhks
                    message: App version updated successfully
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidCredentialsError'
        '404':
          description: Application not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Internal Server Error
                  message:
                    type: string
                    example: Failed to create application version
      security:
        - ApiKeyAuth: []
          ApiSecretAuth: []
      x-codeSamples:
        - lang: curl
          label: Android
          source: >
            curl --location --request PATCH
            'https://autonoma.app/api/mobile/cm7dbowr80042waka7thyjhkq' \

            --header 'autonoma-client-id: YOUR_CLIENT_ID' \

            --header 'autonoma-client-secret: YOUR_CLIENT_SECRET' \

            --header 'x-platform: android' \

            --form 'file=@"/path/to/updated_app.apk"' \

            --form 'tag=main' \

            --form 'customID=build-456' \

            --form 'appName=My Android App v2.0'
        - lang: curl
          label: iOS
          source: >
            curl --location --request PATCH
            'https://autonoma.app/api/mobile/cm7dbowr80042waka7thyjhkq' \

            --header 'autonoma-client-id: YOUR_CLIENT_ID' \

            --header 'autonoma-client-secret: YOUR_CLIENT_SECRET' \

            --header 'x-platform: ios' \

            --form 'file=@"/Users/axel/Downloads/autonoma-bank-v2.zip"' \

            --form 'tag=staging' \

            --form 'customID=release-v2.1' \

            --form 'appName=TestApiIOS v2.0'
        - lang: javascript
          label: JavaScript Update
          source: |
            const formData = new FormData();
            formData.append('file', fileInput.files[0]);
            formData.append('tag', 'main');
            formData.append('customID', 'build-456');
            formData.append('appName', 'My App v2.0');

            fetch('https://autonoma.app/api/mobile/cm7dbowr80042waka7thyjhkq', {
              method: 'PATCH',
              headers: {
                'autonoma-client-id': 'YOUR_CLIENT_ID',
                'autonoma-client-secret': 'YOUR_CLIENT_SECRET',
                'x-platform': 'ios'
              },
              body: formData
            });
components:
  schemas:
    BadRequestError:
      type: object
      properties:
        error:
          type: string
          example: Bad Request
        message:
          type: string
          example: >-
            No applicationVersionID provided, and could not automatically
            determine an application from the tests within folder
            cmbsgljfr00fd060153r9x8ek. Please specify an applicationVersionID or
            ensure at least one test has an associated application.
    InvalidCredentialsError:
      type: object
      properties:
        error:
          type: string
          example: Unauthorized
        message:
          type: string
          example: Invalid authentication credentials
    NotFoundError:
      type: object
      properties:
        error:
          type: string
          example: Not found
        message:
          type: string
          example: Resource with id `cm8d9gt6v000c9fe5glmyi33u` not found
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: autonoma-client-id
      description: Client ID for authentication
    ApiSecretAuth:
      type: apiKey
      in: header
      name: autonoma-client-secret
      description: Client secret for authentication

````