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

# Count deployments

> Count deployments for an app or worker



## OpenAPI

````yaml https://api.getcargo.io/openapi.json post /hosting/deployments/count
openapi: 3.1.0
info:
  title: Cargo API
  version: 1.0.0
  description: Cargo Platform API v1
servers:
  - url: https://api.getcargo.io/v1
    description: Cargo API
security:
  - bearerAuth: []
paths:
  /hosting/deployments/count:
    post:
      tags:
        - Hosting - Deployments
      summary: Count deployments
      description: Count deployments for an app or worker
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                appUuid:
                  title: App UUID
                  description: Identifier of the app whose deployments to count.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
                workerUuid:
                  title: Worker UUID
                  description: Identifier of the worker whose deployments to count.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
                userUuid:
                  title: User UUID
                  description: Restrict to deployments created by this user.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
                statuses:
                  title: Statuses
                  description: Deployment statuses to include.
                  type: array
                  items:
                    type: string
                    enum:
                      - pending
                      - building
                      - success
                      - error
                      - cancelled
                createdAfter:
                  title: Created after
                  description: Include deployments created after this ISO timestamp.
                  type: string
                createdBefore:
                  title: Created before
                  description: Include deployments created before this ISO timestamp.
                  type: string
              title: Body
              description: Body schema.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                    title: Count
                    description: Number of deployments matching the filters.
                required:
                  - count
                additionalProperties: false
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '500':
          description: Internal server error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````