API Reference

Complete REST API documentation for CodePush Multi-Tenant server

REST API Documentation

Comprehensive API reference for integrating with CodePush Multi-Tenant server.

Base URL

https://your-codepush-server.com/api/v1

Authentication

All API requests require authentication using an access token in the Authorization header:

Authorization: Bearer YOUR_ACCESS_TOKEN
Access Tokens

POST /auth/tokens

Create a new access token for CLI or programmatic access.

Request Body:
{
  "friendlyName": "My CLI Token",
  "ttl": 86400000
}
Response:
{
  "accessToken": "abc123...",
  "friendlyName": "My CLI Token",
  "expires": "2024-01-01T00:00:00Z"
}

GET /auth/tokens

List all access tokens for the authenticated user.

DELETE /auth/tokens/:tokenName

Revoke a specific access token.

Applications

GET /apps

Get all applications for the authenticated user's organization.

Response:
{
  "apps": [
    {
      "name": "MyApp-iOS",
      "platform": "ios",
      "deployments": ["Production", "Staging"],
      "collaborators": [
        {
          "email": "user@example.com",
          "permission": "Owner"
        }
      ]
    }
  ]
}

POST /apps

Create a new application.

Request Body:
{
  "name": "MyApp-iOS",
  "platform": "ios"
}
Response:
{
  "app": {
    "name": "MyApp-iOS",
    "platform": "ios",
    "deployments": ["Production", "Staging"]
  }
}

DELETE /apps/:appName

Delete an application and all its deployments.

PATCH /apps/:appName

Update application properties.

Request Body:
{
  "name": "MyApp-iOS-Renamed"
}
Deployments

GET /apps/:appName/deployments

Get all deployments for a specific application.

Response:
{
  "deployments": [
    {
      "name": "Production",
      "key": "deployment-key-123",
      "package": {
        "appVersion": "1.0.0",
        "description": "Bug fixes and improvements",
        "label": "v1",
        "packageHash": "abc123...",
        "blobUrl": "https://...",
        "size": 1024000,
        "releaseMethod": "Upload",
        "uploadTime": 1640995200000
      }
    }
  ]
}

POST /apps/:appName/deployments

Create a new deployment for an application.

Request Body:
{
  "name": "Staging"
}

DELETE /apps/:appName/deployments/:deploymentName

Delete a deployment.

PATCH /apps/:appName/deployments/:deploymentName

Update deployment properties.

Releases

POST /apps/:appName/deployments/:deploymentName/release

Release a new package to a deployment.

Request Body (multipart/form-data):
package: [binary file]
packageInfo: {
  "appVersion": "1.0.0",
  "description": "Bug fixes and improvements",
  "isMandatory": false,
  "rollout": 100
}

GET /apps/:appName/deployments/:deploymentName/releases

Get release history for a deployment.

Response:
{
  "releases": [
    {
      "label": "v1",
      "appVersion": "1.0.0",
      "description": "Bug fixes and improvements",
      "isMandatory": false,
      "rollout": 100,
      "size": 1024000,
      "uploadTime": 1640995200000,
      "metrics": {
        "totalActive": 1000,
        "downloaded": 950,
        "installed": 900,
        "failed": 5
      }
    }
  ]
}

PATCH /apps/:appName/deployments/:deploymentName/releases/:label

Update release properties (rollout percentage, mandatory status).

Request Body:
{
  "rollout": 50,
  "isMandatory": true
}
Collaborators

GET /apps/:appName/collaborators

Get all collaborators for an application.

POST /apps/:appName/collaborators

Add a collaborator to an application.

Request Body:
{
  "email": "user@example.com",
  "permission": "Collaborator"
}

DELETE /apps/:appName/collaborators/:email

Remove a collaborator from an application.

Error Responses

All endpoints return standardized error responses:

{
  "error": {
    "code": "InvalidParameter",
    "message": "The specified parameter is invalid",
    "details": {
      "parameter": "appName",
      "reason": "Name already exists"
    }
  }
}

HTTP Status Codes

  • 200 - Success
  • 201 - Created
  • 400 - Bad Request
  • 401 - Unauthorized
  • 403 - Forbidden
  • 404 - Not Found
  • 409 - Conflict
  • 500 - Internal Server Error

Rate Limiting

API requests are rate limited to:

  • 1000 requests per hour for authenticated users
  • 60 requests per hour for unauthenticated requests

Rate limit headers are included in responses:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640998800

Webhooks

Configure webhooks to receive notifications about deployment events:

Webhook Payload Example:
{
  "event": "deployment.released",
  "app": "MyApp-iOS",
  "deployment": "Production",
  "release": {
    "label": "v1",
    "appVersion": "1.0.0",
    "description": "Bug fixes and improvements"
  },
  "timestamp": "2024-01-01T00:00:00Z"
}