OpenAPI Specification
openapi: 3.1.0
info:
title: Codemagic App Previews Builds API
version: v3.0
description: "\n# ℹ️ Overview\n\nWelcome to the Codemagic REST API. This API allows you to programmatically interact with [Codemagic's CI/CD](https://codemagic.io/) platform\nto manage your apps, trigger builds, access artifacts, and more.\n\n### Authentication\n\nAll API requests require authentication using a personal API token that is unique to each Codemagic user. The actions permitted by the token are determined by the user’s role within the team.\n\nYou can find your API token by navigating to **Teams > Personal Account > Integrations > Codemagic API > Show**.\n\nInclude your token in the request header:\n\n```\nx-auth-token: <your-api-token>\n```\n\n### Getting started\n\n1. Generate your API token from the Codemagic dashboard\n2. Explore the available endpoints in the sidebar\n3. Try out requests directly from this documentation\n\n### Rate limits\n\nCodemagic limits the number of API requests you can make within a specific amount of time to ensure the API remains\navailable for all users. Your personal rate limit is **5,000 requests per hour**.\n\nIf you exceed your rate limit, you will receive a `429` response, and the `ratelimit-remaining` header will be `0`.\nYou should not retry your request until after the time specified by the `ratelimit-reset` header.\n\n#### Checking the status of your rate limit\n\nYou can use the headers that are sent with each response to determine the current status of your rate limit.\n\n| **Header** | **Description** |\n| --- | --- |\n| ratelimit-limit | The maximum number of requests that you can make per hour. |\n| ratelimit-remaining | The number of requests remaining in the current rate limit window. |\n| ratelimit-reset | The number of seconds remaining until the current rate limit window resets. |\n\n### Help and support\n\n- Ask our [GitHub community](https://github.com/codemagic-ci-cd/codemagic-docs/discussions).\n- Our paying customers can get in touch with us via the in-app chat widget.\n You have to be logged in to see the chat icon (note that some ad blockers may block the chat widget).\n\n---\n© Nevercode Ltd. | All Rights Reserved | Codemagic is registered trademark of Nevercode Ltd. | [Terms](https://codemagic.io/terms)\n"
servers:
- url: https://codemagic.io/
x-internal: false
security:
- api_key: []
tags:
- name: Builds
description: REST API endpoints for builds.
external_docs: null
paths:
/api/v3/builds/{build_id}:
get:
tags:
- Builds
summary: Get build info
operationId: ApiV3BuildsBuildIdGetBuild
parameters:
- name: build_id
in: path
schema:
type: string
examples:
- 60a0b1c2d3e4f56789abcdef
required: true
deprecated: false
responses:
'200':
description: Request fulfilled, document follows
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/NoPagination_api.routes.builds.schemas.BuildSchema_'
'400':
description: Bad request syntax or unsupported method
content:
application/json:
schema:
properties:
status_code:
type: integer
detail:
type: string
extra:
additionalProperties: {}
type:
- 'null'
- object
- array
type: object
required:
- detail
- status_code
description: Validation Exception
examples:
- status_code: 400
detail: Bad Request
extra: {}
deprecated: false
/api/v3/builds/{build_id}/remote-access:
get:
tags:
- Builds
summary: Get build remote access info
operationId: ApiV3BuildsBuildIdRemoteAccessGetBuildRemoteAccess
parameters:
- name: build_id
in: path
schema:
type: string
examples:
- 60a0b1c2d3e4f56789abcdef
required: true
deprecated: false
responses:
'200':
description: Request fulfilled, document follows
headers: {}
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/NoPagination_api.routes.builds.schemas.RemoteAccessSchema_'
- {}
'400':
description: Bad request syntax or unsupported method
content:
application/json:
schema:
properties:
status_code:
type: integer
detail:
type: string
extra:
additionalProperties: {}
type:
- 'null'
- object
- array
type: object
required:
- detail
- status_code
description: Validation Exception
examples:
- status_code: 400
detail: Bad Request
extra: {}
'202':
description: Remote access is enabled but not yet available
'410':
description: Remote access is no longer available
deprecated: false
/api/v3/builds/{build_id}/actions:
get:
tags:
- Builds
summary: Get build actions
operationId: ApiV3BuildsBuildIdActionsGetBuildActions
parameters:
- name: build_id
in: path
schema:
type: string
examples:
- 60a0b1c2d3e4f56789abcdef
required: true
deprecated: false
- name: page_size
in: query
schema:
type: integer
maximum: 100.0
minimum: 1.0
description: The maximum number of results per page.
default: 30
description: The maximum number of results per page.
required: false
deprecated: false
allowEmptyValue: false
allowReserved: false
- name: page
in: query
schema:
type: integer
minimum: 1.0
description: The page number of the results to fetch.
default: 1
description: The page number of the results to fetch.
required: false
deprecated: false
allowEmptyValue: false
allowReserved: false
responses:
'200':
description: Request fulfilled, document follows
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ClassicPagination_api.routes.builds.schemas.BuildActionSchema_'
'400':
description: Bad request syntax or unsupported method
content:
application/json:
schema:
properties:
status_code:
type: integer
detail:
type: string
extra:
additionalProperties: {}
type:
- 'null'
- object
- array
type: object
required:
- detail
- status_code
description: Validation Exception
examples:
- status_code: 400
detail: Bad Request
extra: {}
deprecated: false
/api/v3/teams/{team_id}/builds:
get:
tags:
- Builds
summary: List team builds
operationId: ApiV3TeamsTeamIdBuildsListTeamBuilds
parameters:
- name: app_id
in: query
schema:
oneOf:
- {}
- type: 'null'
type: string
examples:
- 60a0b1c2d3e4f56789abcdef
required: false
deprecated: false
allowEmptyValue: false
allowReserved: false
- name: status
in: query
schema:
oneOf:
- $ref: '#/components/schemas/BuildStatusFilter'
- type: 'null'
enum:
- queued
- building
- finished
- failed
- canceled
- timeout
- skipped
required: false
deprecated: false
allowEmptyValue: false
allowReserved: false
- name: workflow_id
in: query
schema:
oneOf:
- type: string
- type: 'null'
required: false
deprecated: false
allowEmptyValue: false
allowReserved: false
- name: branch
in: query
schema:
oneOf:
- type: string
- type: 'null'
required: false
deprecated: false
allowEmptyValue: false
allowReserved: false
- name: tag
in: query
schema:
oneOf:
- type: string
- type: 'null'
required: false
deprecated: false
allowEmptyValue: false
allowReserved: false
- name: label
in: query
schema:
oneOf:
- items:
type: string
type: array
- type: 'null'
required: false
deprecated: false
allowEmptyValue: false
allowReserved: false
- name: cursor
in: query
schema:
oneOf:
- {}
- type: 'null'
description: A unique identifier after which the results should be returned.
description: A unique identifier after which the results should be returned.
required: false
deprecated: false
allowEmptyValue: false
allowReserved: false
- name: page_size
in: query
schema:
type: integer
maximum: 100.0
minimum: 1.0
description: The maximum number of results per page.
default: 30
description: The maximum number of results per page.
required: false
deprecated: false
allowEmptyValue: false
allowReserved: false
- name: team_id
in: path
schema:
type: string
required: true
deprecated: false
responses:
'200':
description: Request fulfilled, document follows
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/CursorPagination_bson.objectid.ObjectId_api.routes.team_builds.schemas.BuildSchema_'
'400':
description: Bad request syntax or unsupported method
content:
application/json:
schema:
properties:
status_code:
type: integer
detail:
type: string
extra:
additionalProperties: {}
type:
- 'null'
- object
- array
type: object
required:
- detail
- status_code
description: Validation Exception
examples:
- status_code: 400
detail: Bad Request
extra: {}
deprecated: false
components:
schemas:
builds_schemas_WorkflowSource:
type: string
enum:
- file
- ui
title: WorkflowSource
RemoteAccessVncSchema:
properties:
password:
type: string
port:
type: integer
host:
type: string
username:
type: string
type: object
required:
- host
- password
- port
- username
title: RemoteAccessVncSchema
AppStoreConnectTaskStatus:
type: string
enum:
- initiated
- pending
- processing
- finished
- timeout
- failed
title: AppStoreConnectTaskStatus
builds_schemas_CommitSchema:
properties:
hash:
oneOf:
- type: string
- type: 'null'
avatar_url:
oneOf:
- type: string
- type: 'null'
author_name:
oneOf:
- type: string
- type: 'null'
author_email:
oneOf:
- type: string
- type: 'null'
message:
oneOf:
- type: string
- type: 'null'
url:
oneOf:
- type: string
- type: 'null'
type: object
required: []
title: CommitSchema
NoPagination_api.routes.builds.schemas.RemoteAccessSchema_:
properties:
data:
$ref: '#/components/schemas/RemoteAccessSchema'
type: object
required:
- data
title: NoPagination[RemoteAccessSchema]
team_builds_schemas_WorkflowSource:
type: string
enum:
- file
- ui
title: WorkflowSource
team_builds_schemas_BuildSchema:
properties:
id:
type: string
examples:
- 60a0b1c2d3e4f56789abcdef
app_id:
type: string
workflow:
$ref: '#/components/schemas/team_builds_schemas_WorkflowSchema'
status:
$ref: '#/components/schemas/BuildStatus'
index:
type: integer
artifacts:
items:
$ref: '#/components/schemas/team_builds_schemas_ArtifactSchema'
type: array
labels:
items:
type: string
type: array
release_notes:
items:
$ref: '#/components/schemas/team_builds_schemas_ReleaseNoteSchema'
type: array
created_at:
type: string
format: date-time
commit:
oneOf:
- $ref: '#/components/schemas/team_builds_schemas_CommitSchema'
- type: 'null'
branch:
oneOf:
- type: string
- type: 'null'
tag:
oneOf:
- type: string
- type: 'null'
pull_request:
oneOf:
- $ref: '#/components/schemas/team_builds_schemas_PullRequestSchema'
- type: 'null'
app_store_connect_status:
oneOf:
- $ref: '#/components/schemas/AppStoreConnectTaskStatus'
- type: 'null'
started_at:
oneOf:
- type: string
format: date-time
- type: 'null'
finished_at:
oneOf:
- type: string
format: date-time
- type: 'null'
type: object
required:
- app_id
- artifacts
- created_at
- id
- index
- labels
- release_notes
- status
- workflow
title: BuildSchema
BuildStatus:
type: string
enum:
- initializing
- queued
- preparing
- fetching
- testing
- building
- publishing
- finishing
- finished
- failed
- canceled
- timeout
- skipped
title: BuildStatus
ClassicPagination_api.routes.builds.schemas.BuildActionSchema_:
properties:
data:
items:
$ref: '#/components/schemas/BuildActionSchema'
type: array
page_size:
type: integer
current_page:
type: integer
total_pages:
type: integer
type: object
required:
- current_page
- data
- page_size
- total_pages
title: ClassicPagination[BuildActionSchema]
team_builds_schemas_WorkflowSchema:
properties:
id:
type: string
source:
$ref: '#/components/schemas/team_builds_schemas_WorkflowSource'
name:
oneOf:
- type: string
- type: 'null'
type: object
required:
- id
- source
title: WorkflowSchema
BuildConfigSchema:
properties:
flutter_mode:
oneOf:
- type: string
- type: 'null'
shorebird_mode:
oneOf:
- type: string
- type: 'null'
flutter_version:
oneOf:
- type: string
- type: 'null'
xcode_version:
oneOf:
- type: string
- type: 'null'
platforms:
items:
type: string
type: array
type: object
required: []
title: BuildConfigSchema
RemoteAccessSshSchema:
properties:
script_url:
type: string
type: object
required:
- script_url
title: RemoteAccessSshSchema
builds_schemas_BuildSchema:
properties:
id:
type: string
examples:
- 60a0b1c2d3e4f56789abcdef
app_id:
type: string
workflow:
$ref: '#/components/schemas/builds_schemas_WorkflowSchema'
instance_type:
oneOf:
- type: string
- type: 'null'
status:
$ref: '#/components/schemas/BuildStatus'
index:
type: integer
artifacts:
items:
$ref: '#/components/schemas/builds_schemas_ArtifactSchema'
type: array
labels:
items:
type: string
type: array
release_notes:
items:
$ref: '#/components/schemas/builds_schemas_ReleaseNoteSchema'
type: array
created_at:
type: string
format: date-time
config:
$ref: '#/components/schemas/BuildConfigSchema'
remote_access_enabled:
type: boolean
commit:
oneOf:
- $ref: '#/components/schemas/builds_schemas_CommitSchema'
- type: 'null'
branch:
oneOf:
- type: string
- type: 'null'
tag:
oneOf:
- type: string
- type: 'null'
pull_request:
oneOf:
- $ref: '#/components/schemas/builds_schemas_PullRequestSchema'
- type: 'null'
app_store_connect_status:
oneOf:
- $ref: '#/components/schemas/AppStoreConnectTaskStatus'
- type: 'null'
build_inputs:
additionalProperties:
oneOf:
- type: string
- type: boolean
- type: integer
- type: number
type: object
started_at:
oneOf:
- type: string
format: date-time
- type: 'null'
finished_at:
oneOf:
- type: string
format: date-time
- type: 'null'
type: object
required:
- app_id
- artifacts
- config
- created_at
- id
- index
- labels
- release_notes
- remote_access_enabled
- status
- workflow
title: BuildSchema
BuildActionSchema:
properties:
id:
type: string
name:
type: string
type:
$ref: '#/components/schemas/BuildActionTypeSchema'
has_test_results:
type: boolean
script:
oneOf:
- type: string
- type: 'null'
status:
oneOf:
- $ref: '#/components/schemas/BuildActionStatus'
- type: 'null'
started_at:
oneOf:
- type: string
format: date-time
- type: 'null'
finished_at:
oneOf:
- type: string
format: date-time
- type: 'null'
type: object
required:
- has_test_results
- id
- name
- type
title: BuildActionSchema
team_builds_schemas_CommitSchema:
properties:
hash:
oneOf:
- type: string
- type: 'null'
avatar_url:
oneOf:
- type: string
- type: 'null'
author_name:
oneOf:
- type: string
- type: 'null'
author_email:
oneOf:
- type: string
- type: 'null'
message:
oneOf:
- type: string
- type: 'null'
url:
oneOf:
- type: string
- type: 'null'
type: object
required: []
title: CommitSchema
NoPagination_api.routes.builds.schemas.BuildSchema_:
properties:
data:
$ref: '#/components/schemas/builds_schemas_BuildSchema'
type: object
required:
- data
title: NoPagination[BuildSchema]
builds_schemas_PullRequestSchema:
properties:
number:
type: integer
source_branch:
type: string
destination_branch:
type: string
type: object
required:
- destination_branch
- number
- source_branch
title: PullRequestSchema
builds_schemas_ReleaseNoteSchema:
properties:
language:
type: string
text:
type: string
type: object
required:
- language
- text
title: ReleaseNoteSchema
BuildStatusFilter:
type: string
enum:
- queued
- building
- finished
- failed
- canceled
- timeout
- skipped
title: BuildStatusFilter
BuildActionTypeSchema:
type: string
enum:
- script
- preparing
- fetching
- restoring_cache
- installing_sdks
- post_clone
- setup_code_signing
- installing
- pre_test
- testing
- post_test
- pre_build
- building_android
- building_ios
- building_web
- building_macos
- building_linux
- building_windows
- post_build
- pre_publish
- publishing
- post_publish
- finishing
title: BuildActionTypeSchema
RemoteAccessSchema:
properties:
ssh:
$ref: '#/components/schemas/RemoteAccessSshSchema'
vnc:
$ref: '#/components/schemas/RemoteAccessVncSchema'
type: object
required:
- ssh
- vnc
title: RemoteAccessSchema
ArtifactType:
type: string
enum:
- aab
- aar
- apk
- app
- bundle
- coverage_binary
- coverage_data
- device_recording
- directory
- dsym
- flutter_drive_log
- flutter_web_build_dir
- glob_matched
- ios_uitest_package
- ios_xctest_package
- ipa
- jar
- lint_result
- linux_app
- log
- logcat
- msix
- pkg
- proguard_map
- ios_simulator_log
- snap
- static_lib
- sylph_artefact_dir
- test_results_bundle
- windows_exe
- xcarchive
- xcodebuild_log
title: ArtifactType
builds_schemas_WorkflowSchema:
properties:
id:
type: string
source:
$ref: '#/components/schemas/builds_schemas_WorkflowSource'
name:
oneOf:
- type: string
- type: 'null'
type: object
required:
- id
- source
title: WorkflowSchema
team_builds_schemas_PullRequestSchema:
properties:
number:
type: integer
source_branch:
type: string
destination_branch:
type: string
type: object
required:
- destination_branch
- number
- source_branch
title: PullRequestSchema
builds_schemas_ArtifactSchema:
properties:
name:
type: string
size_in_bytes:
type: integer
type:
$ref: '#/components/schemas/ArtifactType'
short_lived_download_url:
type: string
version_code:
oneOf:
- type: string
- type: 'null'
version_name:
oneOf:
- type: string
- type: 'null'
type: object
required:
- name
- short_lived_download_url
- size_in_bytes
- type
title: ArtifactSchema
CursorPagination_bson.objectid.ObjectId_api.routes.team_builds.schemas.BuildSchema_:
properties:
data:
items:
$ref: '#/components/schemas/team_builds_schemas_BuildSchema'
type: array
page_size:
type: integer
cursor:
oneOf:
- {}
- type: 'null'
type: object
required:
- data
- page_size
title: CursorPagination[ObjectId, BuildSchema]
team_builds_schemas_ArtifactSchema:
properties:
name:
type: string
size_in_bytes:
type: integer
type:
$ref: '#/components/schemas/ArtifactType'
short_lived_download_url:
type: string
version_code:
oneOf:
- type: string
- type: 'null'
version_name:
oneOf:
- type: string
- type: 'null'
type: object
required:
- name
- short_lived_download_url
- size_in_bytes
- type
title: ArtifactSchema
BuildActionStatus:
type: string
enum:
- success
- failed
- skipped
- canceled
title: BuildActionStatus
team_builds_schemas_ReleaseNoteSchema:
properties:
language:
type: string
text:
type: string
type: object
required:
- language
- text
title: ReleaseNoteSchema
securitySchemes:
api_key:
type: apiKey
name: x-auth-token
in: header