Codemagic
App · 24 actions
Start and cancel Codemagic builds, read their steps and artifacts, share artifacts by link, manage apps, variable groups and caches, and follow new, successful and failed builds.
Actions
| Action | What it does |
|---|---|
| Add app | Add a Git repository to Codemagic as an app, optionally in a team. |
| Add variables | Add environment variables to a variable group, optionally as secure (hidden) values. |
| Cancel build | Cancel a build that hasn't finished. |
| Create artifact public link | Make a download link for a build artifact that anyone can open until it expires. |
| Create variable group | Create a group of environment variables for an app's builds. |
| Delete cache | Delete one of an app's build caches, so the workflow's next build starts without it. |
| Delete variable | Delete one variable from a variable group. |
| Delete variable group | Delete a variable group and all its variables. |
| Get app | Get an app's name, branches and Workflow Editor workflows. |
| Get build | Get a build's status, workflow, commit, artifacts and timing. |
| Get current user | Get the Codemagic user the API token belongs to. |
| Get variable group | Get a variable group's name. |
| List apps | List the apps you can reach, optionally by name. |
| List build steps | List a build's steps, such as fetching, testing and publishing, with how each ended. |
| List builds | List a team's builds, newest first, by app, workflow, branch, tag, label or status. |
| List caches | List an app's stored build caches, by workflow, with their size and last use. |
| List team apps | List a team's apps with their repository and project type. |
| List team members | List a team's members with their team roles and app access. |
| List teams | List your personal account and the teams you belong to. |
| List variable groups | List an app's groups of environment variables. |
| List variables | List a variable group's variables. |
| List workflows | List an app's workflows, from the Workflow Editor or codemagic.yaml. |
| Start build | Queue a build of an app's workflow on a branch or tag, with extra variables, labels or machine. |
| Update variable | Change a variable's name, value or whether it is secure. |
Add app
Add a Git repository to Codemagic as an app, optionally in a team.
Inputs
- Repository URL
repository_urltextRequired - The repository's SSH or HTTPS clone URL, such as git@github.com:acme/app.git.
- Team
teamtext - The team to add it to. You must be an admin of it. Leave empty for your personal account.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"_id": "example",
"appName": "example"
}
}Add variables
Add environment variables to a variable group, optionally as secure (hidden) values.
Inputs
- Variable group ID
variable_group_idtextRequired - The variable group's ID, as Create variable group or List variable groups gives it.
- Variables
variablesobjectRequired - The variables to add, as name and value pairs, such as API_URL.
- Secure
securetrue/false - Store the values encrypted, so nobody can read them back. Leave off for readable values.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"added": [
"example"
],
"secure": true
}
}Cancel build
Cancel a build that hasn't finished. A finished build is left as it is.
Inputs
- Build ID
build_idtextRequired - The build's ID, as Start build or List builds gives it.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {}
}Create artifact public link
Make a download link for a build artifact that anyone can open until it expires.
Inputs
- Artifact link
artifact_urltextRequired - The artifact's link in Codemagic, which starts with https://api.codemagic.io/artifacts/.
- Expires at
expires_atdate and timeRequired - When the public link stops working.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"expiresAt": "example",
"url": "example"
}
}Create variable group
Create a group of environment variables for an app's builds.
Inputs
- App
app_idtextRequired - The Codemagic app.
- Name
nametextRequired - The group's name, such as production. It can't contain . or $.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"data": {
"id": "example",
"name": "example"
}
}
}Delete cache
Delete one of an app's build caches, so the workflow's next build starts without it.
Inputs
- App
app_idtextRequired - The Codemagic app.
- Cache
cache_idtextRequired - The cache.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"caches": [
"example"
],
"message": "example"
}
}Delete variable
Delete one variable from a variable group.
Inputs
- Variable group ID
variable_group_idtextRequired - The variable group's ID, as Create variable group or List variable groups gives it.
- Variable
variable_idtextRequired - The variable.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {}
}Delete variable group
Delete a variable group and all its variables. This can't be undone.
Inputs
- Variable group ID
variable_group_idtextRequired - The variable group's ID, as Create variable group or List variable groups gives it.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {}
}Get app
Get an app's name, branches and Workflow Editor workflows.
Inputs
- App
app_idtextRequired - The Codemagic app.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"application": {
"_id": "example",
"appName": "example",
"branches": [
"example"
],
"workflowIds": [
"example"
],
"workflows": {}
}
}
}Get build
Get a build's status, workflow, commit, artifacts and timing.
Inputs
- Build ID
build_idtextRequired - The build's ID, as Start build or List builds gives it.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"data": {
"app_id": "example",
"artifacts": [
{
"name": "example",
"short_lived_download_url": "example",
"size_in_bytes": 1,
"type": "example",
"version_code": "example",
"version_name": "example"
}
],
"branch": "example",
"build_inputs": {},
"commit": {
"author_email": "example",
"author_name": "example",
"hash": "example",
"message": "example",
"url": "example"
},
"config": {
"flutter_mode": "example",
"flutter_version": "example",
"platforms": [
"example"
],
"xcode_version": "example"
},
"created_at": "example",
"finished_at": "example",
"id": "example",
"index": 1,
"instance_type": "example",
"labels": [
"example"
],
"priority": 1,
"pull_request": {
"destination_branch": "example",
"number": 1,
"source_branch": "example"
},
"remote_access_enabled": true,
"started_at": "example",
"status": "example",
"tag": "example",
"workflow": {
"id": "example",
"name": "example",
"source": "example"
}
}
}
}Get current user
Get the Codemagic user the API token belongs to.
Inputs
None.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"data": {
"avatar_url": "example",
"email": "example",
"id": "example",
"name": "example"
}
}
}Get variable group
Get a variable group's name.
Inputs
- Variable group ID
variable_group_idtextRequired - The variable group's ID, as Create variable group or List variable groups gives it.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"data": {
"id": "example",
"name": "example"
}
}
}List apps
List the apps you can reach, optionally by name.
Inputs
- Name
nametext - Only apps whose name contains every word of this.
- Page
pagenumber - Which page of apps to read, starting at 1.At least 1.
- Per page
page_sizenumber - How many apps to return on a page, up to 100. Codemagic's default is 30.From 1 to 100.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"current_page": 1,
"data": [
{
"archived": true,
"icon_url": "example",
"id": "example",
"last_build_id": "example",
"name": "example"
}
],
"page_size": 1,
"total_pages": 1
}
}List build steps
List a build's steps, such as fetching, testing and publishing, with how each ended.
Inputs
- Build ID
build_idtextRequired - The build's ID, as Start build or List builds gives it.
- Page
pagenumber - Which page of steps to read, starting at 1.At least 1.
- Per page
page_sizenumber - How many steps to return on a page, up to 100. Codemagic's default is 30.From 1 to 100.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"current_page": 1,
"data": [
{
"finished_at": "example",
"has_test_results": true,
"id": "example",
"name": "example",
"script": "example",
"started_at": "example",
"status": "example",
"type": "example"
}
],
"page_size": 1,
"total_pages": 1
}
}List builds
List a team's builds, newest first, by app, workflow, branch, tag, label or status.
Inputs
- Team
teamtextRequired - The Codemagic team. Your personal account is listed as a team too.
- App
app_idtext - Only builds of this app.
- Workflow
workflowtext - Only builds of this workflow.
- Branch
branchtext - Only builds of this branch.
- Tag
tagtext - Only builds of this tag.
- Labels
labellist - Only builds with these labels.
- Status
statustext - Only builds with this status. In progress covers every build that hasn't ended.One of:
queued,waiting,building(In progress),finished(Finished successfully),failed,canceled,timeout(Timed out),skipped. - Cursor
cursortext - The cursor from the last answer, to read the next page.
- Per page
page_sizenumber - How many builds to return, up to 100. Codemagic's default is 30.From 1 to 100.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"cursor": "example",
"data": [
{
"app_id": "example",
"artifacts": [
{
"name": "example",
"short_lived_download_url": "example",
"size_in_bytes": 1,
"type": "example",
"version_code": "example",
"version_name": "example"
}
],
"branch": "example",
"commit": {
"author_email": "example",
"author_name": "example",
"hash": "example",
"message": "example",
"url": "example"
},
"created_at": "example",
"finished_at": "example",
"id": "example",
"index": 1,
"labels": [
"example"
],
"priority": 1,
"pull_request": {
"destination_branch": "example",
"number": 1,
"source_branch": "example"
},
"started_at": "example",
"status": "example",
"tag": "example",
"workflow": {
"id": "example",
"name": "example",
"source": "example"
}
}
],
"page_size": 1
}
}List caches
List an app's stored build caches, by workflow, with their size and last use.
Inputs
- App
app_idtextRequired - The Codemagic app.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"caches": [
{
"_id": "example",
"appId": "example",
"lastUsed": "example",
"size": 1,
"workflowId": "example"
}
]
}
}List team apps
List a team's apps with their repository and project type.
Inputs
- Team
teamtextRequired - The Codemagic team. Your personal account is listed as a team too.
- Name
nametext - Only apps whose name contains every word of this.
- Page
pagenumber - Which page of apps to read, starting at 1.At least 1.
- Per page
page_sizenumber - How many apps to return on a page, up to 100. Codemagic's default is 30.From 1 to 100.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"current_page": 1,
"data": [
{
"archived": true,
"icon_url": "example",
"id": "example",
"last_build_id": "example",
"name": "example",
"project_type": "example",
"repository": {
"url": "example"
},
"settings_source": "example"
}
],
"page_size": 1,
"total_pages": 1
}
}List team members
List a team's members with their team roles and app access.
Inputs
- Team
teamtextRequired - The Codemagic team. Your personal account is listed as a team too.
- Roles
rolelist - Only members with these roles.One or more of:
owner,admin,member,app_developer(App developer),app_viewer(App viewer). - Page
pagenumber - Which page of members to read, starting at 1.At least 1.
- Per page
page_sizenumber - How many members to return on a page, up to 100. Codemagic's default is 30.From 1 to 100.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"current_page": 1,
"data": [
{
"app_grants": [
{
"app_id": "example",
"role": "example"
}
],
"avatar_url": "example",
"created_at": "example",
"email": "example",
"id": "example",
"name": "example",
"team_roles": [
"example"
]
}
],
"page_size": 1,
"total_pages": 1
}
}List teams
List your personal account and the teams you belong to.
Inputs
- Page
pagenumber - Which page of teams to read, starting at 1.At least 1.
- Per page
page_sizenumber - How many teams to return on a page, up to 100. Codemagic's default is 30.From 1 to 100.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"current_page": 1,
"data": [
{
"created_at": "example",
"icon_url": "example",
"id": "example",
"name": "example",
"personal": true
}
],
"page_size": 1,
"total_pages": 1
}
}List variable groups
List an app's groups of environment variables.
Inputs
- App
app_idtextRequired - The Codemagic app.
- Page
pagenumber - Which page of groups to read, starting at 1.At least 1.
- Per page
page_sizenumber - How many groups to return on a page, up to 100. Codemagic's default is 30.From 1 to 100.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"current_page": 1,
"data": [
{
"id": "example",
"name": "example"
}
],
"page_size": 1,
"total_pages": 1
}
}List variables
List a variable group's variables. Secure values come back hidden.
Inputs
- Variable group ID
variable_group_idtextRequired - The variable group's ID, as Create variable group or List variable groups gives it.
- Search
searchtext - Only variables matching this text.
- Page
pagenumber - Which page of variables to read, starting at 1.At least 1.
- Per page
page_sizenumber - How many variables to return on a page, up to 100. Codemagic's default is 30.From 1 to 100.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"current_page": 1,
"data": [
{
"id": "example",
"name": "example",
"secure": true,
"value": "example"
}
],
"page_size": 1,
"total_pages": 1
}
}List workflows
List an app's workflows, from the Workflow Editor or codemagic.yaml.
Inputs
- App
app_idtextRequired - The Codemagic app.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"data": [
{
"id": "example",
"name": "example",
"source": "example"
}
]
}
}Start build
Queue a build of an app's workflow on a branch or tag, with extra variables, labels or machine.
Inputs
- App
app_idtextRequired - The Codemagic app.
- Workflow
workflowtextRequired - The workflow to build: its key in codemagic.yaml, or a Workflow Editor workflow.
- Build a
ref_typetext - Whether to build a branch or a tag. Leave empty for a branch.One of:
branch,tag. Default:branch. - Branch or tag
reftextRequired - The branch or tag to build, such as main or v1.2.0.
- Environment variables
variablesobject - Environment variables for the build, by name.
- Variable groups
variable_groupslist - Variable groups to make available to the build, by name.
- Workflow inputs
inputsobject - Values for the workflow's inputs, by input name.
- Labels
labelslist - Labels to tag the build with.
- Machine
instance_typetext - The build machine. Leave empty for the workflow's own.One of:
mac_mini_m2(Mac mini M2),mac_mini_m4(Mac mini M4),mac_studio_m4_max(Mac Studio M4 Max),linux_x2(Linux X2),linux_x4(Linux X4),windows_x2(Windows X2). - Priority
prioritynumber - From 0 to 10: the team's builds with a higher priority start first.From 0 to 10.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {
"data": {
"id": "example"
}
}
}Update variable
Change a variable's name, value or whether it is secure. Only the fields filled in change.
Inputs
- Variable group ID
variable_group_idtextRequired - The variable group's ID, as Create variable group or List variable groups gives it.
- Variable
variable_idtextRequired - The variable.
- Name
nametext - The variable's new name.
- Value
valuetext - The variable's new value.
- Secure
securetrue/false - Store the value encrypted, so nobody can read it back.
Outputs
dataobject- The response from Codemagic.
Example output
{
"data": {}
}