Skip to main content

API Reference

The NativeBridge REST API enables you to programmatically upload apps, manage builds, generate magic links, and automate your mobile testing workflows.

📚 Full API Documentation

View our complete API reference with interactive examples on Postman

Key Features

App Management

Upload, update, and manage your app builds programmatically

Magic Links

Auto-generate shareable magic links for every build

CI/CD Integration

Integrate with GitHub Actions, GitLab CI, and other pipelines

Automation

Run automated tests with Appium and Maestro

Quick Start

Authentication

All API requests require authentication using your API key:
curl -X POST https://api.nativebridge.dev/v1/apps \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
Get your API key from the Dashboard → Settings → API Keys

Upload Your First App

curl -X POST https://api.nativebridge.dev/v1/apps/upload \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@path/to/your/app.apk" \
  -F "platform=android"
The response includes your magic link:
{
  "appId": "abc123",
  "magicLink": "https://nativebridge.io/app/abc123",
  "embedUrl": "https://nativebridge.io/embed/abc123",
  "status": "ready"
}

CI/CD Integration

Automatically create magic links for every commit to get instant preview links for your team:

GitHub Actions Example

name: Deploy to NativeBridge

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Build App
        run: |
          # Your build commands here
          ./gradlew assembleDebug  # Android
          # or
          # xcodebuild -scheme YourApp  # iOS

      - name: Upload to NativeBridge
        id: upload
        run: |
          response=$(curl -X POST https://api.nativebridge.dev/v1/apps/upload \
            -H "Authorization: Bearer ${{ secrets.NATIVEBRIDGE_API_KEY }}" \
            -F "file=@app/build/outputs/apk/debug/app-debug.apk" \
            -F "platform=android" \
            -F "buildMessage=${{ github.event.head_commit.message }}")

          echo "response=$response" >> $GITHUB_OUTPUT
          magic_link=$(echo $response | jq -r '.magicLink')
          echo "magic_link=$magic_link" >> $GITHUB_OUTPUT

      - name: Comment PR with Magic Link
        if: github.event_name == 'pull_request'
        uses: actions/github-script@v6
        with:
          script: |
            github.rest.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: `🚀 **App Preview Ready!**\n\nTest this build: ${{ steps.upload.outputs.magic_link }}\n\n_Powered by NativeBridge_`
            })
Create preview apps for every PR to streamline code reviews:

GitLab CI Example

deploy_preview:
  stage: deploy
  script:
    - |
      # Build your app
      ./gradlew assembleDebug

      # Upload to NativeBridge
      RESPONSE=$(curl -X POST https://api.nativebridge.dev/v1/apps/upload \
        -H "Authorization: Bearer $NATIVEBRIDGE_API_KEY" \
        -F "file=@app/build/outputs/apk/debug/app-debug.apk" \
        -F "platform=android" \
        -F "buildMessage=PR: $CI_MERGE_REQUEST_TITLE")

      # Extract magic link
      MAGIC_LINK=$(echo $RESPONSE | jq -r '.magicLink')

      # Post comment to MR
      curl -X POST "$CI_API_V4_URL/projects/$CI_PROJECT_ID/merge_requests/$CI_MERGE_REQUEST_IID/notes" \
        -H "PRIVATE-TOKEN: $GITLAB_TOKEN" \
        -d "body=🚀 **Preview App Ready**: $MAGIC_LINK"

  only:
    - merge_requests

Common API Endpoints

Core Operations

EndpointMethodDescription
/v1/apps/uploadPOSTUpload a new app or update existing
/v1/apps/{appId}GETGet app details and magic link
/v1/apps/{appId}/buildsGETList all builds for an app
/v1/apps/{appId}DELETEDelete an app
/v1/apps/{appId}/permissionsPUTUpdate app permissions

Automation & Testing

EndpointMethodDescription
/v1/sessions/startPOSTStart a new testing session
/v1/sessions/{sessionId}/screenshotGETCapture screenshot
/v1/sessions/{sessionId}/logsGETGet device logs
/v1/sessions/{sessionId}/stopPOSTEnd testing session
For complete endpoint documentation, request/response schemas, and interactive examples, visit our Postman Documentation

Use Cases

1. Continuous Deployment

Automatically deploy every commit:
// Node.js Example
const FormData = require('form-data');
const fs = require('fs');

async function deployToNativeBridge(appPath, commitMessage) {
  const form = new FormData();
  form.append('file', fs.createReadStream(appPath));
  form.append('platform', 'ios');
  form.append('buildMessage', commitMessage);

  const response = await fetch('https://api.nativebridge.dev/v1/apps/upload', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.NATIVEBRIDGE_API_KEY}`,
      ...form.getHeaders()
    },
    body: form
  });

  const result = await response.json();
  console.log(`Magic Link: ${result.magicLink}`);
  return result;
}

2. Nightly Build Distribution

Share nightly builds with your QA team:
# Python Example
import requests
import schedule
import time

def upload_nightly_build():
    with open('app-nightly.apk', 'rb') as f:
        files = {'file': f}
        data = {
            'platform': 'android',
            'buildMessage': f'Nightly Build - {time.strftime("%Y-%m-%d")}'
        }
        headers = {
            'Authorization': f'Bearer {API_KEY}'
        }

        response = requests.post(
            'https://api.nativebridge.dev/v1/apps/upload',
            files=files,
            data=data,
            headers=headers
        )

        magic_link = response.json()['magicLink']
        send_slack_notification(magic_link)  # Share with team

# Schedule nightly at 2 AM
schedule.every().day.at("02:00").do(upload_nightly_build)

3. Feature Branch Previews

Create previews for each feature branch:
#!/bin/bash
# deploy-preview.sh

BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
BUILD_MESSAGE="Feature: $BRANCH_NAME"

# Build app
./gradlew assembleDebug

# Upload and get magic link
RESPONSE=$(curl -s -X POST https://api.nativebridge.dev/v1/apps/upload \
  -H "Authorization: Bearer $NATIVEBRIDGE_API_KEY" \
  -F "file=@app/build/outputs/apk/debug/app-debug.apk" \
  -F "platform=android" \
  -F "buildMessage=$BUILD_MESSAGE")

MAGIC_LINK=$(echo $RESPONSE | jq -r '.magicLink')

echo "✅ Preview ready: $MAGIC_LINK"

# Update PR description or send to Slack

Best Practices

  • Security
  • Performance
  • Organization
  • Store API keys in environment variables or secrets management
  • Never commit API keys to version control
  • Use different API keys for production and development
  • Rotate API keys regularly

Rate Limits

PlanRequests/HourConcurrent UploadsMax App Size
Free601100 MB
Starter3003500 MB
Growth1000101 GB
CustomUnlimitedUnlimitedUnlimited

Error Handling

Common error responses and solutions:
{
  "error": "INVALID_FILE_FORMAT",
  "message": "File must be .apk, .app, or .ipa",
  "solution": "Ensure you're uploading a valid app file"
}
Check that your API key is valid and included in the Authorization header
Compress your app or upgrade to a higher plan for larger file limits
You’ve exceeded the rate limit. Wait and retry or upgrade your plan
Temporary issue on our end. Retry with exponential backoff

SDK & Libraries

Next Steps