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/apiAuthentication
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
| Method | Endpoint | Description |
|---|---|---|
GET | /teams | List your teams. |
POST | /teams | Create a team. |
GET | /teams/{teamId} | Get a team. |
PATCH | /teams/{teamId} | Update a team. |
DELETE | /teams/{teamId} | Delete a team. |
GET | /teams/{teamId}/members | List members. |
POST | /teams/{teamId}/members | Invite a member. |
PATCH | /teams/{teamId}/members/{userId} | Change a member's role. |
DELETE | /teams/{teamId}/members/{userId} | Remove a member. |
Applications
| Method | Endpoint | Description |
|---|---|---|
GET | /teams/{teamId}/apps | List a team's applications. |
POST | /teams/{teamId}/apps | Create 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.
| Method | Endpoint | Description |
|---|---|---|
GET | /apps/{appId}/config | Get the build configuration, from the repository or a local override. |
PUT | /apps/{appId}/config | Save a local override. |
DELETE | /apps/{appId}/config | Discard the override and go back to the repository file. |
GET | /apps/{appId}/files/tree | Browse the repository tree. |
GET | /apps/{appId}/files/branches | List branches. |
POST | /apps/{appId}/signing/setup | Resolve signing material for this app now, creating it through the App Store Connect API if needed. |
Builds
| Method | Endpoint | Description |
|---|---|---|
GET | /teams/{teamId}/builds | List builds across the team. |
GET | /apps/{appId}/builds | List an application's builds. |
POST | /apps/{appId}/builds | Trigger a build. |
GET | /builds/{buildId} | Get a build with its steps and artifacts. |
POST | /builds/{buildId}/cancel | Cancel a running build. |
GET | /builds/{buildId}/artifacts/{artifactId}/download | Download an artifact. |
Environment variables
Variables live in named groups that belong to one application. See Environment Variables.
| Method | Endpoint | Description |
|---|---|---|
GET | /apps/{appId}/variables | List the app's variable groups. |
POST | /apps/{appId}/variables | Create 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}/vars | Set a variable, creating or replacing it by name. |
DELETE | /apps/{appId}/variables/{groupId}/vars/{variableId} | Delete a variable. |
Workflows
| Method | Endpoint | Description |
|---|---|---|
GET | /apps/{appId}/workflows | List 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.
| Method | Endpoint | Description |
|---|---|---|
GET | /teams/{teamId}/codesigning/ios/certificates | List certificates. |
POST | /teams/{teamId}/codesigning/ios/certificates | Upload a .p12. |
POST | /teams/{teamId}/codesigning/ios/certificates/generate | Have Apple issue a distribution certificate. Returns the existing one if it is still valid. |
GET | /teams/{teamId}/codesigning/ios/certificates/remote | List the certificates in your Apple account, marking which can be used. |
POST | /teams/{teamId}/codesigning/ios/certificates/generate-csr | Generate a signing request for the manual flow. |
POST | /teams/{teamId}/codesigning/ios/certificates/{certId}/upload-cer | Complete the manual flow with the .cer from Apple. |
DELETE | /teams/{teamId}/codesigning/ios/certificates/{certId} | Delete a certificate. |
GET | /teams/{teamId}/codesigning/ios/profiles | List provisioning profiles. |
POST | /teams/{teamId}/codesigning/ios/profiles | Upload a .mobileprovision. |
GET | /teams/{teamId}/codesigning/ios/profiles/remote | List the profiles in your Apple account. |
POST | /teams/{teamId}/codesigning/ios/profiles/remote/import | Import selected profiles from Apple. |
DELETE | /teams/{teamId}/codesigning/ios/profiles/{profileId} | Delete a profile. |
GET / POST | /teams/{teamId}/codesigning/android/keystores | List or upload Android keystores. |
GET / POST | /teams/{teamId}/codesigning/google-play | List or upload Google Play service accounts. |
GET / POST | /teams/{teamId}/codesigning/appstore-connect | List or upload App Store Connect API keys. |
Integrations
| Method | Endpoint | Description |
|---|---|---|
GET | /integrations | List connected providers. |
DELETE | /integrations/{provider} | Disconnect a provider. |
GET | /integrations/github/repos | List your GitHub repositories. |
GET | /integrations/gitlab/repos | List your GitLab repositories. |
Billing and usage
| Method | Endpoint | Description |
|---|---|---|
GET | /plans | List available plans. |
GET | /billing | Your billing summary. |
GET | /usage | Your usage summary. |
GET | /balance | Current balance. |
GET | /balance/transactions | Balance history. |
GET | /teams/{teamId}/billing | A team's billing summary. |
GET | /teams/{teamId}/usage | A 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}/logsEach 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"
}| Status | Meaning |
|---|---|
400 | Invalid or missing input. |
401 | Missing or expired session token. |
403 | Authenticated, but not allowed to perform this action. |
404 | Not found — also returned for resources that exist but are not yours. |
500 | Something went wrong on our end. |