openapi: 3.1.0
info:
  title: Happo API
  version: 1.0.0
  description: Public API for the Happo visual regression and accessibility regression testing platform.
servers:
  - url: https://happo.io
security:
  - basicAuth: []
  - bearerAuth: []
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: "Base64-encoded apiKey:apiSecret passed as an Authorization: Basic header."
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: "JWT token generated from apiKey and apiSecret, passed as an Authorization: Bearer header."
  schemas:
    Snapshot:
      type: object
      description: An object describing a screenshot of a certain component variant
      properties:
        url:
          type:
            - string
            - "null"
          description: URL of the screenshot image. It's important that the URL is deterministically generated based on the contents of the image. A hash function (like md5) is of good help here, so that two images that have the same bitmap content end up having the same URL.
        variant:
          type:
            - string
            - "null"
          description: The name of the variant (e.g. "disabled")
        target:
          type:
            - string
            - "null"
          description: The snapshot's target (e.g. "firefox", "iphone 7")
        component:
          type:
            - string
            - "null"
          description: The name of the component shown in the screenshot (e.g. "Button")
        width:
          type:
            - number
            - "null"
          description: The pixel width of the screenshot image
        height:
          type:
            - number
            - "null"
          description: The pixel height of the screenshot image
        id:
          type:
            - string
            - "null"
          description: A unique identifier for the snapshot
    SnapshotInfo:
      type: object
      description: An object with information about a screenshot image.
      properties:
        url:
          type: string
          description: URL leading to the screenshot image
        width:
          type:
            - number
            - "null"
          description: The pixel width of the screenshot image
        height:
          type:
            - number
            - "null"
          description: The pixel height of the screenshot image
      required:
        - url
        - width
        - height
    ReportStatus:
      type: object
      description: An object with useful properties for a report.
      properties:
        url:
          type:
            - string
            - "null"
          description: A URL leading to the report page
        completedAt:
          type:
            - string
            - "null"
          format: date-time
          description: (An ISO 8601 string) Present if all the partials for a report have been added. Null otherwise. If you're not using partial reports, this value is always present.
        createdAt:
          type:
            - string
            - "null"
          format: date-time
          description: (An ISO 8601 string) The timestamp for when the report was initially created.
        snapshotCount:
          type:
            - number
            - "null"
          description: The total number of snapshots included in the report
    IgnoredDiffDetails:
      type: object
      description: An object with details about why a diff was ignored.
      properties:
        byName:
          type:
            - string
            - "null"
          description: "The display name of the user who ignored the diff, or null when there is none to name: an automatic ignore, a flake reported with an API key, or one whose reporter has since deleted their profile (see `ignoredBy`)."
        byEmail:
          type:
            - string
            - "null"
          description: "The email of the user who ignored the diff, or null when there is none to name: an automatic ignore, a flake reported with an API key, or one whose reporter has since deleted their profile (see `ignoredBy`)."
        createdAt:
          type:
            - string
            - "null"
          format: date-time
          description: ISO 8601 timestamp for when the ignore was recorded.
        ignoredBy:
          type:
            - string
            - "null"
          description: "Who ignored the diff: `\"user\"` for a flake a person reported on the comparison page (even if they have since deleted their profile, and for any flake reported before Happo recorded where from), `\"api\"` for one reported through the API (with an API key, or signed in), `\"mcp\"` for one reported through the Happo MCP server, or `\"automated\"` for a diff Happo ignored itself, most often because the project's deep-compare thresholds (`compareThreshold` and `ignoreThreshold`) let it through."
        dataHappoHide:
          type:
            - boolean
            - "null"
          description: Present and true when the diff was automatically ignored because the element uses the `data-happo-hide` attribute.
        reason:
          type:
            - string
            - "null"
          description: "Present when Happo ignored the diff by itself for a reason other than its deep-compare thresholds (`compareThreshold` and `ignoreThreshold`). `antialiasing`: every pixel that differs is anti-aliasing, the smoothing along the edges of text and shapes. `identical`: the two images have the same pixels, and only their files differ."
        sourceComparison:
          type: object
          description: Present when the diff was ignored as a result of a reported flake. Contains `beforeSha`, `afterSha`, and `projectId` identifying the comparison that triggered the ignore.
    Comparison:
      type: object
      description: An object with useful properties describing the differences between two reports.
      properties:
        diffs:
          type: array
          items:
            type: array
            items:
              $ref: "#/components/schemas/Snapshot"
          description: A list of snapshots that are different. Each item in the array is a tuple/array with the before snapshot and the after snapshot.
        ignoredDiffs:
          type: array
          items:
            type: array
            prefixItems:
              - $ref: "#/components/schemas/Snapshot"
              - $ref: "#/components/schemas/Snapshot"
              - $ref: "#/components/schemas/IgnoredDiffDetails"
            minItems: 3
            maxItems: 3
          description: A list of diffs that were ignored. Each item in the array is a tuple/array with the before snapshot, the after snapshot, and details about why the diff was ignored.
        added:
          type: array
          items:
            $ref: "#/components/schemas/Snapshot"
          description: Snapshots that have been added
        deleted:
          type: array
          items:
            $ref: "#/components/schemas/Snapshot"
          description: Snapshots that have been removed
        unchanged:
          type: array
          items:
            $ref: "#/components/schemas/Snapshot"
          description: A list of identical snapshots
        summary:
          type:
            - string
            - "null"
          description: A summary of the results, with the most important information listed
        equal:
          type:
            - boolean
            - "null"
          description: True if the two reports are identical, false otherwise. Also false when an example in the after report failed to render and the comparison was created with `blockApproval.renderErrors`
        renderErrors:
          type:
            - number
            - "null"
          description: The number of examples in the after report that failed to render, and were reported as their error instead of a screenshot. A comparison with render errors cannot be approved when it was created with `blockApproval.renderErrors`. Only accounts with render errors reported as text turned on get these; for everyone else it is 0.
        status:
          type:
            - string
            - "null"
          description: Either "failure" or "success". If the two reports are equal, or a user has manually accepted the comparison, the value is "success". If the two reports are not equal, or a user has manually rejected the comparison, the value is "failure".
        compareUrl:
          type:
            - string
            - "null"
          description: A link to a happo report page
        statusImageUrl:
          type:
            - string
            - "null"
          description: A link to an image showing the status for the comparison
    ComparisonStatus:
      type: object
      description: An object with information about the status of a comparison.
      properties:
        sha1:
          type: string
          description: The id of the "before" report.
        sha2:
          type: string
          description: The id of the "after" report.
        status:
          type: string
          enum:
            - success
            - failure
            - needs review
          description: 'One of three values: "success" when the comparison is approved, "failure" when the comparison has been rejected or "needs review" when the comparison needs a review'
        url:
          type: string
          description: A URL leading to the comparison page
        createdAt:
          description: (An ISO 8601 string) The timestamp for when the comparison was initially created.
          anyOf:
            - type: string
              format: date-time
            - type: "null"
        diffs:
          type:
            - number
            - "null"
          description: The number of diffs in this comparison
        unchanged:
          type:
            - number
            - "null"
          description: The number of unchanged snapshots
        added:
          type:
            - number
            - "null"
          description: The number of added snapshots
        deleted:
          type:
            - number
            - "null"
          description: The number of deleted snapshots
        link:
          type:
            - string
            - "null"
          description: A URL leading to the PR/commit that triggered the comparison
        message:
          type:
            - string
            - "null"
          description: A description of the PR/commit that triggered the comparison
        project:
          type: string
          description: The name of the project that this comparison belongs to
        axeViolationsDelta:
          type:
            - number
            - "null"
          description: How many more accessibility violations the after report has than the before report (negative when it has fewer)
      required:
        - sha1
        - sha2
        - status
        - url
        - createdAt
        - diffs
        - unchanged
        - added
        - deleted
        - link
        - message
        - project
        - axeViolationsDelta
    Flake:
      type: object
      description: An object describing a reported flake.
      properties:
        project:
          type:
            - string
            - "null"
          description: The name of the project that this flake belongs to. Null for a flake carried over from an ignored diff that had no project.
        component:
          type: string
          description: The component name
        variant:
          type: string
          description: The variant name
        target:
          type: string
          description: The target name
        snapshots:
          type: array
          description: An array with the before and after snapshots, in that order
          items:
            $ref: "#/components/schemas/SnapshotInfo"
        comparison:
          description: Comparison status for the flake, if available
          anyOf:
            - $ref: "#/components/schemas/ComparisonStatus"
            - type: "null"
        user:
          description: The user who reported the flake. Null for a flake reported with an API key, or one whose reporter has since deleted their profile.
          anyOf:
            - type: object
              properties:
                displayName:
                  type:
                    - string
                    - "null"
                  description: The display name of the user
                email:
                  type: string
                  description: The email of the user
              required:
                - displayName
                - email
            - type: "null"
        reportedVia:
          description: 'Where the flake was reported: `"ui"` (the comparison page), `"api"` (the API, with an API key or signed in) or `"mcp"` (the Happo MCP server). `null` for a flake reported before Happo recorded this.'
          anyOf:
            - type: string
              enum:
                - ui
                - api
                - mcp
            - type: "null"
        createdAt:
          description: (An ISO 8601 string) The creation timestamp
          anyOf:
            - type: string
              format: date-time
            - type: "null"
        occurrenceCount:
          type: number
          description: The total number of times this flake has been detected across all comparisons
      required:
        - project
        - component
        - variant
        - target
        - snapshots
        - comparison
        - user
        - reportedVia
        - createdAt
        - occurrenceCount
    SkipResult:
      type: object
      description: What a skip did, when it was called with `ifNotStarted`.
      properties:
        posted:
          type: boolean
          description: Whether Happo posted a passing status. False when a Happo run had already started on the commit, which posts the status instead.
        reason:
          type: string
          description: Why nothing was posted, when nothing was.
      required:
        - posted
    Job:
      type: object
      description: A small object with basic properties for a job.
      properties:
        url:
          type: string
          description: A URL leading to the job page
        id:
          type: number
          description: A unique identifier for the job
      required:
        - url
        - id
    Usage:
      type: object
      description: Snapshots usage information
      properties:
        total:
          type:
            - number
            - "null"
          description: The number of snapshots used in a billing cycle
        quota:
          type:
            - number
            - "null"
          description: The number of snapshots included in the subscription (null for a plan without a limit)
    ProjectInfo:
      type: object
      description: A small object with basic properties for a project.
      properties:
        id:
          type: number
          description: A unique identifier for the project
        name:
          type: string
          description: The name of the project
      required:
        - id
        - name
    JobDetails:
      type: object
      description: An object with useful properties for a job.
      properties:
        id:
          type: number
          description: A unique identifier for the job
        createdAt:
          description: (An ISO 8601 string) The creation timestamp for the job
          anyOf:
            - type: string
              format: date-time
            - type: "null"
        finishedAt:
          description: (An ISO 8601 string) The timestamp when the job finished
          anyOf:
            - type: string
              format: date-time
            - type: "null"
        sha1:
          type: string
          description: The ID of the "before" report
        sha2:
          type: string
          description: The ID of the "after" report
        description:
          type: string
          description: A description of the status that the job has
        status:
          type: string
          description: Can be "failure", "success", or "pending"
        link:
          type:
            - string
            - "null"
          description: URL to the source of the job (e.g. PR URL).
        message:
          type:
            - string
            - "null"
          description: A short string describing the source of the job (e.g. PR title).
        url:
          type: string
          description: A URL leading to the job page
        projects:
          type: array
          description: A list of projects associated with the job
          items:
            $ref: "#/components/schemas/ProjectInfo"
      required:
        - id
        - createdAt
        - finishedAt
        - sha1
        - sha2
        - description
        - status
        - link
        - message
        - url
        - projects
    DeepCompareSettings:
      type: object
      description: An object with settings for deep compare.
      properties:
        diffAlgorithm:
          type:
            - string
            - "null"
          description: Algorithm to use for diff comparison. Must be "color-delta" or "ssim".
        compareThreshold:
          type:
            - number
            - "null"
          description: "With `color-delta`, the color delta threshold: how different two pixels may be before they count as changed. With `ssim`, the SSIM threshold: the images count as equal when their structural difference (1 minus the SSIM of the whole images) is below it. A float between 0 and 1."
        ignoreThreshold:
          type:
            - number
            - "null"
          description: "The pixel threshold, for the `color-delta` algorithm: the share of pixels in the image that may be above `compareThreshold` before the images count as different. E.g. a value of 0.01 means 1% of the pixels can be above `compareThreshold` (float between 0 and 1)."
        ignoreWhitespace:
          type:
            - boolean
            - "null"
          description: Whether to ignore whitespace in the diff. If true, whitespace differences will be ignored when comparing images.
        applyBlur:
          type:
            - boolean
            - "null"
          description: Whether to apply blur to the diff. This can be used to smooth out subtle differences that would otherwise be above `compareThreshold`.
    BlockApproval:
      type: object
      description: What keeps a comparison from being approved. Every attribute is optional, and leaving one out means it is not specified. Approving a blocked comparison is refused with a 409, and an approval carried over from an earlier comparison does not apply to it.
      properties:
        renderErrors:
          type:
            - boolean
            - "null"
          description: When true, the comparison cannot be approved while an example in the after report failed to render, whether the error is new or was already in the before report, and the comparison is never `equal`. Only has an effect for accounts with render errors reported as text turned on. When not specified, render errors do not block approval.
        accessibilityViolations:
          type:
            - boolean
            - "null"
          description: When true, the comparison cannot be approved while the after report has accessibility violations that the before report did not have. When not specified, new accessibility violations do not block approval.
        horizontalOverflow:
          type:
            - boolean
            - "null"
          description: When true, the comparison cannot be approved while a page in the after report scrolls sideways where it fit in the before report, or a snapshot only the after report has scrolls sideways. Only targets that set `detectHorizontalOverflow` measure it, and a before snapshot taken without it doesn't count as having fit. When not specified, pages that start to scroll sideways do not block approval.
        flakyAddedSnapshots:
          type:
            - boolean
            - "null"
          description: "When true, the comparison cannot be approved while a snapshot only the after report has is flaky: Happo renders each added snapshot again once the comparison is done, once as it was and once with the page's clock moved ahead, and this one came out different in a way a comparison would show as a diff. Approval also waits while that check is still running, for up to 30 minutes. A snapshot the check could not render again does not block. Only a comparison created with `isAsync: true` (as the happo package creates them) is checked: one created without it is not, and this blocks nothing for it. When not specified, flaky added snapshots do not block approval."
    AsyncComparison:
      type: object
      description: "An object returned when a comparison is created with `isAsync: true`. The comparison will be completed asynchronously in the background."
      properties:
        id:
          type:
            - number
            - "null"
          description: The id of the async comparison.
        statusImageUrl:
          type:
            - string
            - "null"
          description: A URL to an SVG image showing the current status of the comparison.
        compareUrl:
          type:
            - string
            - "null"
          description: A URL to the comparison page.
  responses:
    Error401:
      description: Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
      content:
        text/plain:
          schema:
            type: string
paths:
  /api/reports/{sha}:
    post:
      operationId: createReport
      summary: Create report
      security:
        - basicAuth: []
        - bearerAuth: []
      description: Uploads a list of snapshots for a certain identifier (usually a commit sha). If there is an existing report for the same sha, it will be overwritten as a result of calling this endpoint, unless you're posting partial reports.
      parameters:
        - name: sha
          in: path
          required: true
          description: The id of the report.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                snaps:
                  type: array
                  description: A list of snapshot objects associated with the report
                  items:
                    $ref: "#/components/schemas/Snapshot"
                project:
                  type: string
                  description: The identifying name of the project this report should belong to. If none is specified, the default project will be used.
                link:
                  type: string
                  description: URL to the source of the report (e.g. PR URL).
                message:
                  type: string
                  description: A short string describing the source of the report (e.g. PR title).
                partial:
                  type: boolean
                  description: Set this to true to amend the report instead of overwriting it. This is useful if you are running multiple processes for the same sha. Remember to call the Complete Report endpoint once you are done uploading all the partials, otherwise the report will never be fully constructed and useful.
              required:
                - snaps
      responses:
        "200":
          description: An object containing a url where the uploaded report can be accessed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReportStatus"
        "400":
          description: The snapshot data is invalid (e.g. missing required fields), or the report has been archived and can no longer be modified.
          content:
            text/plain:
              schema:
                type: string
        "401":
          $ref: "#/components/responses/Error401"
    get:
      operationId: getReport
      summary: Get report
      security:
        - basicAuth: []
        - bearerAuth: []
      description: Gets a list of snapshots for a certain identifier (usually a commit sha).
      parameters:
        - name: sha
          in: path
          required: true
          description: The id of the report.
          schema:
            type: string
        - name: project
          in: query
          required: false
          description: The identifying name of the project this report belongs to. If none is specified, the default project will be assumed.
          schema:
            type: string
      responses:
        "200":
          description: A list of snapshots associated with this sha.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Snapshot"
        "401":
          $ref: "#/components/responses/Error401"
        "404":
          description: No report found for the given sha and project.
          content:
            text/plain:
              schema:
                type: string
  /api/reports/{sha}/status:
    get:
      operationId: getReportStatus
      summary: Get report status
      security:
        - basicAuth: []
        - bearerAuth: []
      description: |-
        Gets some metadata about a report.

        To fetch status for multiple projects in one request, pass a comma-separated list of project names in the `projects` query parameter:

        ```
        GET /api/reports/abc123/status?projects=web,mobile,ios
        ```

        The response is an array with one entry per project, in the same order as the input. If no report exists for a given project the entry will contain an `error` field instead of the usual status fields:

        ```json
        [
          {
            "project": "web",
            "url": "https://happo.io/a/1/p/2/report/abc123",
            "snapshotCount": 42,
            "completedAt": "2024-01-15T10:30:00.000Z",
            "createdAt": "2024-01-15T10:00:00.000Z"
          },
          {
            "project": "mobile",
            "error": "report not found"
          },
          {
            "project": "ios",
            "url": "https://happo.io/a/1/p/4/report/abc123",
            "snapshotCount": 18,
            "completedAt": "2024-01-15T10:45:00.000Z",
            "createdAt": "2024-01-15T10:05:00.000Z"
          }
        ]
        ```
      parameters:
        - name: sha
          in: path
          required: true
          description: The id of the report.
          schema:
            type: string
        - name: project
          in: query
          required: false
          description: The identifying name of the project this report belongs to. If none is specified, the default project will be assumed. Cannot be combined with "projects".
          schema:
            type: string
        - name: projects
          in: query
          required: false
          description: Comma-separated list of project names to fetch status for (e.g. "web,mobile,ios"). When provided, the response will be an array of ReportStatus objects, each including a "project" field. If no report exists for a project, that item will include an "error" field instead. Cannot be combined with "project".
          schema:
            type: string
      responses:
        "200":
          description: A ReportStatus object, or an array of ReportStatus objects when "projects" is used. Each array item includes a "project" field identifying the project, and an "error" field if no report was found for that project.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/ReportStatus"
                  - type: array
                    items:
                      $ref: "#/components/schemas/ReportStatus"
        "400":
          description: Both `project` and `projects` were specified (they are mutually exclusive), or `projects` is not a valid comma-separated string.
          content:
            text/plain:
              schema:
                type: string
        "401":
          $ref: "#/components/responses/Error401"
        "404":
          description: No report found for the given sha and project. Only returned when using the `project` parameter — when using `projects`, missing reports appear as `{ project, error }` items in the 200 response array instead.
          content:
            text/plain:
              schema:
                type: string
  /api/reports/{sha}/complete:
    post:
      operationId: completeReport
      summary: Complete a report
      security:
        - basicAuth: []
        - bearerAuth: []
      description: When you're uploading partial reports (via the Create Report endpoint), you need to use this endpoint to signal that all the partials have been added and that the report is complete.
      parameters:
        - name: sha
          in: path
          required: true
          description: The id of the report.
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                project:
                  type: string
                  description: The identifying name of the project the reports belong to. If none is specified, the default project will be assumed. Cannot be combined with "projects".
                projects:
                  type: array
                  description: An array of project names to complete in a single request. When provided, the response will be an array of ReportStatus objects, each including a "project" field. Cannot be combined with "project".
                  items:
                    type: string
      responses:
        "200":
          description: A ReportStatus object, or an array of ReportStatus objects when "projects" is used. Each array item includes a "project" field identifying the project, and an "error" field if completion failed for that project.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/ReportStatus"
                  - type: array
                    items:
                      $ref: "#/components/schemas/ReportStatus"
        "400":
          description: Both `project` and `projects` were specified (they are mutually exclusive), or `projects` is not an array.
          content:
            text/plain:
              schema:
                type: string
        "401":
          $ref: "#/components/responses/Error401"
        "404":
          description: No partial report found to complete. Only returned when using the `project` parameter — when using `projects`, failures appear as `{ project, error }` items in the 200 response array instead.
          content:
            text/plain:
              schema:
                type: string
  /api/reports/{sha1}/compare/{sha2}:
    post:
      operationId: compareReports
      summary: Compare reports
      security:
        - basicAuth: []
        - bearerAuth: []
      description: Compare reports and get useful information on the possible differences.
      parameters:
        - name: sha1
          in: path
          required: true
          description: The id of the "before" report.
          schema:
            type: string
        - name: sha2
          in: path
          required: true
          description: The id of the "after" report.
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                project:
                  type: string
                  description: The identifying name of the project the reports belong to. If none is specified, the default project will be assumed. Cannot be combined with "projects".
                projects:
                  type: array
                  description: An array of project names to compare in a single request. When provided, the response will be an array of Comparison objects, each including a "project" field. If a comparison fails for an individual project (e.g. no report exists for that sha), that item will include an "error" field instead of comparison data — the other projects in the array are unaffected. Cannot be combined with "project".
                  items:
                    type: string
                link:
                  type: string
                  description: URL to the source of the report (e.g. PR URL).
                message:
                  type: string
                  description: A short string describing the source of the report (e.g. PR title).
                notify:
                  type: string
                  description: An email address, or a list of comma-separated email addresses that you want to notify with the results of the comparison.
                isAsync:
                  type: boolean
                  description: Set this option to `true` to make calls return immediately, without waiting for comparison results. You'll have to rely on the build status for the results. Using this option will also allow you to schedule future comparisons on reports that are currently being processed.
                fallbackShas:
                  type: array
                  description: Provide a list of shas/report identifiers that the comparison is allowed to fall back to, if the `sha1` param isn't matching any reports. The order of this list matters -- put the most desirable fallback first in the list.
                  items:
                    type: string
                deepCompare:
                  $ref: "#/components/schemas/DeepCompareSettings"
                  description: Override project deep compare settings for this comparison. When provided, these settings override any settings on the project.
                blockApproval:
                  $ref: "#/components/schemas/BlockApproval"
                  description: What keeps this comparison from being approved. The `happo` library sends its `blockApproval` config option here. It applies to this comparison only, and replaces what an earlier request for the same two reports set.
      responses:
        "200":
          description: 'When `isAsync` is false (default): a Comparison object, or an array of Comparison objects when "projects" is used. When `isAsync` is true: an AsyncComparison object, or an array of AsyncComparison objects when "projects" is used. Each array item includes a "project" field identifying the project, and an "error" field if the comparison failed for that project.'
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/Comparison"
                  - $ref: "#/components/schemas/AsyncComparison"
                  - type: array
                    items:
                      $ref: "#/components/schemas/Comparison"
                  - type: array
                    items:
                      $ref: "#/components/schemas/AsyncComparison"
        "400":
          description: Both `project` and `projects` were specified (they are mutually exclusive), `projects` is not an array, or another validation error occurred. When using `projects`, per-project failures are returned as `{ project, error }` items in the 200 response array rather than as a 400 status.
          content:
            text/plain:
              schema:
                type: string
        "401":
          $ref: "#/components/responses/Error401"
  /api/reports/{sha1}/compare/{sha2}/status:
    get:
      operationId: getComparisonStatus
      summary: Get comparison status
      security:
        - basicAuth: []
        - bearerAuth: []
      description: |-
        Get the comparison status between two reports. This endpoint can be used after the "Compare two reports" endpoint has been used, to check for the current resolution status.

        An async comparison (`isAsync: true`) can compare with another "before" report than `sha1`: the report the "after" report extends, or a fallback or earlier commit when `sha1` has no report. Asked for with `sha1`, this endpoint answers with that comparison, whose `sha1` is the report it compared with. Until an async comparison is done, it answers 404.
      parameters:
        - name: sha1
          in: path
          required: true
          description: The id of the "before" report.
          schema:
            type: string
        - name: sha2
          in: path
          required: true
          description: The id of the "after" report.
          schema:
            type: string
        - name: project
          in: query
          required: false
          description: The identifying name of the project the reports belong to. If none is specified, the default project will be assumed.
          schema:
            type: string
      responses:
        "200":
          description: An object with the current comparison status
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ComparisonStatus"
        "401":
          $ref: "#/components/responses/Error401"
        "404":
          description: No comparison found for the given sha pair and project, or an async comparison of them that is not done yet.
          content:
            text/plain:
              schema:
                type: string
  /api/reports/{sha1}/compare/{sha2}/resolve:
    post:
      operationId: resolveComparison
      summary: Resolve comparison
      security:
        - basicAuth: []
        - bearerAuth: []
      description: |-
        Approve or reject the comparison between two reports, the same way a reviewer does from the Happo comparison page. The resolution isn't attributed to a Happo user. If the comparison is linked to a pull request, its Happo status check is updated too.

        Pull request tokens can't be used with this endpoint. On an account that only lets selected users review, the request has to come from one of those reviewers: an API key one of them created, or their own Google IAP identity.
      parameters:
        - name: sha1
          in: path
          required: true
          description: The id of the "before" report.
          schema:
            type: string
        - name: sha2
          in: path
          required: true
          description: The id of the "after" report.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                resolution:
                  type: string
                  enum:
                    - success
                    - failure
                  description: Either "success" (approve the comparison) or "failure" (reject it).
                project:
                  type:
                    - string
                    - "null"
                  description: The identifying name of the project the reports belong to. If none is specified, the default project will be assumed.
              required:
                - resolution
      responses:
        "200":
          description: An object with the updated comparison status
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ComparisonStatus"
        "400":
          description: "`resolution` is missing or not one of the allowed values, or `project` is not a string."
          content:
            text/plain:
              schema:
                type: string
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          description: The request was authenticated with a pull request token, or the account only lets selected users review and the API key was not created by one of them.
          content:
            text/plain:
              schema:
                type: string
        "404":
          description: No project with the given name, or no comparison found for the given sha pair and project.
          content:
            text/plain:
              schema:
                type: string
        "409":
          description: "The comparison cannot be approved because of what its `blockApproval` holds against it: examples in the after report failed to render, the after report introduces new accessibility violations, pages start to scroll sideways, or added snapshots are flaky or still being checked for flakes. Rejecting is still allowed."
          content:
            text/plain:
              schema:
                type: string
  /api/reports/{sha1}/compare/{sha2}/results:
    get:
      operationId: getComparisonResults
      summary: Get comparison results
      security:
        - basicAuth: []
        - bearerAuth: []
      description: |-
        Get the full comparison results between two reports, including all snapshots grouped by their status: diffs, added, deleted, unchanged, and ignored diffs.

        This endpoint is useful for programmatically reviewing visual changes — for example, to enable AI agents to inspect diffs for pull requests they are opening.

        To look up results using a Happo comparison URL (`/a/{accountId}/p/{projectId}/compare/{sha1}/{sha2}`), extract the `sha1` and `sha2` path segments and use them as the path parameters here.
      parameters:
        - name: sha1
          in: path
          required: true
          description: The id of the "before" report.
          schema:
            type: string
        - name: sha2
          in: path
          required: true
          description: The id of the "after" report.
          schema:
            type: string
        - name: project
          in: query
          required: false
          description: The identifying name of the project the reports belong to. If none is specified, the default project will be assumed.
          schema:
            type: string
      responses:
        "200":
          description: A Comparison object with full snapshot data for all diffs, added, deleted, unchanged, and ignored diffs.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Comparison"
        "401":
          $ref: "#/components/responses/Error401"
        "404":
          description: No comparison found for the given sha pair and project.
          content:
            text/plain:
              schema:
                type: string
  /api/reports/{sha}/comparison-statuses:
    get:
      operationId: getComparisonStatuses
      summary: Get comparison statuses
      security:
        - basicAuth: []
        - bearerAuth: []
      description: Get all comparison statuses for a sha. The response will contain a list of comparison statuses where the report is either the "before" report or the "after" report.
      parameters:
        - name: sha
          in: path
          required: true
          description: The id of a report.
          schema:
            type: string
        - name: project
          in: query
          required: false
          description: The identifying name of the project the reports belong to. If none is specified, the default project will be assumed.
          schema:
            type: string
      responses:
        "200":
          description: A list of comparison statuses for the :sha
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/ComparisonStatus"
        "401":
          $ref: "#/components/responses/Error401"
  /api/flake:
    get:
      operationId: getFlakes
      summary: Get flakes
      security:
        - basicAuth: []
        - bearerAuth: []
      description: Get a list of reported flakes for the current account, optionally filtered by project, component, variant, target, or sha.
      parameters:
        - name: project
          in: query
          required: false
          description: The identifying name of the project to filter flakes for. If omitted, flakes for all projects are returned.
          schema:
            type: string
        - name: limit
          in: query
          required: false
          description: Default 100. Controls how many items are returned. Max is 1000.
          schema:
            type: number
        - name: page
          in: query
          required: false
          description: Page number for pagination. First page is 1.
          schema:
            type: number
        - name: component
          in: query
          required: false
          description: Filter flakes by component name.
          schema:
            type: string
        - name: variant
          in: query
          required: false
          description: Filter flakes by variant name.
          schema:
            type: string
        - name: target
          in: query
          required: false
          description: Filter flakes by target name.
          schema:
            type: string
        - name: sha
          in: query
          required: false
          description: Filter flakes by comparisons that include this sha as before or after.
          schema:
            type: string
      responses:
        "200":
          description: A list of reported flakes
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Flake"
        "401":
          $ref: "#/components/responses/Error401"
  /api/comparisons:
    get:
      operationId: getComparisons
      summary: Get comparisons
      security:
        - basicAuth: []
        - bearerAuth: []
      description: Get comparisons from your account.
      parameters:
        - name: from
          in: query
          required: false
          description: (An ISO 8601 string) Get comparisons created after this timestamp.
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          required: false
          description: (An ISO 8601 string) Get comparisons created before this timestamp.
          schema:
            type: string
            format: date-time
        - name: limit
          in: query
          required: false
          description: Default 10. Controls how many items are returned.
          schema:
            type: number
        - name: project
          in: query
          required: false
          description: The name of the project to return comparisons for. If left out, comparisons for all projects will be returned.
          schema:
            type: string
      responses:
        "200":
          description: A list of comparison statuses
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/ComparisonStatus"
        "401":
          $ref: "#/components/responses/Error401"
  /api/jobs/{sha1}/{sha2}/orchestrate:
    post:
      operationId: orchestrate
      summary: Create orchestration job
      security:
        - basicAuth: []
        - bearerAuth: []
      description: Tell Happo that you are about to run multiple comparisons between two shas. A special report will be created and a single, combined build status will be posted to GitHub.
      parameters:
        - name: sha1
          in: path
          required: true
          description: The id of the "before" report.
          schema:
            type: string
        - name: sha2
          in: path
          required: true
          description: The id of the "after" report.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                projects:
                  type: array
                  description: A list of projects (identifying names) that you want to be part of the job.
                  items:
                    type: string
                link:
                  type: string
                  description: URL to the source of the orchestration job (e.g. PR URL).
                message:
                  type: string
                  description: A short string describing the source of the job (e.g. PR title).
              required:
                - projects
      responses:
        "200":
          description: An object with details about the job that was created/found.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Job"
        "400":
          description: "`projects` must be an array."
          content:
            text/plain:
              schema:
                type: string
        "401":
          $ref: "#/components/responses/Error401"
  /api/jobs/{sha1}/{sha2}:
    post:
      operationId: createJob
      summary: Create job
      security:
        - basicAuth: []
        - bearerAuth: []
      description: |-
        Tell Happo that you are about to run a comparison between two shas. A job will either be created (when no orchestration job exists for the same shas) or reused (when an orchestration job exists for the shas).

        When you pass a `group`, every project for the same shas joins one job instead, without an orchestration call, and the job posts one status check per group: `Happo` for the default group (`true`), and `Happo (<group>)` for a named one.
      parameters:
        - name: sha1
          in: path
          required: true
          description: The id of the "before" report.
          schema:
            type: string
        - name: sha2
          in: path
          required: true
          description: The id of the "after" report.
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                project:
                  type: string
                  description: The project (identifying name) which this job is running for. Leave empty to use the default project.
                projects:
                  type: array
                  description: Pass an array of project names to create multiple jobs in one go. If orchestration is used, only one job will be created. If multiple jobs are created, the response will be an array of jobs.
                  items:
                    type: string
                group:
                  type:
                    - boolean
                    - string
                  description: "The status check group the project reports to: `true` for the default group, which posts the `Happo` status check, or a name for a group of its own, `Happo (<group>)`. Leave empty (or pass `false`) to get a job of its own for the project, as before groups existed."
                link:
                  type: string
                  description: URL to the source of the job (e.g. PR URL).
                message:
                  type: string
                  description: A short string describing the source of the job (e.g. PR title).
      responses:
        "200":
          description: A Job object, or an array of Job objects when "projects" is used.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/Job"
                  - type: array
                    items:
                      $ref: "#/components/schemas/Job"
        "401":
          $ref: "#/components/responses/Error401"
  /api/jobs/{sha1}/{sha2}/cancel:
    post:
      operationId: cancelJob
      summary: Cancel job
      security:
        - basicAuth: []
        - bearerAuth: []
      description: |-
        Tell Happo that a job comparing two shas had to be cancelled for some reason. It might have been cancelled in CI or failed in some other way. When you're using orchestrated jobs, this can help prevent orchestrated jobs getting in an infinite "pending" state.

        If the job is successfully cancelled, this endpoint will return a 204 No Content response.

        If no job is found for the given SHA pair, this endpoint will return a 404 Not Found response.

        If the job has already been completed, this endpoint will return a 409 Conflict response. This is expected behavior when the job has already finished processing.
      parameters:
        - name: sha1
          in: path
          required: true
          description: The id of the "before" report.
          schema:
            type: string
        - name: sha2
          in: path
          required: true
          description: The id of the "after" report.
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                project:
                  type: string
                  description: The project (identifying name) which this job is running for. Leave empty to use the default project.
                status:
                  type: string
                  description: Either "failure" or "success". This will control what status will be posted to GitHub. The default is "failure".
                link:
                  type: string
                  description: URL to the source of the report (e.g. PR URL).
                message:
                  type: string
                  description: A description of why the job was cancelled, e.g. "Cancelled in CI"
      responses:
        "204":
          description: No content
        "401":
          $ref: "#/components/responses/Error401"
        "404":
          description: No job found for the given sha pair and project.
          content:
            text/plain:
              schema:
                type: string
        "409":
          description: The job has already been completed and cannot be cancelled. This is expected when the job has already finished processing.
          content:
            text/plain:
              schema:
                type: string
  /api/jobs:
    get:
      operationId: getJobs
      summary: Get jobs
      security:
        - basicAuth: []
        - bearerAuth: []
      description: Get jobs from your account. A job encompasses creating a report and comparing that report with a previous report. Jobs can be automatically created (if you e.g. use any of the happo-ci* scripts) or manually via the API.
      parameters:
        - name: from
          in: query
          required: false
          description: (An ISO 8601 string) Get jobs created after this timestamp.
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          required: false
          description: (An ISO 8601 string) Get jobs created before this timestamp.
          schema:
            type: string
            format: date-time
        - name: limit
          in: query
          required: false
          description: Default 10. Controls how many items are returned. Max is 100 -- if you specify a larger number you will still get at most 100 back.
          schema:
            type: number
      responses:
        "200":
          description: A list of jobs
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/JobDetails"
        "401":
          $ref: "#/components/responses/Error401"
  /api/jobs/{id}:
    get:
      operationId: getJob
      summary: Get job
      security:
        - basicAuth: []
        - bearerAuth: []
      description: Get a job by its ID
      parameters:
        - name: id
          in: path
          required: true
          description: The ID of the job
          schema:
            type: number
      responses:
        "200":
          description: Details about the job
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/JobDetails"
        "401":
          $ref: "#/components/responses/Error401"
        "404":
          description: No job found with the given ID.
          content:
            text/plain:
              schema:
                type: string
  /api/ignored-diffs:
    post:
      operationId: ignoreDiff
      summary: Ignore diff
      security:
        - basicAuth: []
        - bearerAuth: []
      description: |-
        Use this endpoint to mark a diff between two snapshots as ignored. The snapshotId1/snapshotId2 params need to correspond to `id`s from Snapshot objects.

        An ignored diff counts as accepted in every comparison that contains it. On an account that only lets selected users review, the request has to come from one of those reviewers: an API key one of them created, or their own Google IAP identity.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                snapshot1Id:
                  type: string
                  description: A snapshot id
                snapshot2Id:
                  type: string
                  description: A snapshot id
                project:
                  type: string
                  description: The name of the project to ignore the diff for. If omitted, the project will be looked up in the database. Providing a project name is more efficient.
              required:
                - snapshot1Id
                - snapshot2Id
      responses:
        "200":
          description: An empty object.
          content:
            application/json:
              schema:
                type: object
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          description: The account only lets selected users review, and the request did not come from one of them (or from an API key one of them created).
          content:
            text/plain:
              schema:
                type: string
        "404":
          description: One or both snapshot IDs do not match any known snapshot.
          content:
            text/plain:
              schema:
                type: string
    delete:
      operationId: deleteIgnoredDiff
      summary: Delete ignored diff
      security:
        - basicAuth: []
        - bearerAuth: []
      description: |-
        Use this endpoint to remove an ignored diff between two snapshots. The snapshot1Id/snapshot2Id params need to correspond to `id`s from Snapshot objects.

        On an account that only lets selected users review, the request has to come from one of those reviewers: an API key one of them created, or their own Google IAP identity.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                snapshot1Id:
                  type: string
                  description: A snapshot id
                snapshot2Id:
                  type: string
                  description: A snapshot id
              required:
                - snapshot1Id
                - snapshot2Id
      responses:
        "204":
          description: No content
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          description: The account only lets selected users review, and the request did not come from one of them (or from an API key one of them created).
          content:
            text/plain:
              schema:
                type: string
        "404":
          description: One or both snapshot IDs were not provided or do not match any known ignored diff.
          content:
            text/plain:
              schema:
                type: string
  /api/subscriptions/{component}:
    post:
      operationId: addSubscriptions
      summary: Add component subscriptions
      security:
        - basicAuth: []
        - bearerAuth: []
      description: Add subscribers (email addresses) to a specific UI component. When a diff is found in a component, subscribers are notified with a link to the Happo comparison. Users can themselves unsubscribe manually. If you try adding an email address that has been unsubscribed by the user, it will be ignored and the user will continue to be unsubscribed.
      parameters:
        - name: component
          in: path
          required: true
          description: The name of a component. Should match component names that are in the reports.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                emailAddresses:
                  type: array
                  description: A list of email addresses to add as subscribers.
                  items:
                    type: string
              required:
                - emailAddresses
      responses:
        "204":
          description: No content
        "400":
          description: "`emailAddresses` is missing or contains invalid email addresses."
          content:
            text/plain:
              schema:
                type: string
        "401":
          $ref: "#/components/responses/Error401"
    delete:
      operationId: removeSubscriptions
      summary: Remove component subscriptions
      security:
        - basicAuth: []
        - bearerAuth: []
      description: Remove subscribers for a specific UI component.
      parameters:
        - name: component
          in: path
          required: true
          description: The name of a component. Should match component names that are in the reports.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                emailAddresses:
                  type: array
                  description: A list of email addresses to remove subscriptions for.
                  items:
                    type: string
              required:
                - emailAddresses
      responses:
        "204":
          description: No content
        "401":
          $ref: "#/components/responses/Error401"
  /api/components/{component}/{variant}/{target}:
    get:
      operationId: snapshot
      summary: Get snapshot
      security:
        - basicAuth: []
        - bearerAuth: []
      description: Get the latest snapshot for a component variant.
      parameters:
        - name: component
          in: path
          required: true
          description: The name of a component. Should match component names that are in the reports.
          schema:
            type: string
        - name: variant
          in: path
          required: true
          description: The name of the variant. Should match variant names that are in the reports.
          schema:
            type: string
        - name: target
          in: path
          required: true
          description: The target of the snapshot. Should match target names that are in the reports.
          schema:
            type: string
        - name: project
          in: query
          required: false
          description: The identifying name of the project this report belongs to. If none is specified, the default project will be assumed.
          schema:
            type: string
      responses:
        "200":
          description: An object with details about the snapshot.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Snapshot"
        "401":
          $ref: "#/components/responses/Error401"
        "404":
          description: No snapshot found for the given component, variant, and target.
          content:
            text/plain:
              schema:
                type: string
  /api/skip/{sha}:
    post:
      operationId: skip
      summary: Skip report
      security:
        - basicAuth: []
        - bearerAuth: []
      description: |-
        Tells Happo to skip running for a certain commit SHA. This is useful if you have Happo configured as a required check for your PRs but want to avoid running Happo tests (e.g. because no UI code changed). The given SHA must be present in your origin repo (e.g. on GitHub) before calling this endpoint. Calling this endpoint will post a successful build status to the PR/commit.

        If the skip is successful, this endpoint will return a 204 status code, or with `ifNotStarted`, a 200 with `{ "posted": true }`, or `{ "posted": false, "reason": "…" }` when a run had already started. If the SHA is not present in the origin repo, the call will fail with a 404 error.

        Without `ifNotStarted`, a project that already has a Happo run on the commit is taken out of that run.

        Example, in the CI step that decides not to run Happo:

        ```sh
        curl --fail-with-body --silent --show-error \
          -u "$HAPPO_API_KEY:$HAPPO_API_SECRET" \
          --json '{"project": "components", "group": true, "ifNotStarted": true}' \
          "https://happo.io/api/skip/$HEAD_SHA"
        ```
      parameters:
        - name: sha
          in: path
          required: true
          description: The SHA of the commit to skip. This must be the full SHA, not a partial SHA.
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                project:
                  type: string
                  description: The identifying name of the project associated with the call (default is the default project for the account).
                label:
                  type: string
                  description: An optional message to use with the build status (default is "Skipped")
                group:
                  type:
                    - boolean
                    - string
                  description: "The status check group to post the status for, when no job has the project: `true` for the default group's `Happo` status check, or a group's name for `Happo (<group>)`. Leave empty to post the project's own status."
                ifNotStarted:
                  type: boolean
                  description: Post nothing when a Happo run for the project (or, with a group, for any project in the group) has already started on the commit, instead of taking the project out of it. The response is then a JSON object saying whether a status was posted. Pass `true` wherever CI calls this in place of running Happo.
      responses:
        "200":
          description: What the skip did, when called with `ifNotStarted`.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SkipResult"
        "204":
          description: The skip went through (without `ifNotStarted`).
        "401":
          $ref: "#/components/responses/Error401"
        "404":
          description: The given SHA is not present in the origin repository.
          content:
            text/plain:
              schema:
                type: string
  /api/reports/{fromSha}/clone/{toSha}:
    post:
      operationId: cloneReport
      summary: Clone report
      security:
        - basicAuth: []
        - bearerAuth: []
      description: |-
        Clones a report from one identifier/sha to another. This is useful if you know a commit doesn't introduce any visual changes but you still want it to be associated with a report. An example use-case of this would be if you have some logic to skip a Happo run if a PR has already run Happo on a commit, and a subsequent commit does not touch any UI code. You can then clone the existing report (from the previous commit) to the new commit. After that you can run a comparison with the cloned report set as the "after" report to trigger a Happo build status on the PR.

        Cloning a report does not affect your snapshot usage.
      parameters:
        - name: fromSha
          in: path
          required: true
          description: The id of the report to clone from
          schema:
            type: string
        - name: toSha
          in: path
          required: true
          description: The id of the report to clone to
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                project:
                  type: string
                  description: The identifying name of the project for which the clone should be created. If none is specified, the default project will be used.
                link:
                  type: string
                  description: URL to the source of the report (e.g. PR URL). If omitted, the link from the source/from report will be used
                message:
                  type: string
                  description: A short string describing the source of the report (e.g. PR title). If omitted, the link from the source/from report will be used.
      responses:
        "200":
          description: An object containing a url where the uploaded report can be accessed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReportStatus"
        "401":
          $ref: "#/components/responses/Error401"
        "404":
          description: The source report (`fromSha`) does not exist for the given project.
          content:
            text/plain:
              schema:
                type: string
  /api/diff-counts:
    get:
      operationId: diffCounts
      summary: Get diff counts
      security:
        - basicAuth: []
        - bearerAuth: []
      description: Get a sorted list of components and the number of diffs they have in the project's comparisons. This endpoint can be used to figure out what components contribute the most to flaky/spurious diffs. Diffs are kept for a limited time (10 days by default), so a longer date range has no more to count.
      parameters:
        - name: project
          in: query
          required: false
          description: The identifying name of the project to fetch diff counts for. If none is specified, the default project will be used.
          schema:
            type: string
        - name: from
          in: query
          required: false
          description: (An ISO 8601 string) Show diff counts after this point in time. Default is 30 days ago.
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          required: false
          description: (An ISO 8601 string) Show diff counts up until this point in time. If you don't pass in this parameter, you'll get diff counts up until the current timestamp.
          schema:
            type: string
            format: date-time
      responses:
        "200":
          description: An ordered list of components and their respective diff counts.
          content:
            application/json:
              schema:
                type: array
        "400":
          description: The `from` or `to` date parameter is not a valid ISO 8601 date string.
          content:
            text/plain:
              schema:
                type: string
        "401":
          $ref: "#/components/responses/Error401"
  /api/billing/current-usage:
    get:
      operationId: billingCurrentUsage
      summary: Get current usage
      security:
        - basicAuth: []
        - bearerAuth: []
      description: Get the snapshots usage in the current billing cycle. If there is no active subscription for the account, you'll receive a 404 response.
      responses:
        "200":
          description: Usage information for the current billing cycle
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Usage"
        "401":
          $ref: "#/components/responses/Error401"
        "404":
          description: The account has no active subscription.
          content:
            text/plain:
              schema:
                type: string
  /api/projects:
    get:
      operationId: getProjects
      summary: Get projects
      security:
        - basicAuth: []
        - bearerAuth: []
      description: Get all active projects (not archived) for the current account.
      responses:
        "200":
          description: A list of projects
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/ProjectInfo"
        "401":
          $ref: "#/components/responses/Error401"
  /api/reports/{sha}/find-baseline:
    post:
      operationId: findBaselineReport
      summary: Find baseline report
      security:
        - basicAuth: []
        - bearerAuth: []
      description: |-
        Finds the most recent baseline report for a given sha. If `shas` are provided, they are checked in order for an existing report. If no `shas` are provided, the git history entries table is searched backwards from the given sha.

        With `exact`, only the one sha in `shas` is checked, for a partial run whose list of what to render was computed from that commit: borrowing from any other report would miss the changes between the two. A run for it that is still in progress counts (`pending`), since the run's extends-report waits for its report.
      parameters:
        - name: sha
          in: path
          required: true
          description: The starting sha to find a baseline for. Used as the anchor when searching git history.
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                project:
                  type: string
                  description: The identifying name of the project to search within. Defaults to the default project.
                shas:
                  type: array
                  description: An ordered list of candidate shas to check for a baseline, sorted from most recent to oldest. If omitted, the git history is used instead.
                  items:
                    type: string
                exact:
                  type: boolean
                  description: "Check only the one sha in `shas`: return it when its report is saved, or when a run for it is in progress, and otherwise answer 404 rather than look at other commits."
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema: {}
        "400":
          description: The `shas` parameter is invalid (e.g. not an array of strings, or exceeds the 2000 entry limit), or `exact` is not a boolean or comes without exactly one sha.
          content:
            text/plain:
              schema:
                type: string
        "401":
          $ref: "#/components/responses/Error401"
        "404":
          description: No baseline report found for the given sha and project.
          content:
            text/plain:
              schema:
                type: string
