API Reference

BuildMagic exposes a REST API for managing applications, triggering builds and integrating with your own tools. The dashboard uses this same API, so anything it can do is available to you.

Base URL

https://buildmagic.dev/api

Authentication

Every endpoint below requires authentication. Pass your session token as a bearer token:

Authorization: Bearer <your-session-token>

The browser session cookie is accepted as well, which is how the dashboard authenticates. Tokens come from signing in — through GitHub or GitLab OAuth, or with email and password at POST /api/auth/login.

Access is scoped to the teams you belong to. A request for a team, app or build you cannot reach returns 404 rather than 403, so an identifier cannot be confirmed by probing.

Teams

MethodEndpointDescription
GET/teamsList your teams.
POST/teamsCreate a team.
GET/teams/{teamId}Get a team.
PATCH/teams/{teamId}Update a team.
DELETE/teams/{teamId}Delete a team.
GET/teams/{teamId}/membersList members.
POST/teams/{teamId}/membersInvite a member.
PATCH/teams/{teamId}/members/{userId}Change a member's role.
DELETE/teams/{teamId}/members/{userId}Remove a member.

Applications

MethodEndpointDescription
GET/teams/{teamId}/appsList a team's applications.
POST/teams/{teamId}/appsCreate an application.
GET/teams/{teamId}/apps/{appId}Get an application.
PATCH/teams/{teamId}/apps/{appId}Update an application.
DELETE/teams/{teamId}/apps/{appId}Delete an application.

Application-scoped resources hang off /apps/{appId} directly — the app identifier is enough to locate the team.

MethodEndpointDescription
GET/apps/{appId}/configGet the build configuration, from the repository or a local override.
PUT/apps/{appId}/configSave a local override.
DELETE/apps/{appId}/configDiscard the override and go back to the repository file.
GET/apps/{appId}/files/treeBrowse the repository tree.
GET/apps/{appId}/files/branchesList branches.
POST/apps/{appId}/signing/setupResolve signing material for this app now, creating it through the App Store Connect API if needed.

Builds

MethodEndpointDescription
GET/teams/{teamId}/buildsList builds across the team.
GET/apps/{appId}/buildsList an application's builds.
POST/apps/{appId}/buildsTrigger a build.
GET/builds/{buildId}Get a build with its steps and artifacts.
POST/builds/{buildId}/cancelCancel a running build.
GET/builds/{buildId}/artifacts/{artifactId}/downloadDownload an artifact.

Environment variables

Variables live in named groups that belong to one application. See Environment Variables.

MethodEndpointDescription
GET/apps/{appId}/variablesList the app's variable groups.
POST/apps/{appId}/variablesCreate a group.
GET/apps/{appId}/variables/{groupId}Get a group with its variables. Secret values come back masked.
DELETE/apps/{appId}/variables/{groupId}Delete a group.
PUT/apps/{appId}/variables/{groupId}/varsSet a variable, creating or replacing it by name.
DELETE/apps/{appId}/variables/{groupId}/vars/{variableId}Delete a variable.

Workflows

MethodEndpointDescription
GET/apps/{appId}/workflowsList workflows.
GET/apps/{appId}/workflows/{workflowId}Get a workflow.
PATCH/apps/{appId}/workflows/{workflowId}Update a workflow.

Code signing

Signing material belongs to the team. See Code Signing.

MethodEndpointDescription
GET/teams/{teamId}/codesigning/ios/certificatesList certificates.
POST/teams/{teamId}/codesigning/ios/certificatesUpload a .p12.
POST/teams/{teamId}/codesigning/ios/certificates/generateHave Apple issue a distribution certificate. Returns the existing one if it is still valid.
GET/teams/{teamId}/codesigning/ios/certificates/remoteList the certificates in your Apple account, marking which can be used.
POST/teams/{teamId}/codesigning/ios/certificates/generate-csrGenerate a signing request for the manual flow.
POST/teams/{teamId}/codesigning/ios/certificates/{certId}/upload-cerComplete the manual flow with the .cer from Apple.
DELETE/teams/{teamId}/codesigning/ios/certificates/{certId}Delete a certificate.
GET/teams/{teamId}/codesigning/ios/profilesList provisioning profiles.
POST/teams/{teamId}/codesigning/ios/profilesUpload a .mobileprovision.
GET/teams/{teamId}/codesigning/ios/profiles/remoteList the profiles in your Apple account.
POST/teams/{teamId}/codesigning/ios/profiles/remote/importImport selected profiles from Apple.
DELETE/teams/{teamId}/codesigning/ios/profiles/{profileId}Delete a profile.
GET / POST/teams/{teamId}/codesigning/android/keystoresList or upload Android keystores.
GET / POST/teams/{teamId}/codesigning/google-playList or upload Google Play service accounts.
GET / POST/teams/{teamId}/codesigning/appstore-connectList or upload App Store Connect API keys.

Integrations

MethodEndpointDescription
GET/integrationsList connected providers.
DELETE/integrations/{provider}Disconnect a provider.
GET/integrations/github/reposList your GitHub repositories.
GET/integrations/gitlab/reposList your GitLab repositories.

Billing and usage

MethodEndpointDescription
GET/plansList available plans.
GET/billingYour billing summary.
GET/usageYour usage summary.
GET/balanceCurrent balance.
GET/balance/transactionsBalance history.
GET/teams/{teamId}/billingA team's billing summary.
GET/teams/{teamId}/usageA team's usage summary.

Triggering a build

curl -X POST \
  https://buildmagic.dev/api/apps/{appId}/builds \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"branch": "main"}'

branch defaults to the application's default branch. The response carries the new build's id, which you can poll at /builds/{buildId}.

Streaming build logs

Logs stream over a WebSocket. On connect you receive the history so far, then new lines as they are produced:

wss://buildmagic.dev/ws/builds/{buildId}/logs

Each message carries the step it belongs to, the text, a stream marker (stdout or stderr) and a sequence number. Sequence numbers restart per step, so treat the pair of step and sequence as the identity of a line when reconnecting.

Error responses

Errors return JSON with an error field:

{
  "error": "Description of what went wrong"
}
StatusMeaning
400Invalid or missing input.
401Missing or expired session token.
403Authenticated, but not allowed to perform this action.
404Not found — also returned for resources that exist but are not yours.
500Something went wrong on our end.