Codemagic connects to a Nagent workspace with an API key. Once it is connected, agents can call 22 Codemagic actions, such as "Add Application from Private Repository", "Add New Application" and "Get Meta Information". Nothing is enabled on connect: each action is allowed one at a time, and an action with side effects runs or waits for a person according to the agent's level.
Every operation an agent can call against Codemagic, with input parameters and output schema.
CODEMAGIC_ADD_APPLICATION_FROM_PRIVATE_REPOTool to create an application from a private repository using SSH key authentication. Use when you need to add a new private repository to Codemagic with SSH credentials.
Input parameters
SSH key credentials required to access the private repository.
Team ID for direct app addition to a team. Requires admin privileges for the specified team.
Specify 'flutter-app' when adding Flutter applications. Omit for other project types.
SSH or HTTPS URL for cloning the private repository. For SSH URLs, use format: git@github.com:org/repo.git
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_ADD_NEW_APPLICATIONTool to add a Git repository to the applications list in Codemagic. Use when you need to add a new application to Codemagic from a repository URL.
Input parameters
Team ID, if you wish to add an app directly to one of your teams. You must be an admin in the team specified.
SSH or HTTPS URL for cloning the repository.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_API_V3_META_GET_METATool to get metadata about Codemagic including public IP addresses in use (in CIDR notation). Use when you need to retrieve IP blocks for whitelisting build machines or simulator network requests.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_API_V3_VARIABLE_GROUPS_VARIABLE_GROUP_ID_GET_GROUPTool to retrieve information about a specific variable group including its name and configuration settings. Use when you need to get details for a variable group by its ID.
Input parameters
The unique identifier for the variable group in MongoDB ObjectId format.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_API_V3_VARIABLE_GROUPS_VARIABLE_GROUP_ID_UPDATETool to change a variable group's name and security settings. Use when you need to update an existing variable group by its ID. Returns success confirmation on 204 No Content response.
Input parameters
The new name for the variable group.
Advanced security configuration for a variable group.
The unique identifier for the variable group in MongoDB ObjectId format.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_DELETE_ALL_APPLICATION_CACHESTool to delete all caches for a specific application. Use when clearing all cached data for an app. The deletion process is asynchronous and will complete after the API response is returned.
Input parameters
The application identifier
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_DELETE_SPECIFIC_CACHETool to delete a specific cache from an application. Use when a cached build artifact needs to be removed. The deletion is performed asynchronously and returns immediately with a 202 Accepted status.
Input parameters
The application identifier
The cache identifier to delete
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_GET_ALL_BUILDSTool to list all builds with optional filters for appId, workflowId, and branch. Use when you need to retrieve build history or search for specific builds. Supports pagination via the skip parameter.
Input parameters
Pagination offset for skipping results
Filter builds by application ID
Filter builds by git branch name
Filter builds by workflow ID. May return null for YAML-based workflows.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_GET_API_KEYTool to retrieve the API key for the authenticated user from the server. Use when you need to fetch the API key via the Codemagic API.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_GET_SHOREBIRD_METATool to retrieve information about Shorebird integration. Use when you need to check supported Flutter versions or the current Shorebird version.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_GET_USERTool to retrieve information about the currently authenticated user. Use when you need to get user ID, avatar URL, or check user permissions.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_GET_VARIABLE_GROUPSTool to retrieve paginated list of variable groups for an application. Use when you need to list or browse variable groups associated with a specific app.
Input parameters
The page number of the results to fetch. Minimum: 1, Default: 1.
The unique identifier for the application.
The maximum number of results per page. Range: 1-100, Default: 30.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_GET_VARIABLESTool to retrieve paginated list of variables for a specific variable group. Use when you need to list or browse environment variables within a variable group.
Input parameters
The page number of the results to fetch. Minimum: 1, Default: 1.
Search query to filter variables.
The maximum number of results per page. Range: 1-100, Default: 30.
The identifier for the variable group.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_INVITE_TEAM_MEMBERTool to invite a new team member to a Codemagic team. Use when you need to grant team access to a user. Requires team admin privileges. The 'developer' role corresponds to Member role and 'owner' role corresponds to Admin role in Codemagic UI.
Input parameters
The role to assign to the invited user. 'developer' corresponds to Member role in UI, 'owner' corresponds to Admin role in UI
The email address of the user to invite
The unique identifier of the team to invite the member to
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_RECEIVE_WEBHOOKTool to receive webhook payloads from Git providers to trigger builds automatically. Use when repository events (commits, pull requests, tags) need to trigger Codemagic builds programmatically.
Input parameters
Git reference (branch or tag) that triggered the webhook. Format: refs/heads/{branch} or refs/tags/{tag}
The application identifier for which to trigger the webhook. Found in the Codemagic browser URL after 'app/' when viewing your application.
Information about the user who triggered the webhook
Repository information containing the clone URL
Additional webhook payload data from the Git provider. This can contain provider-specific fields like commits, pull_request, etc.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_REMOVE_TEAM_MEMBERTool to remove a collaborator or revoke a pending invitation from a Codemagic team. Use when you need to revoke team access for a specific user or cancel a pending invitation. Supports both active members (MongoDB-style IDs) and pending invitations (UUID-style invitation codes).
Input parameters
The unique identifier of the team
The unique identifier of the user/collaborator to be removed, or the invitation code for pending invitations. Active members have MongoDB-style IDs (24 hex characters), while pending invitations have UUID-style IDs.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_RETRIEVE_ALL_APPLICATIONSTool to retrieve all applications added to Codemagic. Use when you need to list or browse all applications in the Codemagic account.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_RETRIEVE_AN_APPLICATIONTool to retrieve a single application by its unique identifier. Use when you need to get application details including name, branches, and workflow configuration.
Input parameters
The unique identifier for the application.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_RETRIEVE_CACHES_FOR_APPLICATIONTool to retrieve a list of caches for a specific application. Use when you need to view cached data, check cache sizes, or manage application storage.
Input parameters
The application identifier - unique ID of the application whose caches you want to retrieve
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_START_NEW_BUILDTool to start a new build for an application with specified workflow and branch or tag. Use when you need to trigger a build programmatically. Either branch or tag parameter must be provided.
Input parameters
Git tag name to build. Either branch or tag must be provided.
The application identifier
Git branch name to build. Either branch or tag must be provided.
Additional labels to attach to the build
Overrides for environment variables, variable groups, and software versions
The workflow identifier as specified in the YAML file
Machine type for build execution
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_STOP_PREVIEWTool to stop an app preview. Use when you need to stop a running app preview by its identifier.
Input parameters
The preview identifier to stop
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
CODEMAGIC_UPDATE_VARIABLETool to update an existing variable within a specified variable group in Codemagic. Use when you need to modify a variable's name, value, or secure status.
Input parameters
The variable's name. Provide this if you want to update the variable name.
The variable's value. Provide this if you want to update the variable value.
Whether the variable should be treated as secure (encrypted). Provide this if you want to change the secure status.
The identifier for the variable to be updated.
The identifier for the variable group containing the variable.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
Agents can call 22 Codemagic actions on Nagent, including "Add Application from Private Repository", "Add New Application" and "Get Meta Information". Add Application from Private Repository: Create an application from a private repository using SSH key authentication. Each action is listed on this page with its input parameters and its output.
Codemagic connects with an API key, under your workspace's own connection. Nothing is enabled on connect: each action is allowed one at a time and can be scoped to the agents that need it.
Add Application from Private Repository takes 2 required inputs: sshKey and repositoryUrl. It also takes 2 optional inputs: teamId and projectType. It returns data, error and successful.