API Reference

Upload a Build

POST https://api.copilot.mobile.dev/v2/project/{id}/build

This endpoint should be used to upload a mobile application (.apk for Android, .zip for iOS). The response includes the unique identifier of the build (build ID), used for other APIs.

You can also include a list of tags (separated by comma ,) to add to the build.

Header Parameters

NameTypeValue

Content-Length

integer

The size in bytes of the file

Content-Type

string

multipart/form-data

Content-Disposition

string

Content disposition with valid filename ending in .zip or .apk Example: form-data; name="file"; filename="filename.apk"

Path Parameters

NameTypeValue

id

string

The project ID (Prefixed with proj_)

Request Body

Single file in its binary format:

"file": Binary file

Additional form values:

"tags": List of tags for that build separated by comma

Examples

curl https://api.copilot.mobile.dev/v2/project/proj_01hrv/build \
    -F "file=@/path/to/app/android.apk" \
    -F "tags=tag1,tag2,tag3" \
    -u ":" 

Responses

{
  "id": "bd_01hq3arydfenz9s3f0ytd7yv3k"
}

Triggering a Test Suite

POST https://api.copilot.mobile.dev/v2/project/{id}/run

This endpoint should be used to trigger all the Test Cases of a given Test Suite with a specified build, if there is any test case already running it will stop and start a new test run. The response includes the unique identifier of each test case (Test Case ID), alongside either the Run ID in case of success or an error if it failed for any reason.

To specify the build you can either use the Build ID or a Build Tag. If the Tag is used, the most recent build of that Tag will be used.

Path Parameters

NameTypeValue

id

string

The project ID (Prefixed with proj_)

Request Body

The request body is a JSON format with the following parameters

NameTypeValue

testSuiteId

string

The Test Suite ID (Prefixed with ts_)

buildTag

string

A Build Tag specified when a build was uploaded. Cannot be used with buildId

buildId

string

The Build ID (Prefixed with bd_). Cannot be used with buildTag

Request Body Example:

{
  "buildTag": "nightly"
  "testSuiteId": "ts_01h3w"
}

Examples

curl https://api.copilot.mobile.dev/v2/project/proj_01hrv/run \
    -d '{
        "buildTag": "nightly",
        "testSuiteId": "ts_01hv2"
    }' \
    -u "sk_live_3afBO...1ewM:" \
    -H "Content-Type: application/json"

Responses

{
  "testCases": [
    {
      "id": "req_01hq1cdv3tevtrm4h3he9bp0hq",
      "runId": "run_01hq3f70fxeb1bx2esmpqq8fmr",
      "status": "PENDING"
    },
    {
      "id": "run_02fq3vdc8vktemh1a2gpa3910b",
      "error": "Quota exceeded (max_runs_per_month)"
    }
  ]
}

Last updated