> ## 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}/redeploy

> This endpoint deploys the latest commit of the linked branch again.

> [!WARNING]
>
> This endpoint has a rate limit of 1 request every 3 seconds.


## OpenAPI

````yaml POST /v1/apps/{appId}/redeploy
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.
  version: 1.0.0
servers:
  - url: https://api.camposcloud.com
security:
  - bearerAuth: []
paths:
  /v1/apps/{appId}/redeploy:
    post:
      tags:
        - Applications
      description: >-
        Deploys the latest commit of the linked branch again, like the
        dashboard's redeploy button. The application needs a linked GitHub
        repository and its owner an active plan. On team applications it
        requires `canDeployApplication`.
      parameters:
        - name: appId
          in: path
          required: true
          description: ID of the application.
          schema:
            type: string
            pattern: ^[a-f0-9]{24}$
      responses:
        '202':
          description: The deploy was queued.
          content:
            application/json:
              schema:
                type: object
                properties:
                  deploy:
                    $ref: '#/components/schemas/GithubDeploy'
        '400':
          description: Invalid input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: The owner has no active plan.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not found, or you do not have access to it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: It cannot be done in the current state (see `error` and `code`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    GithubDeploy:
      type: object
      description: One deploy from GitHub, as listed in `githubDeploys` of an application.
      properties:
        _id:
          type: string
        commitId:
          type: string
        branch:
          type: string
        status:
          type: string
          enum:
            - pending
            - running
            - success
            - failed
            - skipped
        trigger:
          type: string
          enum:
            - push
            - manual
            - rollback
        message:
          type: string
        strategy:
          type: string
          enum:
            - recreate
            - zero-downtime
        createdAt:
          type: string
          format: date-time
    Error:
      type: object
      description: >-
        Every error returned by the API has this shape. `error` is a human
        readable message (in English or in Portuguese, depending on the
        endpoint). Many errors also carry `code`, a stable identifier to rely on
        in your code, and sometimes extra fields with details (for example
        `requestedMB` and `availableMB` with `PLAN_MEMORY_LIMIT`). Resources you
        have no relation to answer `404`, not `403`.
      required:
        - error
      properties:
        error:
          type: string
          description: Human readable description of the error.
          example: Application not found.
        code:
          type: string
          description: >-
            Stable, machine-readable identifier of the error. Present on many
            errors; compare against it instead of the message. Examples:
            `PLAN_MEMORY_LIMIT`, `APPLICATION_NOT_FOUND`, `DATABASE_NOT_FOUND`,
            `MAIN_FILE_INVALID`, `ENV_DUPLICATE_KEY`, `CUSTOM_DOMAIN_IN_USE`,
            `CUSTOM_DOMAIN_RESERVED`, `CUSTOM_DOMAIN_NOT_CLOUDFLARE`,
            `CUSTOM_DOMAIN_NO_PENDING`, `CUSTOM_DOMAIN_TXT_NOT_FOUND`.
          example: PLAN_MEMORY_LIMIT
  responses:
    Unauthorized:
      description: >-
        The `Authorization` header is missing or malformed, or the API token is
        invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid developer token
    Forbidden:
      description: You are not allowed to perform this action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: >-
              You do not have permission to perform this action on this
              application.
    TooManyRequests:
      description: >-
        A rate limit was exceeded. See the `RateLimit-*` and `Retry-After`
        response headers.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Too many requests, please try again later
    InternalError:
      description: >-
        Unexpected error. On endpoints that do not document a `400` for it, this
        is also returned when an ID in the URL is not a valid identifier.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Internal server error. Please try again later.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your CamposCloud API token, sent as `Authorization: Bearer <token>`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.