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

# Record a measured build

> What `apsio check` sends from CI: a build's sizes, measured there. The answer compares it with its baseline, always of the same app and format: `baseline_release` (and `baseline_build`) when given, else the last run recorded, on `base_branch` or `branch` when that has one, never of the same commit. Needs a project token with the checks:write scope, which holds no other scope and reads nothing. Runs are kept 400 days. The check warns and never blocks.



## OpenAPI

````yaml /api-reference/openapi.json post /projects/{projectId}/checks
openapi: 3.1.0
info:
  title: Apsio API
  version: 0.1.0
  description: >-
    Read API v0: your projects, release health and comparisons, missing symbols,
    issues, sessions, vitals, cohort comparisons, performance (app start,
    screens, hangs, MetricKit) and network endpoints and traces for one project.
    Authenticate with a project token as a bearer token, with an OAuth access
    token from Apsio's authorization server (MCP clients), or, from the console,
    with the session cookie of a member of the project's organization.
servers:
  - url: https://api.apsio.io/v1
security: []
paths:
  /projects/{projectId}/checks:
    post:
      tags:
        - Checks
      summary: Record a measured build
      description: >-
        What `apsio check` sends from CI: a build's sizes, measured there. The
        answer compares it with its baseline, always of the same app and format:
        `baseline_release` (and `baseline_build`) when given, else the last run
        recorded, on `base_branch` or `branch` when that has one, never of the
        same commit. Needs a project token with the checks:write scope, which
        holds no other scope and reads nothing. Runs are kept 400 days. The
        check warns and never blocks.
      parameters:
        - schema:
            type: string
            pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            example: 0192f3a4-0000-7000-8000-00000000a101
          required: true
          name: projectId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                app_id:
                  type: string
                  pattern: >-
                    ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                format:
                  type: string
                  enum:
                    - ipa
                    - apk
                    - aab
                  description: >-
                    The artefact measured. Only runs of one format are compared:
                    an .ipa or .aab is not what a user downloads, as the store
                    cuts each device's copy from it, so its sizes say how a
                    build changed, not what a user gets.
                release:
                  type: string
                  minLength: 1
                  maxLength: 128
                build:
                  type: string
                  minLength: 1
                  maxLength: 128
                commit_sha:
                  type: string
                  pattern: ^[0-9a-f]{7,64}$
                  example: 9b311d2
                branch:
                  type: string
                  minLength: 1
                  maxLength: 255
                binary_bytes:
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                install_bytes:
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                warn_percent:
                  type: number
                  exclusiveMinimum: 0
                  maximum: 1000
                  description: The rise that warns, in percent; 5 unless set.
                base_branch:
                  type: string
                  minLength: 1
                  maxLength: 255
                baseline_release:
                  type: string
                  minLength: 1
                  maxLength: 128
                baseline_build:
                  type: string
                  minLength: 1
                  maxLength: 128
              required:
                - app_id
                - format
                - release
                - binary_bytes
                - install_bytes
              additionalProperties: false
      responses:
        '201':
          description: Recorded, with its comparison.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckRun'
        '400':
          description: The request is not valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: No valid bearer token or console session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The credentials cannot read this project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: This project has no app with this id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: >-
            The project or its organization is being deleted (`erasing`):
            nothing more to read; do not retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Over a rate limit (the caller's, the client address's, or the
            plan's); Retry-After says when to retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Checks are not available here.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearer: []
components:
  schemas:
    CheckRun:
      allOf:
        - $ref: '#/components/schemas/CheckSizes'
        - type: object
          properties:
            app_id:
              type: string
              pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            format:
              type: string
              enum:
                - ipa
                - apk
                - aab
              description: >-
                The artefact measured. Only runs of one format are compared: an
                .ipa or .aab is not what a user downloads, as the store cuts
                each device's copy from it, so its sizes say how a build
                changed, not what a user gets.
            warn_percent:
              type: number
              description: The rise this run warns at, in percent.
            baseline:
              $ref: '#/components/schemas/CheckSizes'
            change:
              type:
                - object
                - 'null'
              properties:
                binary_bytes:
                  type: integer
                binary_percent:
                  type: number
                install_bytes:
                  type: integer
                install_percent:
                  type: number
                warning:
                  type: boolean
                  description: >-
                    Either size rose by `warn_percent` or more. A warning only:
                    nothing blocks.
              required:
                - binary_bytes
                - binary_percent
                - install_bytes
                - install_percent
                - warning
          required:
            - app_id
            - format
            - warn_percent
            - baseline
            - change
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: invalid_request
            message:
              type: string
            subject:
              type: string
              enum:
                - organization
                - project
              description: >-
                With `erasing` (410) only: what is being deleted, the
                organization or the project.
          required:
            - code
            - message
      required:
        - error
    CheckSizes:
      type:
        - object
        - 'null'
      properties:
        id:
          type: string
          pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
        release:
          type: string
          description: service.version
          example: 4.12.0
        build:
          type:
            - string
            - 'null'
        commit_sha:
          type:
            - string
            - 'null'
        branch:
          type:
            - string
            - 'null'
        binary_bytes:
          type: integer
          description: The artefact on disk, in bytes.
        install_bytes:
          type: integer
          description: The artefact's contents unpacked, in bytes.
        created_at:
          type: string
          description: RFC 3339 time in UTC.
      required:
        - id
        - release
        - build
        - commit_sha
        - branch
        - binary_bytes
        - install_bytes
        - created_at
      description: >-
        The earlier run of the same format it is compared with; null when there
        is none.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: >-
        A project token (apsio_pt_v0...), which reads exactly one project, or an
        OAuth access token issued for the API, which reads what its user can.
        Access tokens issued for Apsio's MCP server are accepted only from the
        MCP server itself.

````

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