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

# /v1/apps/{appId}/update

> This endpoint updates an application by its ID.

<Warning>
  This endpoint has a rate limit of 1 request every 3 seconds.
</Warning>


## OpenAPI

````yaml POST /v1/apps/{appId}/update
openapi: 3.1.0
info:
  title: CamposCloud API Documentation
  description: >-
    This documentation provides an overview of the CamposCloud API, including
    authentication, endpoints, and data structures. It is designed to help
    developers integrate with the CamposCloud platform effectively.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.camposcloud.com
security:
  - bearerAuth: []
paths:
  /v1/apps/{appId}/update:
    post:
      description: Updates an application by its ID
      parameters:
        - name: appId
          in: path
          required: true
          description: ID of the application to update
          schema:
            type: string
      requestBody:
        description: Application data to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateApplication'
        required: true
      responses:
        '200':
          description: Application updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationData'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Application not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    UpdateApplication:
      required:
        - appName
        - memoryMB
        - startupCommand
        - runtimeEnvironment
      type: object
      properties:
        appName:
          type: string
          description: The name of the application
          example: My Updated Application
        exposedViaWeb:
          type: boolean
          description: Indicates if the application is exposed via the web
          default: false
          example: false
        memoryMB:
          type: integer
          format: int32
          description: The amount of memory allocated to the application in MB
          example: 256
        autoRestartEnabled:
          type: boolean
          description: Indicates if auto-restart is enabled for the application
          default: false
          example: true
        startupCommand:
          type:
            - string
          description: The command used to start the application, null if not updated
          example: ''
        runtimeEnvironment:
          type:
            - string
          description: The runtime environment of the application, null if not updated
          example: null
          enum:
            - null
            - python
            - nodejs
    ApplicationData:
      type: object
      properties:
        _id:
          type: string
          description: The unique identifier of the application
          example: 60c72b2f9b1e8d001c8e4f3a
        containerId:
          type: string
          description: The unique identifier of the container
          example: da886ad3-88e9-4012-b893-130e87f6b747
        teamId:
          type:
            - string
            - 'null'
          description: The unique identifier of the team associated with the application
          example: 60c72b2f9b1e8d001c8e4f3b
        restartRequired:
          type: boolean
          description: Indicates if a restart is required for the application
          example: false
        name:
          type: string
          description: The name of the application
          example: My Application
        userId:
          type: string
          description: The unique identifier of the user who owns the application
          example: 60c72b2f9b1e8d001c8e4f3a
        allocatedMemoryMB:
          type: integer
          format: int32
          description: The amount of memory allocated to the application in MB
          example: 256
        allocatedVCpu:
          type: integer
          format: int32
          description: The number of virtual CPUs allocated to the application
          example: 8
        workerNodeId:
          type: object
          properties:
            _id:
              type: string
              description: The unique identifier of the worker node
              example: 60c72b2f9b1e8d001c8e4f3c
            nodeName:
              type: string
              description: The name of the worker node
              example: ODIN
        containerImage:
          type: string
          description: The Docker image used for the application
          example: kevencampos/camposcloud-python
        exposedViaWeb:
          type: boolean
          description: Indicates if the application is exposed via the web
          example: false
        startupCommand:
          type: string
          description: The command used to start the application
          example: python -u index.py
        installDependenciesCmd:
          type: string
          description: The command used to install dependencies for the application
          example: pip install -r requirements.txt
        runtimeEnvironment:
          type: string
          description: The runtime environment of the application
          example: python
        autoRestartEnabled:
          type: boolean
          description: Indicates if auto-restart is enabled for the application
          example: false
        status:
          type: string
          description: The current status of the application
          example: active
        currentResourceMetrics:
          type:
            - object
            - 'null'
          description: Current resource metrics of the application
          properties:
            timestamp:
              type: string
              format: date-time
              example: '2025-07-19T17:57:05.069Z'
              description: The timestamp when the metrics were recorded
            online:
              type: boolean
              example: true
              description: Indicates if the application is currently online
            uptime:
              type: integer
              format: int64
              example: 35980
              description: The uptime of the application in seconds
            cpuUsagePercent:
              type: number
              format: float
              example: 0
              description: The CPU usage of the application as a percentage (0-100)
            memoryUsageBytes:
              type: integer
              format: int64
              example: 43671552
              description: The memory usage of the application in bytes
            memoryLimitBytes:
              type: integer
              format: int64
              example: 268435456
              description: The memory limit of the application in bytes
            networkRxBytes:
              type: integer
              format: int64
              example: 228961
              description: >-
                The amount of data received by the application over the network
                in bytes
            networkTxBytes:
              type: integer
              format: int64
              example: 228190
              description: >-
                The amount of data sent by the application over the network in
                bytes
        environmentVariables:
          type: array
          description: List of environment variables set for the application
          items:
            type: object
            properties:
              key:
                type: string
                description: The name of the environment variable
                example: API_PORT
              value:
                type: string
                description: The value of the environment variable
                example: '3005'
              _id:
                type: string
                description: The unique identifier of the environment variable
                example: 60c72b2f9b1e8d001c8e4f3d
        createdAt:
          type: string
          format: date-time
          description: The date and time when the application was created
          example: '2025-07-19T00:02:54.455Z'
        updatedAt:
          type: string
          format: date-time
          description: The date and time when the application was last updated
          example: '2025-07-19T17:57:05.069Z'
        githubDeploys:
          type: array
          description: >-
            List of GitHub repositories connected to the application for
            deployment
          items:
            type: object
            properties:
              commitId:
                type: string
                description: The unique identifier of the GitHub deploy configuration
                example: c505366f3ba913044f65750ab7de60ccbb3d7b5f
              branch:
                type: string
                description: The branch of the GitHub repository that triggers deployments
                example: main
              status:
                type: string
                description: The status of the GitHub deploy configuration
                example: success
              message:
                type: string
                description: The commit message of the latest deployment
                example: first commit
              createdAt:
                type: string
                format: date-time
                description: >-
                  The date and time when the GitHub deploy configuration was
                  created
                example: '2025-07-19T17:57:05.069Z'
              commitedAt:
                type: string
                format: date-time
                description: >-
                  The date and time when the latest commit was made to the
                  connected GitHub repository
                example: '2025-07-19T17:57:05.069Z'
              commitedBy:
                type: string
                description: >-
                  The author of the latest commit to the connected GitHub
                  repository
                example: Keven Campos
              _id:
                type: string
                description: The unique identifier of the GitHub deploy configuration
                example: 60c72b2f9b1e8d001c8e4f3d
              duration:
                type: integer
                format: int64
                description: The duration of the latest deployment in seconds
                example: 120
        externalPort:
          type:
            - integer
            - 'null'
          description: >-
            The external port exposed by the application, null if the
            application is not exposed via the web
        assignedCustomDomain:
          type:
            - string
            - 'null'
          description: >-
            The custom domain assigned to the application, null if no custom
            domain is assigned
          example: myapp.domain.com
        repository:
          type:
            - object
            - 'null'
          description: >-
            The GitHub repository connected to the application for deployment,
            null if no repository is connected
          properties:
            name:
              type: string
              description: >-
                The name of the GitHub repository connected to the application
                for deployment
              example: my-awesome-repo
            owner:
              type: string
              description: >-
                The owner of the GitHub repository connected to the application
                for deployment
              example: KevenCampos
            id:
              type: string
              description: >-
                The unique identifier of the GitHub repository connected to the
                application for deployment
              example: '12345678923'
            branch:
              type: string
              description: The branch of the GitHub repository that triggers deployments
              example: main
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: string
          example: Not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````