CircleCI API

Continuous integration and delivery platform

circleci.com/docs/api ↗
Version
v2
OpenAPI
3.0.3
Endpoints
78
Schemas
169
88
Quality
Updated
3 days ago
Developer tools ci-cd devops automation
Use this API in your AI agent

Query structured spec data via REST or MCP. Get exactly what your agent needs.

Get API Key

Server URLs

https://circleci.com/api/v2

Endpoints

Context 10 endpoints

GET /context

List all contexts for an owner.

operationId: Context_listOwnerContexts

Parameters

Name In Required Type Description
owner-id query optional string

The unique ID of the owner of the context. Specify either this or owner-slug.

owner-slug query optional string

A string that represents an organization. Specify either this or owner-id. Cannot be used for accounts.

owner-type query optional string

The type of the owner. Defaults to “organization”. Accounts are only used as context owners in server.

page-token query optional string

A token to retrieve the next page of results.

Responses

default

Error response.

200

A paginated list of contexts

GET /context
POST /context

Creates a new context.

operationId: Context_createNewContext

Request Body

application/json
schema ContextCreateNewContextRequest
Property Type Required
name string required
owner object required

Responses

default

Error response.

200

The new context

POST /context
DELETE /context/{context-id}
operationId: Context_removeContext

Parameters

Name In Required Type Description
context-id path required string

ID of the context (UUID)

Responses

default

Error response.

200

A confirmation message

DELETE /context/{context-id}
GET /context/{context-id}

Returns basic information about a context.

operationId: Context_getInformation

Parameters

Name In Required Type Description
context-id path required string

ID of the context (UUID)

Responses

default

Error response.

200

The context

GET /context/{context-id}
GET /context/{context-id}/environment-variable

List information about environment variables in a context, not including their values.

operationId: Context_listEnvironmentVariables

Parameters

Name In Required Type Description
context-id path required string

ID of the context (UUID)

page-token query optional string

A token to retrieve the next page of results.

Responses

default

Error response.

200

A paginated list of environment variables

GET /context/{context-id}/environment-variable
DELETE /context/{context-id}/environment-variable/{env-var-name}

Delete an environment variable from a context.

operationId: Context_removeEnvironmentVariable

Parameters

Name In Required Type Description
env-var-name path required string

The name of the environment variable

context-id path required string

ID of the context (UUID)

Responses

default

Error response.

200

A confirmation message

DELETE /context/{context-id}/environment-variable/{env-var-name}
PUT /context/{context-id}/environment-variable/{env-var-name}

Create or update an environment variable within a context. Returns information about the environment variable, not including its value.

operationId: Context_updateEnvironmentVariable

Parameters

Name In Required Type Description
context-id path required string

ID of the context (UUID)

env-var-name path required string

The name of the environment variable

Request Body

application/json
schema ContextUpdateEnvironmentVariableRequest
Property Type Required
value string required

Responses

default

Error response.

200

The new environment variable

PUT /context/{context-id}/environment-variable/{env-var-name}
GET /context/{context_id}/restrictions

[EXPERIMENTAL] Gets a list of project restrictions associated with a context.

operationId: Context_getRestrictions

Parameters

Name In Required Type Description
context_id path optional string

An opaque identifier of a context.

Responses

200

Successful response.

400

Context ID provided is invalid.

401

Credentials provided are invalid.

404

Entity not found.

429

API rate limits exceeded.

500

Internal server error.

GET /context/{context_id}/restrictions
POST /context/{context_id}/restrictions

[EXPERIMENTAL] Creates project restriction on a context.

operationId: Context_createRestriction

Parameters

Name In Required Type Description
context_id path optional string

An opaque identifier of a context.

Request Body

required
application/json
schema ContextCreateRestrictionRequest
Property Type Required
project_id string optional
restriction_type string optional
restriction_value string optional

Responses

201

Successful response.

400

Bad request.

401

Credentials provided are invalid.

404

Entity not found.

409

Request conflict.

429

API rate limits exceeded.

500

Internal server error.

POST /context/{context_id}/restrictions
DELETE /context/{context_id}/restrictions/{restriction_id}

[EXPERIMENTAL] Deletes a project restriction on a context.

operationId: Context_deleteRestriction

Parameters

Name In Required Type Description
context_id path optional string

An opaque identifier of a context.

restriction_id path optional string

An opaque identifier of a context restriction.

Responses

200

Successful response.

400

Context restriction ID provided is invalid.

401

Credentials provided are invalid.

404

Entity not found.

429

API rate limits exceeded.

500

Internal server error.

DELETE /context/{context_id}/restrictions/{restriction_id}

Insights 10 endpoints

GET /insights/pages/{project-slug}/summary

Get summary metrics and trends for a project at workflow and branch level.
Workflow runs going back at most 90 days are included in the aggregation window.
Trends are only supported upto last 30 days.
Please note that Insights is not a financial reporting tool and should not be used for precise credit reporting. Credit reporting from Insights does not use the same source of truth as the billing information that is found in the Plan Overview page in the CircleCI UI, nor does the underlying data have the same data accuracy guarantees as the billing information in the CircleCI UI. This may lead to discrepancies between credits reported from Insights and the billing information in the Plan Overview page of the CircleCI UI. For precise credit reporting, always use the Plan Overview page in the CircleCI UI.

operationId: Insights_getProjectSummaryMetrics

Parameters

Name In Required Type Description
project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

reporting-window query optional string

The time window used to calculate summary metrics. If not provided, defaults to last-90-days

branches query optional object

The names of VCS branches to include in branch-level workflow metrics.

workflow-names query optional object

The names of workflows to include in workflow-level metrics.

Responses

default

Error response.

200

Aggregated summary metrics and trends by workflow and branches

GET /insights/pages/{project-slug}/summary
GET /insights/time-series/{project-slug}/workflows/{workflow-name}/jobs

Get timeseries data for all jobs within a workflow. Hourly granularity data is only retained for 48 hours while daily granularity data is retained for 90 days.

operationId: Insights_getJobTimeseriesData

Parameters

Name In Required Type Description
project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

workflow-name path required string

The name of the workflow.

branch query optional string

The name of a vcs branch. If not passed we will scope the API call to the default branch.

granularity query optional string

The granularity for which to query timeseries data.

start-date query optional string

Include only executions that started at or after this date. This must be specified if an end-date is provided.

end-date query optional string

Include only executions that started before this date. This date can be at most 90 days after the start-date.

Responses

default

Error response.

200

An array of timeseries data, one entry per job.

GET /insights/time-series/{project-slug}/workflows/{workflow-name}/jobs
GET /insights/{org-slug}/summary

Gets aggregated summary metrics with trends for the entire org.
Also gets aggregated metrics and trends for each project belonging to the org.

operationId: Insights_getSummaryMetricsWithTrends

Parameters

Name In Required Type Description
org-slug path required string

Org slug in the form vcs-slug/org-name. The / characters may be URL-escaped.

reporting-window query optional string

The time window used to calculate summary metrics. If not provided, defaults to last-90-days

project-names query optional object

List of project names.

Responses

default

Error response.

200

summary metrics with trends for an entire org and it’s projects.

GET /insights/{org-slug}/summary
GET /insights/{project-slug}/branches

Get a list of all branches for a specified project. The list will only contain branches currently available within Insights. The maximum number of branches returned by this endpoint is 5,000.

operationId: Insights_listProjectBranches

Parameters

Name In Required Type Description
project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

workflow-name query optional string

The name of a workflow. If not passed we will scope the API call to the project.

Responses

default

Error response.

200

A list of branches for a project

GET /insights/{project-slug}/branches
GET /insights/{project-slug}/flaky-tests

Get a list of flaky tests for a given project. Flaky tests are branch agnostic.
A flaky test is a test that passed and failed in the same commit.

operationId: Insights_getFlakyTests

Parameters

Name In Required Type Description
project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

Responses

default

Error response.

200

A list of flaky tests for a project

GET /insights/{project-slug}/flaky-tests
GET /insights/{project-slug}/workflows

Get summary metrics for a project’s workflows. Workflow runs going back at most 90 days are included in the aggregation window. Metrics are refreshed daily, and thus may not include executions from the last 24 hours. Please note that Insights is not a financial reporting tool and should not be used for precise credit reporting. Credit reporting from Insights does not use the same source of truth as the billing information that is found in the Plan Overview page in the CircleCI UI, nor does the underlying data have the same data accuracy guarantees as the billing information in the CircleCI UI. This may lead to discrepancies between credits reported from Insights and the billing information in the Plan Overview page of the CircleCI UI. For precise credit reporting, always use the Plan Overview page in the CircleCI UI.

operationId: Insights_getProjectWorkflowMetrics

Parameters

Name In Required Type Description
project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

page-token query optional string

A token to retrieve the next page of results.

all-branches query optional boolean

Whether to retrieve data for all branches combined. Use either this parameter OR the branch name parameter.

branch query optional string

The name of a vcs branch. If not passed we will scope the API call to the default branch.

reporting-window query optional string

The time window used to calculate summary metrics. If not provided, defaults to last-90-days

Responses

default

Error response.

200

A paginated list of summary metrics by workflow

GET /insights/{project-slug}/workflows
GET /insights/{project-slug}/workflows/{workflow-name}

Get recent runs of a workflow. Runs going back at most 90 days are returned. Please note that Insights is not a financial reporting tool and should not be used for precise credit reporting. Credit reporting from Insights does not use the same source of truth as the billing information that is found in the Plan Overview page in the CircleCI UI, nor does the underlying data have the same data accuracy guarantees as the billing information in the CircleCI UI. This may lead to discrepancies between credits reported from Insights and the billing information in the Plan Overview page of the CircleCI UI. For precise credit reporting, always use the Plan Overview page in the CircleCI UI.

operationId: Insights_getRecentWorkflowRuns

Parameters

Name In Required Type Description
project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

workflow-name path required string

The name of the workflow.

all-branches query optional boolean

Whether to retrieve data for all branches combined. Use either this parameter OR the branch name parameter.

branch query optional string

The name of a vcs branch. If not passed we will scope the API call to the default branch.

page-token query optional string

A token to retrieve the next page of results.

start-date query optional string

Include only executions that started at or after this date. This must be specified if an end-date is provided.

end-date query optional string

Include only executions that started before this date. This date can be at most 90 days after the start-date.

Responses

default

Error response.

200

A paginated list of recent workflow runs

GET /insights/{project-slug}/workflows/{workflow-name}
GET /insights/{project-slug}/workflows/{workflow-name}/jobs

Get summary metrics for a project workflow’s jobs. Job runs going back at most 90 days are included in the aggregation window. Metrics are refreshed daily, and thus may not include executions from the last 24 hours. Please note that Insights is not a financial reporting tool and should not be used for precise credit reporting. Credit reporting from Insights does not use the same source of truth as the billing information that is found in the Plan Overview page in the CircleCI UI, nor does the underlying data have the same data accuracy guarantees as the billing information in the CircleCI UI. This may lead to discrepancies between credits reported from Insights and the billing information in the Plan Overview page of the CircleCI UI. For precise credit reporting, always use the Plan Overview page in the CircleCI UI.

operationId: Insights_getProjectWorkflowJobMetrics

Parameters

Name In Required Type Description
project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

workflow-name path required string

The name of the workflow.

page-token query optional string

A token to retrieve the next page of results.

all-branches query optional boolean

Whether to retrieve data for all branches combined. Use either this parameter OR the branch name parameter.

branch query optional string

The name of a vcs branch. If not passed we will scope the API call to the default branch.

reporting-window query optional string

The time window used to calculate summary metrics. If not provided, defaults to last-90-days

Responses

default

Error response.

200

A paginated list of summary metrics by workflow job.

GET /insights/{project-slug}/workflows/{workflow-name}/jobs
GET /insights/{project-slug}/workflows/{workflow-name}/summary

Get the metrics and trends for a particular workflow on a single branch or all branches

operationId: Insights_getWorkflowSummaryMetrics

Parameters

Name In Required Type Description
project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

workflow-name path required string

The name of the workflow.

all-branches query optional boolean

Whether to retrieve data for all branches combined. Use either this parameter OR the branch name parameter.

branch query optional string

The name of a vcs branch. If not passed we will scope the API call to the default branch.

Responses

default

Error response.

200

Metrics and trends for a workflow

GET /insights/{project-slug}/workflows/{workflow-name}/summary
GET /insights/{project-slug}/workflows/{workflow-name}/test-metrics

Get test metrics for a project’s workflows. Currently tests metrics are calculated based on 10 most recent workflow runs.

operationId: Insights_getProjectWorkflowTestMetrics

Parameters

Name In Required Type Description
project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

workflow-name path required string

The name of the workflow.

branch query optional string

The name of a vcs branch. If not passed we will scope the API call to the default branch.

all-branches query optional boolean

Whether to retrieve data for all branches combined. Use either this parameter OR the branch name parameter.

Responses

default

Error response.

200

A list of test metrics by workflow

GET /insights/{project-slug}/workflows/{workflow-name}/test-metrics

Job 4 endpoints

GET /project/{project-slug}/job/{job-number}

Returns job details.

operationId: Job_getDetails

Parameters

Name In Required Type Description
job-number path required

The number of the job.

project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

Responses

default

Error response.

200

Job details.

GET /project/{project-slug}/job/{job-number}
POST /project/{project-slug}/job/{job-number}/cancel

Cancel job with a given job number.

operationId: Job_cancelWithNumber

Parameters

Name In Required Type Description
job-number path required

The number of the job.

project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

Responses

default

Error response.

200
POST /project/{project-slug}/job/{job-number}/cancel
GET /project/{project-slug}/{job-number}/artifacts

Returns a job’s artifacts.

operationId: Job_getArtifacts

Parameters

Name In Required Type Description
job-number path required

The number of the job.

project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

Responses

default

Error response.

200

A paginated list of the job’s artifacts.

GET /project/{project-slug}/{job-number}/artifacts
GET /project/{project-slug}/{job-number}/tests

Get test metadata for a build. In the rare case where there is more than 250MB of test data on the job, no results will be returned.

operationId: Job_getTestMetadata

Parameters

Name In Required Type Description
job-number path required

The number of the job.

project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

Responses

default

Error response.

200

A paginated list of test results.

GET /project/{project-slug}/{job-number}/tests

Oidctokenmanagement 6 endpoints

DELETE /org/{orgID}/oidc-custom-claims

Deletes org-level custom claims of OIDC identity tokens

operationId: OidcTokenManagement_deleteOrgClaims

Parameters

Name In Required Type Description
orgID path optional string
claims query optional string

comma separated list of claims to delete. Valid values are “audience” and “ttl”.

Responses

200

Claims successfully deleted.

400

The request is malformed (e.g, a given path parameter is invalid)

403

The user is forbidden from making this request

500

Something unexpected happened on the server.

DELETE /org/{orgID}/oidc-custom-claims
GET /org/{orgID}/oidc-custom-claims

Fetches org-level custom claims of OIDC identity tokens

operationId: OidcTokenManagement_getOrgClaims

Parameters

Name In Required Type Description
orgID path optional string

Responses

200

Claims successfully fetched.

400

The request is malformed (e.g, a given path parameter is invalid)

403

The user is forbidden from making this request

500

Something unexpected happened on the server.

GET /org/{orgID}/oidc-custom-claims
PATCH /org/{orgID}/oidc-custom-claims

Creates/Updates org-level custom claims of OIDC identity tokens

operationId: OidcTokenManagement_updateOrgClaims

Parameters

Name In Required Type Description
orgID path optional string

Request Body

application/json
schema PatchClaimsRequest
Property Type Required
ttl string optional
audience array optional

Responses

200

Claims successfully patched.

400

The request is malformed (e.g, a given path parameter is invalid)

403

The user is forbidden from making this request

500

Something unexpected happened on the server.

PATCH /org/{orgID}/oidc-custom-claims
DELETE /org/{orgID}/project/{projectID}/oidc-custom-claims

Deletes project-level custom claims of OIDC identity tokens

operationId: OidcTokenManagement_deleteProjectClaims

Parameters

Name In Required Type Description
orgID path optional string
projectID path optional string
claims query optional string

comma separated list of claims to delete. Valid values are “audience” and “ttl”.

Responses

200

Claims successfully deleted.

400

The request is malformed (e.g, a given path parameter is invalid)

403

The user is forbidden from making this request

500

Something unexpected happened on the server.

DELETE /org/{orgID}/project/{projectID}/oidc-custom-claims
GET /org/{orgID}/project/{projectID}/oidc-custom-claims

Fetches project-level custom claims of OIDC identity tokens

operationId: OidcTokenManagement_getProjectClaims

Parameters

Name In Required Type Description
orgID path optional string
projectID path optional string

Responses

200

Claims successfully fetched.

400

The request is malformed (e.g, a given path parameter is invalid)

403

The user is forbidden from making this request

500

Something unexpected happened on the server.

GET /org/{orgID}/project/{projectID}/oidc-custom-claims
PATCH /org/{orgID}/project/{projectID}/oidc-custom-claims

Creates/Updates project-level custom claims of OIDC identity tokens

operationId: OidcTokenManagement_updateProjectClaims

Parameters

Name In Required Type Description
orgID path optional string
projectID path optional string

Request Body

application/json
schema PatchClaimsRequest
Property Type Required
ttl string optional
audience array optional

Responses

200

Claims successfully patched.

400

The request is malformed (e.g, a given path parameter is invalid)

403

The user is forbidden from making this request

500

Something unexpected happened on the server.

PATCH /org/{orgID}/project/{projectID}/oidc-custom-claims

Pipeline 9 endpoints

GET /pipeline

Returns all pipelines for the most recently built projects (max 250) you follow in an organization.

operationId: Pipeline_listRecentPipelines

Parameters

Name In Required Type Description
org-slug query optional string

Org slug in the form vcs-slug/org-name. For projects that use GitLab or GitHub App, use circleci as the vcs-slug and replace the org-name with the organization ID (found in Organization Settings).

page-token query optional string

A token to retrieve the next page of results.

mine query optional boolean

Only include entries created by your user.

Responses

default

Error response.

200

A sequence of pipelines.

GET /pipeline
POST /pipeline/continue

Continue a pipeline from the setup phase. For information on using pipeline parameters with dynamic configuration, see the Pipeline values and parameters docs.

operationId: Pipeline_continueExecution

Request Body

application/json
schema PipelineContinueExecutionRequest
Property Type Required
parameters object optional
configuration string required
continuation-key string required

Responses

default

Error response.

200

A confirmation message.

POST /pipeline/continue
GET /pipeline/{pipeline-id}

Returns a pipeline by the pipeline ID.

operationId: Pipeline_getById

Parameters

Name In Required Type Description
pipeline-id path required string

The unique ID of the pipeline.

Responses

default

Error response.

200

A pipeline object.

GET /pipeline/{pipeline-id}
GET /pipeline/{pipeline-id}/config

Returns a pipeline’s configuration by ID.

operationId: Pipeline_getConfigurationById

Parameters

Name In Required Type Description
pipeline-id path required string

The unique ID of the pipeline.

Responses

default

Error response.

200

The configuration strings for the pipeline.

GET /pipeline/{pipeline-id}/config
GET /pipeline/{pipeline-id}/workflow

Returns a paginated list of workflows by pipeline ID.

operationId: Pipeline_listWorkflows

Parameters

Name In Required Type Description
pipeline-id path required string

The unique ID of the pipeline.

page-token query optional string

A token to retrieve the next page of results.

Responses

default

Error response.

200

A paginated list of workflow objects.

GET /pipeline/{pipeline-id}/workflow
GET /project/{project-slug}/pipeline

Returns all pipelines for this project.

operationId: Pipeline_getAllPipelines

Parameters

Name In Required Type Description
project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

branch query optional string

The name of a vcs branch.

page-token query optional string

A token to retrieve the next page of results.

Responses

default

Error response.

200

A sequence of pipelines.

GET /project/{project-slug}/pipeline
POST /project/{project-slug}/pipeline

Not yet available to projects that use GitLab or GitHub App. Triggers a new pipeline on the project.

operationId: Pipeline_triggerNewPipeline

Parameters

Name In Required Type Description
project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

Request Body

application/json
schema PipelineTriggerNewPipelineRequest
Property Type Required
tag string optional
branch string optional
parameters object optional

Responses

default

Error response.

201

The created pipeline.

POST /project/{project-slug}/pipeline
GET /project/{project-slug}/pipeline/mine

Returns a sequence of all pipelines for this project triggered by the user.

operationId: Pipeline_listUserPipelines

Parameters

Name In Required Type Description
project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

page-token query optional string

A token to retrieve the next page of results.

Responses

default

Error response.

200

A sequence of pipelines.

GET /project/{project-slug}/pipeline/mine
GET /project/{project-slug}/pipeline/{pipeline-number}

Returns a pipeline by the pipeline number.

operationId: Pipeline_getByNumber

Parameters

Name In Required Type Description
project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

pipeline-number path required

The number of the pipeline.

Responses

default

Error response.

200

A pipeline object.

GET /project/{project-slug}/pipeline/{pipeline-number}

Policymanagement 9 endpoints

GET /owner/{ownerID}/context/{context}/decision

This endpoint will return a list of decision audit logs that were made using this owner’s policies.

operationId: PolicyManagement_getDecisionAuditLogs

Parameters

Name In Required Type Description
ownerID path optional string
context path optional string
status query optional string

Return decisions matching this decision status.

after query optional string

Return decisions made after this date.

before query optional string

Return decisions made before this date.

branch query optional string

Return decisions made on this branch.

project_id query optional string

Return decisions made for this project.

build_number query optional string

Return decisions made for this build number.

offset query optional integer

Sets the offset when retrieving the decisions, for paging.

Responses

200

Decision logs successfully retrieved.

400

The request is malformed (e.g, a given path parameter is invalid)

401

The request is unauthorized

403

The user is forbidden from making this request

500

Something unexpected happened on the server.

GET /owner/{ownerID}/context/{context}/decision
POST /owner/{ownerID}/context/{context}/decision

This endpoint will evaluate input data (config+metadata) against owner’s stored policies and return a decision.

operationId: PolicyManagement_evaluateInputData

Parameters

Name In Required Type Description
ownerID path optional string
context path optional string

Request Body

application/json
schema PolicyManagementEvaluateInputDataRequest
Property Type Required
input string required
metadata object optional

Responses

200

Decision rendered by applying the policy against the provided data. Response will be modeled by the data and rego processed.

400

The request is malformed

401

The request is unauthorized

500

Something unexpected happened on the server.

POST /owner/{ownerID}/context/{context}/decision
GET /owner/{ownerID}/context/{context}/decision/settings

This endpoint retrieves the current decision settings (eg enable/disable policy evaluation)

operationId: PolicyManagement_getDecisionSettings

Parameters

Name In Required Type Description
ownerID path optional string
context path optional string

Responses

200

Decision settings successfully retrieved.

400

The request is malformed (e.g, a given path parameter is invalid)

401

The request is unauthorized

403

The user is forbidden from making this request

500

Something unexpected happened on the server.

GET /owner/{ownerID}/context/{context}/decision/settings
PATCH /owner/{ownerID}/context/{context}/decision/settings

This endpoint allows modifying decision settings (eg enable/disable policy evaluation)

operationId: PolicyManagement_modifyDecisionSettings

Parameters

Name In Required Type Description
ownerID path optional string
context path optional string

Request Body

application/json
schema DecisionSettings
Property Type Required
enabled boolean optional

Responses

200

Decision settings successfully set.

400

The request is malformed (e.g, a given path parameter is invalid)

401

The request is unauthorized

403

The user is forbidden from making this request

500

Something unexpected happened on the server.

PATCH /owner/{ownerID}/context/{context}/decision/settings
GET /owner/{ownerID}/context/{context}/decision/{decisionID}

This endpoint will retrieve a decision for a given decision log ID

operationId: PolicyManagement_getDecisionAuditLogByGivenId

Parameters

Name In Required Type Description
ownerID path optional string
context path optional string
decisionID path optional string

Responses

200

Decision log successfully retrieved.

400

The request is malformed (e.g, a given path parameter is invalid)

401

The request is unauthorized

403

The user is forbidden from making this request

404

There was no decision log found for given decision_id, and owner_id.

500

Something unexpected happened on the server.

GET /owner/{ownerID}/context/{context}/decision/{decisionID}
GET /owner/{ownerID}/context/{context}/decision/{decisionID}/policy-bundle

This endpoint will retrieve a policy bundle for a given decision log ID

operationId: PolicyManagement_getPolicyBundleForDecision

Parameters

Name In Required Type Description
ownerID path optional string
context path optional string
decisionID path optional string

Responses

200

Policy-Bundle retrieved successfully for given decision log ID

400

The request is malformed (e.g, a given path parameter is invalid)

401

The request is unauthorized

403

The user is forbidden from making this request

404

There was no decision log found for given decision_id, and owner_id.

500

Something unexpected happened on the server.

GET /owner/{ownerID}/context/{context}/decision/{decisionID}/policy-bundle
GET /owner/{ownerID}/context/{context}/policy-bundle

This endpoint will retrieve a policy bundle

operationId: PolicyManagement_getPolicyBundle

Parameters

Name In Required Type Description
ownerID path optional string
context path optional string

Responses

200

Policy-Bundle retrieved successfully.

400

The request is malformed (e.g, a given path parameter is invalid)

401

The request is unauthorized

403

The user is forbidden from making this request

500

Something unexpected happened on the server.

GET /owner/{ownerID}/context/{context}/policy-bundle
POST /owner/{ownerID}/context/{context}/policy-bundle

This endpoint replaces the current policy bundle with the provided policy bundle

operationId: PolicyManagement_createPolicyBundleForContext

Parameters

Name In Required Type Description
ownerID path optional string
context path optional string
dry query optional boolean

Request Body

application/json
schema BundlePayload
Property Type Required
policies object optional

Responses

200

Policy-Bundle diff successfully returned.

201

Policy-Bundle successfully created.

400

The request is malformed (e.g, a given path parameter is invalid)

401

The request is unauthorized

403

The user is forbidden from making this request

413

The request exceeds the maximum payload size for policy bundles ~2.5Mib

500

Something unexpected happened on the server.

POST /owner/{ownerID}/context/{context}/policy-bundle
GET /owner/{ownerID}/context/{context}/policy-bundle/{policyName}

This endpoint will retrieve a policy document.

operationId: PolicyManagement_getDocument

Parameters

Name In Required Type Description
ownerID path optional string
context path optional string
policyName path required string

the policy name set by the rego policy_name rule

Responses

200

Policy retrieved successfully.

400

The request is malformed (e.g, a given path parameter is invalid)

401

The request is unauthorized

403

The user is forbidden from making this request

404

There was no policy that was found with the given owner_id and policy name.

500

Something unexpected happened on the server.

GET /owner/{ownerID}/context/{context}/policy-bundle/{policyName}

Project 2 endpoints

GET /project/{project-slug}

Retrieves a project by project slug.

operationId: Project_getBySlug

Parameters

Name In Required Type Description
project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

Responses

default

Error response.

200

A project object

GET /project/{project-slug}
GET /project/{project-slug}/checkout-key

Returns a sequence of checkout keys for :project.

operationId: Project_listCheckoutKeys

Parameters

Name In Required Type Description
project-slug path required string

Project slug in the form vcs-slug/org-name/repo-name. The / characters may be URL-escaped. For projects that use GitLab or GitHub App, use circleci as the vcs-slug, replace org-name with the organization ID (found in Organization Settings), and replace repo-name with the project ID (found in Project Settings).

digest query optional string

The fingerprint digest type to return. This may be either md5 or sha256. If not passed, defaults to md5.

Responses

default

Error response.

200

A sequence of checkout keys.

GET /project/{project-slug}/checkout-key

Schemas

object BundleDiff
{
  "type": "object",
  "properties": {
    "created": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "policy names"
      }
    },
    "deleted": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "policy names"
      }
    },
    "modified": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "policy names"
      }
    }
  }
}
object BundlePayload
{
  "type": "object",
  "properties": {
    "policies": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "description": "policy content"
      }
    }
  }
}
object ClaimResponse
{
  "type": "object",
  "required": [
    "org_id"
  ],
  "properties": {
    "ttl": {
      "$ref": "#/components/schemas/JSONDuration"
    },
    "org_id": {
      "type": "string",
      "format": "uuid"
    },
    "audience": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "project_id": {
      "type": "string",
      "format": "uuid"
    },
    "ttl_updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "audience_updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
object ContextCreateNewContextRequest
{
  "type": "object",
  "required": [
    "name",
    "owner"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "The user defined name of the context."
    },
    "owner": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "id"
          ],
          "properties": {
            "id": {
              "type": "string",
              "format": "uuid",
              "description": "The unique ID of the owner of the context. Specify either this or slug."
            },
            "type": {
              "enum": [
                "account",
                "organization"
              ],
              "type": "string",
              "example": "organization",
              "description": "The type of the owner. Defaults to \"organization\". Accounts are only used as context owners in server."
            }
          }
        },
        {
          "type": "object",
          "required": [
            "slug"
          ],
          "properties": {
            "slug": {
              "type": "string",
              "description": "A string that represents an organization. Specify either this or id. Cannot be used for accounts."
            },
            "type": {
              "enum": [
                "organization"
              ],
              "type": "string",
              "description": "The type of owner. Defaults to \"organization\". Accounts are only used as context owners in server and must be specified by an id instead of a slug."
            }
          }
        }
      ]
    }
  }
}
object ContextCreateNewContextResponse
{
  "type": "object",
  "title": "Context",
  "required": [
    "id",
    "name",
    "created_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "The unique ID of the context."
    },
    "name": {
      "type": "string",
      "description": "The user defined name of the context."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "example": "2015-09-21T17:29:21.042Z",
      "description": "The date and time the context was created."
    }
  }
}
object ContextCreateNewContextdefaultResponse
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
object ContextCreateRestriction409Response
{
  "properties": {
    "message": {
      "type": "string"
    }
  },
  "additionalProperties": false
}
object ContextCreateRestrictionRequest
{
  "type": "object",
  "properties": {
    "project_id": {
      "type": "string",
      "format": "uuid",
      "deprecated": true,
      "description": "Deprecated - Use \"restriction_type\" and \"restriction_value\"\ninstead.\n\nThe project ID to use for a project restriction. This is\nmutually exclusive with restriction_type and restriction_value\nand implies restriction_type is \"project\".\n"
    },
    "restriction_type": {
      "type": "string"
    },
    "restriction_value": {
      "type": "string"
    }
  }
}
object ContextCreateRestrictionResponse
{
  "properties": {
    "message": {
      "type": "string"
    }
  },
  "additionalProperties": false
}
object ContextDeleteRestrictionResponse
{
  "properties": {
    "message": {
      "type": "string",
      "default": "restriction_id is invalid."
    }
  },
  "additionalProperties": false
}
object ContextGetInformationResponse
{
  "type": "object",
  "title": "Context",
  "required": [
    "id",
    "name",
    "created_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "The unique ID of the context."
    },
    "name": {
      "type": "string",
      "description": "The user defined name of the context."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "example": "2015-09-21T17:29:21.042Z",
      "description": "The date and time the context was created."
    }
  }
}
object ContextGetInformationdefaultResponse
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
object ContextGetRestrictions401Response
{
  "properties": {
    "message": {
      "type": "string"
    }
  },
  "additionalProperties": false
}
object ContextGetRestrictions404Response
{
  "properties": {
    "message": {
      "type": "string"
    }
  },
  "additionalProperties": false
}
object ContextGetRestrictions429Response
{
  "properties": {
    "message": {
      "type": "string",
      "default": "Rate limit exceeded."
    }
  },
  "additionalProperties": false
}
object ContextGetRestrictions500Response
{
  "properties": {
    "message": {
      "type": "string",
      "default": "Internal server error."
    }
  },
  "additionalProperties": false
}
object ContextGetRestrictionsResponse
{
  "properties": {
    "message": {
      "type": "string",
      "default": "context_id is invalid."
    }
  },
  "additionalProperties": false
}
object ContextListEnvironmentVariablesResponse
{
  "type": "object",
  "required": [
    "items",
    "next_page_token"
  ],
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "variable",
          "created_at",
          "updated_at",
          "context_id"
        ],
        "properties": {
          "variable": {
            "type": "string",
            "example": "POSTGRES_USER",
            "description": "The name of the environment variable"
          },
          "context_id": {
            "type": "string",
            "format": "uuid",
            "description": "ID of the context (UUID)"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2015-09-21T17:29:21.042Z",
            "description": "The date and time the environment variable was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2015-09-21T17:29:21.042Z",
            "description": "The date and time the environment variable was updated"
          }
        }
      }
    },
    "next_page_token": {
      "type": "string",
      "x-nullable": true,
      "description": "A token to pass as a `page-token` query parameter to return the next page of results."
    }
  }
}
object ContextListEnvironmentVariablesdefaultResponse
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
object ContextListOwnerContextsResponse
{
  "type": "object",
  "required": [
    "items",
    "next_page_token"
  ],
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "title": "Context",
        "required": [
          "id",
          "name",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The unique ID of the context."
          },
          "name": {
            "type": "string",
            "description": "The user defined name of the context."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2015-09-21T17:29:21.042Z",
            "description": "The date and time the context was created."
          }
        }
      }
    },
    "next_page_token": {
      "type": "string",
      "x-nullable": true,
      "description": "A token to pass as a `page-token` query parameter to return the next page of results."
    }
  }
}
object ContextListOwnerContextsdefaultResponse
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
object ContextRemoveContextResponse
{
  "type": "object",
  "title": "MessageResponse",
  "required": [
    "message"
  ],
  "properties": {
    "message": {
      "type": "string",
      "description": "A human-readable message"
    }
  },
  "description": "message response"
}
object ContextRemoveContextdefaultResponse
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
object ContextRemoveEnvironmentVariableResponse
{
  "type": "object",
  "title": "MessageResponse",
  "required": [
    "message"
  ],
  "properties": {
    "message": {
      "type": "string",
      "description": "A human-readable message"
    }
  },
  "description": "message response"
}
object ContextRemoveEnvironmentVariabledefaultResponse
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
object ContextUpdateEnvironmentVariableRequest
{
  "type": "object",
  "required": [
    "value"
  ],
  "properties": {
    "value": {
      "type": "string",
      "example": "some-secret-value",
      "description": "The value of the environment variable"
    }
  }
}
object ContextUpdateEnvironmentVariableResponse
{
  "anyOf": [
    {
      "type": "object",
      "required": [
        "variable",
        "created_at",
        "updated_at",
        "context_id"
      ],
      "properties": {
        "variable": {
          "type": "string",
          "example": "POSTGRES_USER",
          "description": "The name of the environment variable"
        },
        "context_id": {
          "type": "string",
          "format": "uuid",
          "description": "ID of the context (UUID)"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "example": "2015-09-21T17:29:21.042Z",
          "description": "The date and time the environment variable was created."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "example": "2015-09-21T17:29:21.042Z",
          "description": "The date and time the environment variable was updated"
        }
      }
    },
    {
      "type": "object",
      "title": "MessageResponse",
      "required": [
        "message"
      ],
      "properties": {
        "message": {
          "type": "string",
          "description": "A human-readable message"
        }
      },
      "description": "message response"
    }
  ]
}
object ContextUpdateEnvironmentVariabledefaultResponse
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
object Decision
{
  "type": "object",
  "required": [
    "status"
  ],
  "properties": {
    "reason": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "enabled_rules": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "hard_failures": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Violation"
      }
    },
    "soft_failures": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Violation"
      }
    }
  }
}
object DecisionLog
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "decision": {
      "$ref": "#/components/schemas/Decision"
    },
    "metadata": {
      "type": "object",
      "properties": {
        "vcs": {
          "type": "object",
          "properties": {
            "branch": {
              "type": "string"
            },
            "release_tag": {
              "type": "string"
            },
            "origin_repository_url": {
              "type": "string"
            },
            "target_repository_url": {
              "type": "string"
            }
          }
        },
        "ssh_rerun": {
          "type": "boolean"
        },
        "project_id": {
          "type": "string",
          "format": "uuid"
        },
        "build_number": {
          "type": "integer"
        }
      }
    },
    "policies": {
      "type": "object",
      "example": {
        "policy_name1": "1f40fc92da241694750979ee6cf582f2d5d7d28e18335de05abc54d0560e0f5302860c652bf08d560252aa5e74210546f369fbbbce8c12cfc7957b2652fe9a75",
        "policy_name2": "5267768822ee624d48fce15ec5ca79cbd602cb7f4c2157a516556991f22ef8c7b5ef7b18d1ff41c59370efb0858651d44a936c11b7b144c48fe04df3c6a3e8da"
      },
      "description": "policy-name-to-hash-map",
      "additionalProperties": {
        "type": "string",
        "maxLength": 128,
        "minLength": 128
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "time_taken_ms": {
      "type": "integer"
    }
  }
}
object DecisionSettings
{
  "type": "object",
  "properties": {
    "enabled": {
      "type": "boolean"
    }
  }
}
object InsightsGetFlakyTestsResponse
{
  "type": "object",
  "required": [
    "flaky-tests",
    "total-flaky-tests"
  ],
  "properties": {
    "flaky-tests": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "workflow-created-at",
          "classname",
          "job-number",
          "times-flaked",
          "source",
          "pipeline-number",
          "file",
          "workflow-name",
          "job-name",
          "workflow-id",
          "test-name"
        ],
        "properties": {
          "file": {
            "type": "string",
            "x-nullable": true,
            "description": "The file the test belongs to."
          },
          "source": {
            "type": "string",
            "x-nullable": true,
            "description": "The source of the test."
          },
          "job-name": {
            "type": "string",
            "description": "The name of the job."
          },
          "classname": {
            "type": "string",
            "x-nullable": true,
            "description": "The class the test belongs to."
          },
          "test-name": {
            "type": "string",
            "description": "The name of the test."
          },
          "job-number": {
            "allOf": [
              {
                "type": "integer",
                "format": "int64"
              },
              {
                "type": "integer",
                "format": "int64",
                "minimum": 0
              }
            ],
            "description": "The number of the job."
          },
          "time-wasted": {
            "allOf": [
              {
                "type": "integer",
                "format": "int64"
              },
              {
                "type": "integer",
                "format": "int64",
                "minimum": 0
              }
            ]
          },
          "workflow-id": {
            "description": "The ID of the workflow associated with the provided test counts"
          },
          "times-flaked": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "The number of times the test flaked."
          },
          "workflow-name": {
            "type": "string",
            "description": "The name of the workflow."
          },
          "pipeline-number": {
            "allOf": [
              {
                "type": "integer",
                "format": "int64"
              },
              {
                "type": "integer",
                "format": "int64",
                "minimum": 0
              }
            ],
            "description": "The number of the pipeline."
          },
          "workflow-created-at": {
            "type": "string",
            "description": "The date and time when workflow was created."
          }
        }
      },
      "description": "A list of all instances of flakes. Note that a test is no longer considered flaky after 2 weeks have passed without a flake. Each flake resets this timer."
    },
    "total-flaky-tests": {
      "type": "number",
      "format": "double",
      "example": 5,
      "description": "A count of unique tests that have failed. If your project has N tests that have flaked multiple times each, this will be equal to N."
    }
  },
  "description": "Flaky tests response"
}
object InsightsGetFlakyTestsdefaultResponse
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
object InsightsGetJobTimeseriesDataResponse
{
  "type": "object",
  "required": [
    "next_page_token",
    "items"
  ],
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "min_started_at",
          "max_ended_at",
          "timestamp",
          "metrics"
        ],
        "properties": {
          "name": {
            "type": "string",
            "example": "build-and-test",
            "description": "The name of the workflow."
          },
          "metrics": {
            "type": "object",
            "required": [
              "total_runs",
              "failed_runs",
              "successful_runs",
              "throughput",
              "median_credits_used",
              "total_credits_used",
              "duration_metrics"
            ],
            "properties": {
              "throughput": {
                "type": "number",
                "format": "float",
                "description": "The average number of runs per day."
              },
              "total_runs": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The total number of runs, including runs that are still on-hold or running."
              },
              "failed_runs": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The number of failed runs."
              },
              "successful_runs": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The number of successful runs."
              },
              "duration_metrics": {
                "type": "object",
                "required": [
                  "min",
                  "median",
                  "max",
                  "p95",
                  "total"
                ],
                "properties": {
                  "max": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "x-nullable": true,
                    "description": "The max duration, in seconds, among a group of runs."
                  },
                  "min": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "x-nullable": true,
                    "description": "The minimum duration, in seconds, among a group of runs."
                  },
                  "p95": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "x-nullable": true,
                    "description": "The 95th percentile duration, in seconds, among a group of runs."
                  },
                  "total": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "x-nullable": true,
                    "description": "The total duration, in seconds, added across a group of runs."
                  },
                  "median": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "x-nullable": true,
                    "description": "The median duration, in seconds, among a group of runs."
                  }
                },
                "description": "Metrics relating to the duration of runs for a workflow."
              },
              "total_credits_used": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The total credits consumed over the current timeseries interval."
              },
              "median_credits_used": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The median credits consumed over the current timeseries interval."
              }
            },
            "description": "Metrics relating to a workflow's runs."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "The start of the interval for timeseries metrics."
          },
          "max_ended_at": {
            "type": "string",
            "format": "date-time",
            "description": "The end time of the last execution included in the metrics."
          },
          "min_started_at": {
            "type": "string",
            "format": "date-time",
            "description": "The start time for the earliest execution included in the metrics."
          }
        }
      },
      "description": "Aggregate metrics for a workflow at a time granularity"
    },
    "next_page_token": {
      "type": "string",
      "x-nullable": true,
      "description": "A token to pass as a `page-token` query parameter to return the next page of results."
    }
  },
  "description": "Project level timeseries metrics response"
}
object InsightsGetJobTimeseriesDatadefaultResponse
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
object InsightsGetProjectSummaryMetricsResponse
{
  "type": "object",
  "properties": {
    "org_id": {
      "description": "The unique ID of the organization"
    },
    "project_id": {
      "description": "The unique ID of the project"
    },
    "all_branches": {
      "type": "array",
      "items": {
        "type": "string",
        "example": "main",
        "description": "The VCS branch of a workflow's trigger."
      },
      "description": "A list of all the branches for a given project."
    },
    "project_data": {
      "type": "object",
      "required": [
        "metrics",
        "trends"
      ],
      "properties": {
        "trends": {
          "type": "object",
          "required": [
            "total_runs",
            "total_duration_secs",
            "total_credits_used",
            "success_rate",
            "throughput"
          ],
          "properties": {
            "throughput": {
              "type": "number",
              "format": "float",
              "description": "Trend value for the average number of runs per day."
            },
            "total_runs": {
              "type": "number",
              "format": "float",
              "description": "The trend value for total number of runs."
            },
            "success_rate": {
              "type": "number",
              "format": "float",
              "description": "The trend value for the success rate."
            },
            "total_credits_used": {
              "type": "number",
              "format": "float",
              "description": "The trend value for total credits consumed."
            },
            "total_duration_secs": {
              "type": "number",
              "format": "float",
              "description": "Trend value for total duration."
            }
          },
          "description": "Metric trends aggregated across all workflows and branches for a project."
        },
        "metrics": {
          "type": "object",
          "required": [
            "total_runs",
            "total_duration_secs",
            "total_credits_used",
            "success_rate",
            "throughput"
          ],
          "properties": {
            "throughput": {
              "type": "number",
              "format": "float",
              "description": "The average number of runs per day."
            },
            "total_runs": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "description": "The total number of runs, including runs that are still on-hold or running."
            },
            "success_rate": {
              "type": "number",
              "format": "float"
            },
            "total_credits_used": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "description": "The total credits consumed over the current timeseries interval."
            },
            "total_duration_secs": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "description": "Total duration, in seconds."
            }
          },
          "description": "Metrics aggregated across all workflows and branches for a project."
        }
      },
      "description": "Metrics and trends data aggregated for a given project."
    },
    "all_workflows": {
      "type": "array",
      "items": {
        "type": "string",
        "example": "build-and-test",
        "description": "The name of the workflow."
      },
      "description": "A list of all the workflows for a given project."
    },
    "project_workflow_data": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "workflow_name",
          "metrics",
          "trends"
        ],
        "properties": {
          "trends": {
            "type": "object",
            "required": [
              "total_credits_used",
              "p95_duration_secs",
              "total_runs",
              "success_rate"
            ],
            "properties": {
              "total_runs": {
                "type": "number",
                "format": "float",
                "description": "The trend value for total number of runs."
              },
              "success_rate": {
                "type": "number",
                "format": "float",
                "description": "The trend value for the success rate."
              },
              "p95_duration_secs": {
                "type": "number",
                "format": "float",
                "description": "The 95th percentile duration among a group of workflow runs."
              },
              "total_credits_used": {
                "type": "number",
                "format": "float",
                "description": "The trend value for total credits consumed."
              }
            },
            "description": "Trends aggregated across a workflow or branch for a project."
          },
          "metrics": {
            "type": "object",
            "required": [
              "total_credits_used",
              "p95_duration_secs",
              "total_runs",
              "success_rate"
            ],
            "properties": {
              "total_runs": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The total number of runs, including runs that are still on-hold or running."
              },
              "success_rate": {
                "type": "number",
                "format": "float"
              },
              "p95_duration_secs": {
                "type": "number",
                "format": "float",
                "description": "The 95th percentile duration among a group of workflow runs."
              },
              "total_credits_used": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The total credits consumed over the current timeseries interval."
              }
            },
            "description": "Metrics aggregated across a workflow or branchfor a project."
          },
          "workflow_name": {
            "type": "string",
            "example": "build-and-test",
            "description": "The name of the workflow."
          }
        }
      },
      "description": "A list of metrics and trends data for workflows for a given project."
    },
    "project_workflow_branch_data": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "workflow_name",
          "branch",
          "metrics",
          "trends"
        ],
        "properties": {
          "branch": {
            "type": "string",
            "example": "main",
            "description": "The VCS branch of a workflow's trigger."
          },
          "trends": {
            "type": "object",
            "required": [
              "total_credits_used",
              "p95_duration_secs",
              "total_runs",
              "success_rate"
            ],
            "properties": {
              "total_runs": {
                "type": "number",
                "format": "float",
                "description": "The trend value for total number of runs."
              },
              "success_rate": {
                "type": "number",
                "format": "float",
                "description": "The trend value for the success rate."
              },
              "p95_duration_secs": {
                "type": "number",
                "format": "float",
                "description": "The 95th percentile duration among a group of workflow runs."
              },
              "total_credits_used": {
                "type": "number",
                "format": "float",
                "description": "The trend value for total credits consumed."
              }
            },
            "description": "Trends aggregated across a workflow or branch for a project."
          },
          "metrics": {
            "type": "object",
            "required": [
              "total_credits_used",
              "p95_duration_secs",
              "total_runs",
              "success_rate"
            ],
            "properties": {
              "total_runs": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The total number of runs, including runs that are still on-hold or running."
              },
              "success_rate": {
                "type": "number",
                "format": "float"
              },
              "p95_duration_secs": {
                "type": "number",
                "format": "float",
                "description": "The 95th percentile duration among a group of workflow runs."
              },
              "total_credits_used": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The total credits consumed over the current timeseries interval."
              }
            },
            "description": "Metrics aggregated across a workflow or branchfor a project."
          },
          "workflow_name": {
            "type": "string",
            "example": "build-and-test",
            "description": "The name of the workflow."
          }
        }
      },
      "description": "A list of metrics and trends data for branches for a given project."
    }
  }
}
object InsightsGetProjectSummaryMetricsdefaultResponse
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
object InsightsGetProjectWorkflowJobMetricsResponse
{
  "type": "object",
  "required": [
    "items",
    "next_page_token"
  ],
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "metrics",
          "window_start",
          "window_end"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the job."
          },
          "metrics": {
            "type": "object",
            "required": [
              "total_runs",
              "failed_runs",
              "successful_runs",
              "duration_metrics",
              "success_rate",
              "total_credits_used",
              "throughput"
            ],
            "properties": {
              "throughput": {
                "type": "number",
                "format": "float",
                "description": "The average number of runs per day."
              },
              "total_runs": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The total number of runs, including runs that are still on-hold or running."
              },
              "failed_runs": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The number of failed runs."
              },
              "success_rate": {
                "type": "number",
                "format": "float"
              },
              "successful_runs": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The number of successful runs."
              },
              "duration_metrics": {
                "type": "object",
                "required": [
                  "min",
                  "mean",
                  "median",
                  "p95",
                  "max",
                  "standard_deviation"
                ],
                "properties": {
                  "max": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "x-nullable": true,
                    "description": "The max duration, in seconds, among a group of runs."
                  },
                  "min": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "x-nullable": true,
                    "description": "The minimum duration, in seconds, among a group of runs."
                  },
                  "p95": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "x-nullable": true,
                    "description": "The 95th percentile duration, in seconds, among a group of runs."
                  },
                  "mean": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "x-nullable": true,
                    "description": "The mean duration, in seconds, among a group of runs."
                  },
                  "median": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "x-nullable": true,
                    "description": "The median duration, in seconds, among a group of runs."
                  },
                  "standard_deviation": {
                    "type": "number",
                    "format": "float",
                    "x-nullable": true,
                    "description": "The standard deviation, in seconds, among a group of runs."
                  }
                },
                "description": "Metrics relating to the duration of runs for a workflow job."
              },
              "total_credits_used": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The total credits consumed by the job in the aggregation window. Note that Insights is not a real time financial reporting tool and should not be used for credit reporting."
              }
            },
            "description": "Metrics relating to a workflow job's runs."
          },
          "window_end": {
            "type": "string",
            "format": "date-time",
            "description": "The timestamp of the last build within the requested reporting window."
          },
          "window_start": {
            "type": "string",
            "format": "date-time",
            "description": "The timestamp of the first build within the requested reporting window."
          }
        }
      },
      "description": "Job summary metrics."
    },
    "next_page_token": {
      "type": "string",
      "x-nullable": true,
      "description": "A token to pass as a `page-token` query parameter to return the next page of results."
    }
  },
  "description": "Paginated workflow job summary metrics."
}
object InsightsGetProjectWorkflowJobMetricsdefaultResponse
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
object InsightsGetProjectWorkflowMetricsResponse
{
  "type": "object",
  "required": [
    "items",
    "next_page_token"
  ],
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "metrics",
          "window_start",
          "window_end",
          "project_id"
        ],
        "properties": {
          "name": {
            "type": "string",
            "example": "build-and-test",
            "description": "The name of the workflow."
          },
          "metrics": {
            "type": "object",
            "required": [
              "total_runs",
              "successful_runs",
              "mttr",
              "total_credits_used",
              "failed_runs",
              "success_rate",
              "duration_metrics",
              "total_recoveries",
              "throughput"
            ],
            "properties": {
              "mttr": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "x-nullable": true,
                "description": "The mean time to recovery (mean time between failures and their next success) in seconds."
              },
              "throughput": {
                "type": "number",
                "format": "float",
                "description": "The average number of runs per day."
              },
              "total_runs": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The total number of runs, including runs that are still on-hold or running."
              },
              "failed_runs": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The number of failed runs."
              },
              "success_rate": {
                "type": "number",
                "format": "float"
              },
              "successful_runs": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The number of successful runs."
              },
              "duration_metrics": {
                "type": "object",
                "required": [
                  "min",
                  "mean",
                  "median",
                  "p95",
                  "max",
                  "standard_deviation"
                ],
                "properties": {
                  "max": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "x-nullable": true,
                    "description": "The max duration, in seconds, among a group of runs."
                  },
                  "min": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "x-nullable": true,
                    "description": "The minimum duration, in seconds, among a group of runs."
                  },
                  "p95": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "x-nullable": true,
                    "description": "The 95th percentile duration, in seconds, among a group of runs."
                  },
                  "mean": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "x-nullable": true,
                    "description": "The mean duration, in seconds, among a group of runs."
                  },
                  "median": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "x-nullable": true,
                    "description": "The median duration, in seconds, among a group of runs."
                  },
                  "standard_deviation": {
                    "type": "number",
                    "format": "float",
                    "x-nullable": true,
                    "description": "The standard deviation, in seconds, among a group of runs."
                  }
                },
                "description": "Metrics relating to the duration of runs for a workflow."
              },
              "total_recoveries": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "x-nullable": true,
                "description": "The number of recovered workflow executions per day."
              },
              "total_credits_used": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "x-nullable": true,
                "description": "The total credits consumed by the workflow in the aggregation window. Note that Insights is not a real time financial reporting tool and should not be used for credit reporting."
              }
            },
            "description": "Metrics relating to a workflow's runs."
          },
          "project_id": {
            "description": "The unique ID of the project"
          },
          "window_end": {
            "type": "string",
            "format": "date-time",
            "description": "The timestamp of the last build within the requested reporting window."
          },
          "window_start": {
            "type": "string",
            "format": "date-time",
            "description": "The timestamp of the first build within the requested reporting window."
          }
        }
      },
      "description": "Workflow summary metrics."
    },
    "next_page_token": {
      "type": "string",
      "x-nullable": true,
      "description": "A token to pass as a `page-token` query parameter to return the next page of results."
    }
  },
  "description": "Paginated workflow summary metrics."
}
object InsightsGetProjectWorkflowMetricsdefaultResponse
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
object InsightsGetProjectWorkflowTestMetricsResponse
{
  "type": "object",
  "required": [
    "average_test_count",
    "most_failed_tests",
    "most_failed_tests_extra",
    "slowest_tests",
    "slowest_tests_extra",
    "total_test_runs",
    "test_runs"
  ],
  "properties": {
    "test_runs": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "pipeline_number",
          "workflow_id",
          "success_rate",
          "test_counts"
        ],
        "properties": {
          "test_counts": {
            "type": "object",
            "required": [
              "error",
              "failure",
              "skipped",
              "success",
              "total"
            ],
            "properties": {
              "error": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The number of tests with the error status"
              },
              "total": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The total number of tests"
              },
              "failure": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The number of tests with the failure status"
              },
              "skipped": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The number of tests with the skipped status"
              },
              "success": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The number of tests with the success status"
              }
            },
            "description": "Test counts for a given pipeline number"
          },
          "workflow_id": {
            "description": "The ID of the workflow associated with the provided test counts"
          },
          "success_rate": {
            "type": "number",
            "format": "float",
            "description": "The success rate calculated from test counts"
          },
          "pipeline_number": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "The number of the pipeline associated with the provided test counts"
          }
        }
      },
      "description": "Test counts grouped by pipeline number and workflow id"
    },
    "slowest_tests": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "failed_runs",
          "job_name",
          "p95_duration",
          "test_name",
          "file",
          "source",
          "classname",
          "total_runs",
          "flaky"
        ],
        "properties": {
          "file": {
            "type": "string",
            "x-nullable": true,
            "description": "The file the test belongs to."
          },
          "flaky": {
            "type": "boolean",
            "description": "Whether the test is flaky."
          },
          "source": {
            "type": "string",
            "x-nullable": true,
            "description": "The source of the test."
          },
          "job_name": {
            "type": "string",
            "description": "The name of the job."
          },
          "classname": {
            "type": "string",
            "x-nullable": true,
            "description": "The class the test belongs to."
          },
          "test_name": {
            "type": "string",
            "description": "The name of the test."
          },
          "total_runs": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "The total number of times the test was run."
          },
          "failed_runs": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "The number of times the test failed"
          },
          "p95_duration": {
            "type": "number",
            "format": "double",
            "x-nullable": true,
            "description": "The 95th percentile duration, in seconds, among a group of test runs."
          }
        }
      },
      "description": "Metrics for the slowest running tests"
    },
    "total_test_runs": {
      "type": "integer",
      "format": "int64",
      "minimum": 0,
      "description": "The total number of test runs"
    },
    "most_failed_tests": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "failed_runs",
          "job_name",
          "p95_duration",
          "test_name",
          "file",
          "source",
          "classname",
          "total_runs",
          "flaky"
        ],
        "properties": {
          "file": {
            "type": "string",
            "x-nullable": true,
            "description": "The file the test belongs to."
          },
          "flaky": {
            "type": "boolean",
            "description": "Whether the test is flaky."
          },
          "source": {
            "type": "string",
            "x-nullable": true,
            "description": "The source of the test."
          },
          "job_name": {
            "type": "string",
            "description": "The name of the job."
          },
          "classname": {
            "type": "string",
            "x-nullable": true,
            "description": "The class the test belongs to."
          },
          "test_name": {
            "type": "string",
            "description": "The name of the test."
          },
          "total_runs": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "The total number of times the test was run."
          },
          "failed_runs": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "The number of times the test failed"
          },
          "p95_duration": {
            "type": "number",
            "format": "double",
            "x-nullable": true,
            "description": "The 95th percentile duration, in seconds, among a group of test runs."
          }
        }
      },
      "description": "Metrics for the most frequently failing tests"
    },
    "average_test_count": {
      "type": "integer",
      "format": "int64",
      "minimum": 0,
      "description": "The average number of tests executed per run"
    },
    "slowest_tests_extra": {
      "type": "integer",
      "format": "int64",
      "minimum": 0,
      "description": "The number of tests with the same duration rate being omitted from slowest_tests"
    },
    "most_failed_tests_extra": {
      "type": "integer",
      "format": "int64",
      "minimum": 0,
      "description": "The number of tests with the same success rate being omitted from most_failed_tests"
    }
  },
  "description": "Project level test metrics response"
}
object InsightsGetProjectWorkflowTestMetricsdefaultResponse
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
object InsightsGetRecentWorkflowRunsResponse
{
  "type": "object",
  "required": [
    "items",
    "next_page_token"
  ],
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "branch",
          "duration",
          "created_at",
          "stopped_at",
          "credits_used",
          "status",
          "is_approval"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The unique ID of the workflow."
          },
          "branch": {
            "type": "string",
            "example": "main",
            "description": "The VCS branch of a Workflow's trigger."
          },
          "status": {
            "enum": [
              "success",
              "failed",
              "error",
              "canceled",
              "unauthorized"
            ],
            "type": "string",
            "x-nullable": true,
            "description": "Workflow status."
          },
          "duration": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "x-nullable": true,
            "description": "The duration in seconds of a run."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "The date and time the workflow was created."
          },
          "stopped_at": {
            "type": "string",
            "format": "date-time",
            "x-nullable": true,
            "description": "The date and time the workflow stopped."
          },
          "is_approval": {
            "type": "boolean",
            "example": false,
            "description": "Describes if the job is an approval job or not. Approval jobs are intermediary jobs that are created to pause the workflow until approved."
          },
          "credits_used": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "The number of credits used during execution. Note that Insights is not a real time financial reporting tool and should not be used for credit reporting."
          }
        }
      },
      "description": "Recent workflow runs."
    },
    "next_page_token": {
      "type": "string",
      "x-nullable": true,
      "description": "A token to pass as a `page-token` query parameter to return the next page of results."
    }
  },
  "description": "Paginated recent workflow runs."
}
object InsightsGetRecentWorkflowRunsdefaultResponse
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
object InsightsGetSummaryMetricsWithTrendsResponse
{
  "type": "object",
  "required": [
    "org_data",
    "org_project_data",
    "all_projects"
  ],
  "properties": {
    "org_data": {
      "type": "object",
      "required": [
        "metrics",
        "trends"
      ],
      "properties": {
        "trends": {
          "type": "object",
          "required": [
            "total_runs",
            "total_duration_secs",
            "total_credits_used",
            "success_rate",
            "throughput"
          ],
          "properties": {
            "throughput": {
              "type": "number",
              "format": "float",
              "description": "Trend value for the average number of runs per day."
            },
            "total_runs": {
              "type": "number",
              "format": "float",
              "description": "The trend value for total number of runs."
            },
            "success_rate": {
              "type": "number",
              "format": "float",
              "description": "The trend value for the success rate."
            },
            "total_credits_used": {
              "type": "number",
              "format": "float",
              "description": "The trend value for total credits consumed."
            },
            "total_duration_secs": {
              "type": "number",
              "format": "float",
              "description": "Trend value for total duration."
            }
          },
          "description": "Trends for a single org."
        },
        "metrics": {
          "type": "object",
          "required": [
            "total_runs",
            "total_duration_secs",
            "total_credits_used",
            "success_rate",
            "throughput"
          ],
          "properties": {
            "throughput": {
              "type": "number",
              "format": "float",
              "description": "The average number of runs per day."
            },
            "total_runs": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "description": "The total number of runs, including runs that are still on-hold or running."
            },
            "success_rate": {
              "type": "number",
              "format": "float"
            },
            "total_credits_used": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "description": "The total credits consumed over the current timeseries interval."
            },
            "total_duration_secs": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "description": "Total duration, in seconds."
            }
          },
          "description": "Metrics for a single org metrics."
        }
      },
      "description": "Aggregated metrics for an org, with trends."
    },
    "all_projects": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "x-nullable": true,
      "description": "A list of all the project names in the organization."
    },
    "org_project_data": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "project_name",
          "metrics",
          "trends"
        ],
        "properties": {
          "trends": {
            "type": "object",
            "required": [
              "total_credits_used",
              "total_duration_secs",
              "total_runs",
              "success_rate"
            ],
            "properties": {
              "total_runs": {
                "type": "number",
                "format": "float",
                "description": "The trend value for total number of runs."
              },
              "success_rate": {
                "type": "number",
                "format": "float",
                "description": "The trend value for the success rate."
              },
              "total_credits_used": {
                "type": "number",
                "format": "float",
                "description": "The trend value for total credits consumed."
              },
              "total_duration_secs": {
                "type": "number",
                "format": "float",
                "description": "Trend value for total duration."
              }
            },
            "description": "Trends for a single project, across all branches."
          },
          "metrics": {
            "type": "object",
            "required": [
              "total_credits_used",
              "total_duration_secs",
              "total_runs",
              "success_rate"
            ],
            "properties": {
              "total_runs": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The total number of runs, including runs that are still on-hold or running."
              },
              "success_rate": {
                "type": "number",
                "format": "float"
              },
              "total_credits_used": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "The total credits consumed over the current timeseries interval."
              },
              "total_duration_secs": {
                "type": "integer",
                "format": "int64",
                "minimum": 0,
                "description": "Total duration, in seconds."
              }
            },
            "description": "Metrics for a single project, across all branches."
          },
          "project_name": {
            "type": "string",
            "example": "api-preview-docs",
            "description": "The name of the project."
          }
        }
      },
      "description": "Metrics for a single project, across all branches"
    }
  },
  "description": "Summary metrics with trends for the entire org, and for each project."
}
object InsightsGetSummaryMetricsWithTrendsdefaultResponse
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
object InsightsGetWorkflowSummaryMetricsResponse
{
  "type": "object",
  "required": [
    "metrics",
    "trends",
    "workflow_names"
  ],
  "properties": {
    "trends": {
      "type": "object",
      "required": [
        "total_runs",
        "failed_runs",
        "success_rate",
        "p95_duration_secs",
        "median_duration_secs",
        "total_credits_used",
        "mttr",
        "throughput"
      ],
      "properties": {
        "mttr": {
          "type": "number",
          "format": "float",
          "description": "trend for mean time to recovery (mean time between failures and their next success)."
        },
        "throughput": {
          "type": "number",
          "format": "float",
          "description": "Trend value for the average number of runs per day."
        },
        "total_runs": {
          "type": "number",
          "format": "float",
          "description": "The trend value for total number of runs."
        },
        "failed_runs": {
          "type": "number",
          "format": "float",
          "description": "The trend value for number of failed runs."
        },
        "success_rate": {
          "type": "number",
          "format": "float",
          "description": "The trend value for the success rate."
        },
        "p95_duration_secs": {
          "type": "number",
          "format": "float",
          "description": "Trend value for the 95th percentile duration for a workflow for a given time window."
        },
        "total_credits_used": {
          "type": "number",
          "format": "float",
          "description": "The trend value for total credits consumed."
        },
        "median_duration_secs": {
          "type": "number",
          "format": "float",
          "description": "Trend value for the 50th percentile duration for a workflow for a given time window."
        }
      },
      "description": "Trends for aggregated metrics across a workflow for a given time window."
    },
    "metrics": {
      "type": "object",
      "required": [
        "total_runs",
        "successful_runs",
        "mttr",
        "total_credits_used",
        "failed_runs",
        "success_rate",
        "window_start",
        "duration_metrics",
        "window_end",
        "throughput",
        "completed_runs"
      ],
      "properties": {
        "mttr": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "x-nullable": true,
          "description": "The mean time to recovery (mean time between failures and their next success) in seconds."
        },
        "throughput": {
          "type": "number",
          "format": "float",
          "description": "The average number of runs per day."
        },
        "total_runs": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "description": "The total number of runs, including runs that are still on-hold or running."
        },
        "window_end": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp of the last build within the requested reporting window."
        },
        "failed_runs": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "description": "The number of failed runs."
        },
        "success_rate": {
          "type": "number",
          "format": "float"
        },
        "window_start": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp of the first build within the requested reporting window."
        },
        "completed_runs": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "x-nullable": true,
          "description": "The number of runs that ran to completion within the aggregation window"
        },
        "successful_runs": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "description": "The number of successful runs."
        },
        "duration_metrics": {
          "type": "object",
          "required": [
            "min",
            "mean",
            "median",
            "p95",
            "max",
            "standard_deviation"
          ],
          "properties": {
            "max": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "x-nullable": true,
              "description": "The max duration, in seconds, among a group of runs."
            },
            "min": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "x-nullable": true,
              "description": "The minimum duration, in seconds, among a group of runs."
            },
            "p95": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "x-nullable": true,
              "description": "The 95th percentile duration, in seconds, among a group of runs."
            },
            "mean": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "x-nullable": true,
              "description": "The mean duration, in seconds, among a group of runs."
            },
            "median": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "x-nullable": true,
              "description": "The median duration, in seconds, among a group of runs."
            },
            "standard_deviation": {
              "type": "number",
              "format": "float",
              "x-nullable": true,
              "description": "The standard deviation, in seconds, among a group of runs."
            }
          },
          "description": "Metrics relating to the duration of runs for a workflow."
        },
        "total_credits_used": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "x-nullable": true,
          "description": "The total credits consumed by the workflow in the aggregation window. Note that Insights is not a real time financial reporting tool and should not be used for credit reporting."
        }
      },
      "description": "Metrics aggregated across a workflow for a given time window."
    },
    "workflow_names": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "A list of all the workflow names for a given project."
    }
  },
  "description": "Workflow level aggregated metrics and trends response"
}
object InsightsGetWorkflowSummaryMetricsdefaultResponse
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
object InsightsListProjectBranchesResponse
{
  "type": "object",
  "required": [
    "org_id",
    "project_id",
    "branches"
  ],
  "properties": {
    "org_id": {
      "description": "The unique ID of the organization"
    },
    "branches": {
      "type": "array",
      "items": {
        "type": "string",
        "example": "main",
        "description": "The VCS branch of a workflow's trigger."
      },
      "description": "A list of all the branches for a given project."
    },
    "project_id": {
      "description": "The unique ID of the project"
    }
  },
  "description": "Project branches response."
}

Versions

Version Endpoints Schemas Ingested Status
v2 78 169 2026-05-11 current
v2 78 169 2026-04-16