Unity Cloud Build

NOTE: As of February 15, 2023, any automation using this API should support redirects for all endpoints to avoid any disruptions in the future.

This API is intended to be used in conjunction with Unity Cloud Build.

Making requests

This website is built to allow requests to be made against the API. If you are currently logged into Cloud Build you should be able to make requests without entering an API key.

You can find your API key in the Unity Cloud Services portal by clicking on 'Cloud Build Preferences' in the sidebar. Copy the API Key and paste it into the upper left corner of this website. It will be used in all subsequent requests.

Clients

The Unity Cloud Build API is based upon Swagger. Client libraries to integrate with your projects can easily be generated with the Swagger Code Generator.

The JSON schema required to generate a client for this API version is located here:

https://build-api.cloud.unity3d.com/api/v1/api.json

Authorization

The Unity Cloud Build API requires an access token from your Unity Cloud Build account, which can be found by selecting Settings under DevOps > Cloud Build at https://dashboard.unity3d.com/cloud-build

To authenticate requests, include a Basic Authentication header with your API key as the value. e.g.

Authorization: Basic [YOUR API KEY]

Pagination

Paged results will take two parameters. A page number that is calculated based upon the per_page amount. For instance if there are 40 results and you specify page 2 with per_page set to 10 you will receive records 11-20.

Paged results will also return a Content-Range header. For the example above the content range header would look like this:

Content-Range: items 11-20/40

Versioning

The API version is indicated in the request URL. Upgrading to a newer API version can be done by changing the path.

The API will receive a new version in the following cases:

  • removal of a path or request type
  • addition of a required field
  • removal of a required field

The following changes are considered backwards compatible and will not trigger a new API version:

  • addition of an endpoint or request type
  • addition of an optional field
  • removal of an optional field
  • changes to the format of ids

Identifiers

It should not be assumed that any of the identifiers used in paths will be a perfect match for your user-entered information. If you see unexpected 403s or 404s from API calls then check your identifiers match the ones used by the API. In particular, projectId does NOT typically change when the project is renamed and in fact may not be a direct match for the project name even at initial creation time.

To avoid confusion we recommend that instead of using the human-readable autogenerated orgId and projectId available from the API you should instead use:

  • org foreign key for orgId (available from project APIs as orgFk and org APIs as coreForeignKey)
  • guid for projectId

All links generated by the API and the Dashboard should follow this format already, making it easy to figure out the correct parameters by making a comparison.

Rate Limiting

Requests against the Cloud Build API are limited to a rate of 100 per minute. To preserve the quality of service throughout Cloud Build, additional rate limits may apply to some actions. For example, polling aggressively instead of using webhooks or making API calls with a high concurrency may result in rate limiting.

It is not intended for these rate limits to interfere with any legitimate use of the API. Please contact support at cloudbuild@unity3d.com if your use is affected by this rate limit.

You can check the returned HTTP headers for any API request to see your current rate limit status.

  • X-RateLimit-Limit: maximum number of requests per minute
  • X-RateLimit-Remaining: remaining number of requests in the current window
  • X-RateLimit-Reset: time at which the current window will reset (UTC epoch seconds)

Once you go over the rate limit you will receive an error response:

HTTP Status: 429
{
"error": "Rate limit exceeded, retry in XX seconds"
}

# initialize the API client configuration = Configuration(); configuration.username = "[YOUR API KEY]"; client = CloudBuild.ApiClient("https://build-api.cloud.unity3d.com/api/v1")

Paths

Get billing plan

GET /orgs/{orgid}/projects/{projectid}/billingplan_alpha

Description

Get the billing plan for the specified organization (but pull from project)

Required Permissions

project:user

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string

Responses

Uses default content-types: application/json text/plain text/html text/csv

200 OK
`

Builds Introduction

Builds contain the output of building a Build Target for a Project. They contain metadata about the build itself as well as links to the build artifacts.

For certain operations, you can substitute "_all" for the buildtargetid to operate across all configured build targets.

Get audit log

GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/auditlog

Description

Retrieve a list of historical settings changes for this build target.

Required Permissions

project:user

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
buildtargetid

unique id auto-generated from the build target name

path string
per_page

Number of audit log records to retrieve

query number 25
page

Skip to page number, based on per_page value

query number 1
curl -X GET -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/auditlog buildsApi = BuildsApi(client) auditlog = buildsApi.get_audit_log('{orgid}', '{projectid}', '{buildtargetid}')

Responses

Uses default content-types: application/json text/plain text/html text/csv

200 OK
object
updatingUserEmail: string
updated: string (dateTime)
lines: object[]
object
label: string
field: string
to: string
from: string
`
[ { "updatingUserEmail": "julie.smith@example.org", "updated": "2015-08-04T17:18:24.532Z", "lines": [{ "from": "Latest 4.x", "to": "4.6.5", "label": "Unity version", "field": "buildtarget.settings.unityVersion" }] }, { "updatingUserEmail": "sandra.johnson@example.org", "updated": "2015-08-02T12:02:44.532Z", "lines": [{ "label": "Keypass", "field": "buildtarget.settings.platform.keystoreInfo.keypass", "from": "", "to": "changed" }] } ]

Delete all artifacts associated with all non-favorited builds for a specified buildtargetid (_all is allowed).

DELETE /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/artifacts

Description

Required Permissions

project:manager

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
buildtargetid

unique id auto-generated from the build target name

path string
curl -X DELETE -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/artifacts buildsApi = BuildsApi(client) build = buildsApi.delete_all_build_artifacts('{orgid}', '{projectid}', '{buildtargetid}')

Responses

Uses default content-types: application/json text/plain text/html text/csv

204 No Content
`

Delete all artifacts associated with a specific build

DELETE /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/artifacts

Description

Required Permissions

project:manager

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
buildtargetid

unique id auto-generated from the build target name

path string
number

Build number or in some cases _all

path string
curl -X DELETE -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/artifacts buildsApi = BuildsApi(client) build = buildsApi.delete_build_artifacts('{orgid}', '{projectid}', '{buildtargetid}', '{number}')

Responses

Uses default content-types: application/json text/plain text/html text/csv

204 No Content
`

Delete artifacts for a batch of builds

POST /orgs/{orgid}/projects/{projectid}/artifacts/delete

Description

Delete all artifacts whose build target ids and build numbers are included in the builds array. Alternatively, delete all builds that match a given filter, excluding builds from the operation by including their build target ids and build numbers in the excludedBuilds array (the allWithExclusions query parameter must be set to true for this to work). Builds that are favorited, or whose status does not match one of the following statuses, will not be deleted: success, failure, canceled, unknown.

Required Permissions

project:manager

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
allWithExclusions

Flag to indicate that the request will attempt to delete all builds, minus the ones included in the body's excludedBuilds array

query boolean

Parameters are specified as application/json in the request body.

Options to specify what builds to delete

{"properties":{"builds":{"type":"array","items":{"required":["buildtargetid","build"],"properties":{"buildtargetid":{"type":"string"},"build":{"type":"number"}}}},"excludedBuilds":{"type":"array","items":{"type":"object","properties":{"buildtargetid":{"type":"string"},"build":{"type":"number"}}}},"filters":{"type":"object","properties":{"buildStatus":{"type":"string"},"target":{"type":"string"},"platform":{"type":"string"},"search":{"type":"string"}}},"deleteOnOrBeforeDate":{"type":"string","format":"date-time"}}}
curl -X POST -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" -d '{builds: [{buildtargetid:"default-android",build:1}]}' https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/artifacts/delete buildsApi = BuildsApi(client) build = buildsApi.batch_delete_build_artifacts('{orgid}', '{projectid}', '{builds: [{buildtargetid:"default-android",build:1}]}')

Responses

Uses default content-types: application/json text/plain text/html text/csv

200 OK
numberOfDeletedBuildArtifacts: number
`

List all builds

GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds

Description

List all running and finished builds, sorted by build number (optionally paginating the results). Use '_all' as the buildtargetid to get all configured build targets. The response includes a Content-Range header that identifies the range of results returned and the total number of results matching the given query parameters.

Required Permissions

project:user

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
buildtargetid

unique id auto-generated from the build target name

path string
include

Extra fields to include in the response

query string
per_page

Number of audit log records to retrieve

query number 25
page

Skip to page number, based on per_page value

query number 1
buildStatus

Query for only builds of a specific status

query string
platform

Query for only builds of a specific platform

query string
showDeleted

Query for builds that have been deleted

query boolean
onlyFavorites

Query for builds that have been favorited

query boolean
cleanBuild

Query for builds that have either been built clean or using caches

query boolean
search

Regex string to use to restrict the results via search

query string
latestBuildPerPlatformOnly

Query for only the most recent build per platform

query boolean
Default List curl -X GET -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds With Paging curl -X GET -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds?per_page=5&page=2 With Filtering curl -X GET -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds?buildStatus=success&platform=ios # Default List buildsApi = BuildsApi(client) builds = buildsApi.get_builds('{orgid}', '{projectid}', '{buildtargetid}') # With Paging buildsApi = BuildsApi(client) builds = buildsApi.get_builds('{orgid}', '{projectid}', '{buildtargetid}', per_page=5, page=2) # With Filtering buildsApi = BuildsApi(client) builds = buildsApi.get_builds('{orgid}', '{projectid}', '{buildtargetid}', build_status='success', platform='ios')

Responses

Uses default content-types: application/json text/plain text/html text/csv

200 OK
object

buildattempt

build: number
buildtargetid: string

unique id auto-generated from the build target name

buildTargetName: string (up to 64 chars)
buildGUID: string

unique GUID identifying this build

buildStatus: string , x ∈ { created , queued , sentToBuilder , started , restarted , success , failure , canceled , unknown }
cleanBuild: boolean

if the build was built without using data cached from previous builds

failureDetails: object[]

list of failure details for this build attempt, when available

object
label: string
resolutionHint: string
stages: string[]
string
failureType: string
count: number
canceledBy: string , x ∈ { api , service , service-timelimit , concurrency-timelimit , restart-limit , evaluation-timelimit , jenkins-timelimit , service-badconfiguration , billing-invalidsubscription }
platform: string , x ∈ { ios , android , webplayer , webgl , standaloneosxintel , standaloneosxintel64 , standaloneosxuniversal , standalonewindows , standalonewindows64 , standalonelinux , standalonelinux64 , standalonelinuxuniversal , wsaplayer }
workspaceSize: number

size of workspace in bytes

created: string

when the build was created

finished: string

when the build completely finished

checkoutStartTime: string

when the build starting checking out code

checkoutTimeInSeconds: number

amount of time spent checking out code

buildStartTime: string

when the build started compiling

buildTimeInSeconds: number

amount of time spend compiling

publishStartTime: string

when the build started saving build artifacts

publishTimeInSeconds: number

amount of time spent saving build artifacts

totalTimeInSeconds: number

total time for the build

billableTimeInSeconds: number

total billable time for the build

unitTestTimeInSeconds: number

total time for unit test execution step

editModeTestTimeInSeconds: number

total time for unit test execution step

playModeTestTimeInSeconds: number

total time for unit test execution step

lastBuiltRevision: string

source control commit id for the build

changeset: object[]

a list of source control changes between this and the last build

object
favorited: boolean

if the build is marked as do not delete or not

label: string

description given when a build is favorited

deleted: boolean

if the build is deleted or not

headless: object

if the build was built to run in linux headless mode

credentialsOutdated: boolean

if a newer credential has been attached to this buildtarget and the build can be re-signed

deletedBy: string

email address of the user who deleted this attempt

queuedReason: string , x ∈ { targetConcurrency , cooldown , billingService , buildConcurrency , concurrency , waitingForBuildAgent , evaluating , sentToBuilder , notPending }

reason the build is currently waiting

cooldownDate: string

time until this build will be reconsidered for building

scmBranch: string

scm branch to be built

unityVersion: string

'latest' or a unity dot version with underscores (ex. '4_6_5')

xcodeVersion: string

'latest' or a supported xcode version (ex. 'xcode7')

auditChanges: number
projectVersion: object
name: string

automatically generated name for the build

filename: string

filename for the primary artifact

projectName: string

name of the project

platform: string , x ∈ { ios , android , webplayer , webgl , standaloneosxintel , standaloneosxintel64 , standaloneosxuniversal , standalonewindows , standalonewindows64 , standalonelinux , standalonelinux64 , standalonelinuxuniversal , wsaplayer }
size: number

size of the the primary build artifact in bytes

created: string

creation date

lastMod: string

last modified date

bundleId: string

a unique identifier (com.example.name)

udids: string[]

iPhone unique identifiers that are able to install this build

string
links: object

links to build artifacts

projectName: string
projectId: string
projectGuid: string
orgId: string
orgFk: string
filetoken: string
links: object
artifacts: object[]
object
object
href: string
method: string
meta: object
buildReport: object
errors: integer
warnings: integer
testResults: object

results from the build's unit tests, if any

unit_test: object
unit_test_editmode: object
unit_test_playmode: object
error: string
`
[ { "orgId": example-org, "projectId": new-project, "projectName": new-project, "build": 2, "buildtargetid": "android-builder", "buildTargetName": "Android Builder", "buildStatus": "success", "platform": "android", "workspaceSize": 8911006, "created": "2015-07-14T21:56:28.202Z", "finished": "2015-07-14T22:04:10.000Z", "checkoutStartTime": "2015-07-14T22:00:20.000Z", "checkoutTimeInSeconds": 40, "buildStartTime": "2015-07-14T22:01:00.000Z", "buildTimeInSeconds": 152.386056, "publishStartTime": "2015-07-14T22:03:33.000Z", "publishTimeInSeconds": 10.371839, "totalTimeInSeconds": 461.798, "lastBuiltRevision": "88e565df27ca35c2603c29eb924dc018f32a22c1", "changeset": [], "favorited": false, "scmBranch": "master", "unityVersion": "latest", "auditChanges": 0, "projectVersion": { "name": "android-builder-2", "filename": "example-org/new-project/android-builder-2/android-builder.apk", "projectName": "New Project", "platform": "android", "size": 14452762, "created": "2015-07-14T22:03:45.847Z", "lastMod": "2015-07-14T22:03:46.251Z", "bundleId": "com.unity3d.example", "udids": [] }, "links": { "self": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2" }, "log": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2/log" }, "auditlog": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2/auditlog" }, "download_primary": { "method": "get", "href": "https://unitycloud-build-user-svc-dev-build.s3.amazonaws.com/example-org/new-project/android-builder-2/android-builder.apk?AWSAccessKeyId=AKIAI6ZGSQWNDMF7X33A&Expires=1447890477&Signature=e9Hs%2FYECpVlrMITqCRY5dSWXChE%3D&response-content-disposition=attachment%3B%20filename%3Dexample-org%2Fnew-project-android-2-1436910988202.apk&response-content-type=application%2Foctet-stream", "meta": { "type": "APK" } }, "create_share": { "method": "post", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2/share" }, "revoke_share": { "method": "delete", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2/share" }, "icon": { "method": "get", "href": "https://unitycloud-build-user-svc-dev-extras-pub.s3.amazonaws.com/example-org/new-project/android-builder-2/icon.png" } } }, { "orgId": example-org, "projectId": new-project, "projectName": new-project, "build": 1, "buildtargetid": "android-builder", "buildTargetName": "Android Builder", "buildStatus": "success", "cleanBuild": "false", "platform": "android", "workspaceSize": 8910982, "created": "2015-07-14T21:51:26.520Z", "finished": "2015-07-14T21:54:43.000Z", "checkoutStartTime": "2015-07-14T21:51:45.000Z", "checkoutTimeInSeconds": 41, "buildStartTime": "2015-07-14T21:52:26.000Z", "buildTimeInSeconds": 120.410226, "publishStartTime": "2015-07-14T21:54:27.000Z", "publishTimeInSeconds": 4.846675, "totalTimeInSeconds": 196.48, "lastBuiltRevision": "88e565df27ca35c2603c29eb924dc018f32a22c1", "changeset": [], "favorited": false, "scmBranch": "master", "unityVersion": "latest", "auditChanges": 0, "projectVersion": { "name": "android-builder-1", "filename": "example-org/new-project/android-builder-1/android-builder.apk", "projectName": "Example Unity Project", "platform": "android", "size": 14443743, "created": "2015-07-14T21:54:34.395Z", "lastMod": "2015-07-14T21:54:34.776Z", "bundleId": "com.tsugi.example", "udids": [] }, "links": { "self": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/1" }, "log": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/1/log" }, "auditlog": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/1/auditlog" }, "download_primary": { "method": "get", "href": "https://unitycloud-build-user-svc-dev-build.s3.amazonaws.com/example-org/new-project/android-builder-1/android-builder.apk?AWSAccessKeyId=AKIAI6ZGSQWNDMF7X33A&Expires=1447890477&Signature=5Z4ouUFyVIJ8jaChE%2F6K%2FMHHpiM%3D&response-content-disposition=attachment%3B%20filename%3Dexample-org%2Fnew-project-android-1-1436910686520.apk&response-content-type=application%2Foctet-stream", "meta": { "type": "APK" } }, "create_share": { "method": "post", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/1/share" }, "revoke_share": { "method": "delete", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/1/share" }, "icon": { "method": "get", "href": "https://unitycloud-build-user-svc-dev-extras-pub.s3.amazonaws.com/example-org/new-project/android-builder-1/icon.png" } } } ]

Create new build

POST /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds

Description

Start the build process for this build target (or all targets, if '_all' is specified as the buildtargetid), if there is not one currently in process.

If a build is currently in process that information will be related in the 'error' field.

Required Permissions

project:user

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
buildtargetid

unique id auto-generated from the build target name

path string

Parameters are specified as application/json in the request body.

Options for starting the builds. You can specify a platform and label only when starting a local (_local) build. A local build will return immediately and be marked as successful.

{"properties":{"clean":{"type":"boolean"},"delay":{"type":"number","description":"Delay to start build, in milliseconds"},"commit":{"type":"string"},"headless":{"description":"Only valid for local builds\n","type":"boolean"},"label":{"description":"Only valid for local builds\n","type":"string"},"platform":{"description":"Only valid for local builds\n","type":"string","enum":["ios","android","webplayer","webgl","standaloneosxintel","standaloneosxintel64","standaloneosxuniversal","standalonewindows","standalonewindows64","standalonelinux","standalonelinux64","standalonelinuxuniversal","wsaplayer"]}}}
curl -X POST -d '{"clean": true, "delay": 30}' -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds buildsApi = BuildsApi(client) status = buildsApi.start_builds('{orgid}', '{projectid}', '{buildtargetid}', options={"clean": True, "delay": 30})

Responses

Uses default content-types: application/json text/plain text/html text/csv

202 Accepted
object

buildattempt

build: number
buildtargetid: string

unique id auto-generated from the build target name

buildTargetName: string (up to 64 chars)
buildGUID: string

unique GUID identifying this build

buildStatus: string , x ∈ { created , queued , sentToBuilder , started , restarted , success , failure , canceled , unknown }
cleanBuild: boolean

if the build was built without using data cached from previous builds

failureDetails: object[]

list of failure details for this build attempt, when available

object
label: string
resolutionHint: string
stages: string[]
string
failureType: string
count: number
canceledBy: string , x ∈ { api , service , service-timelimit , concurrency-timelimit , restart-limit , evaluation-timelimit , jenkins-timelimit , service-badconfiguration , billing-invalidsubscription }
platform: string , x ∈ { ios , android , webplayer , webgl , standaloneosxintel , standaloneosxintel64 , standaloneosxuniversal , standalonewindows , standalonewindows64 , standalonelinux , standalonelinux64 , standalonelinuxuniversal , wsaplayer }
workspaceSize: number

size of workspace in bytes

created: string

when the build was created

finished: string

when the build completely finished

checkoutStartTime: string

when the build starting checking out code

checkoutTimeInSeconds: number

amount of time spent checking out code

buildStartTime: string

when the build started compiling

buildTimeInSeconds: number

amount of time spend compiling

publishStartTime: string

when the build started saving build artifacts

publishTimeInSeconds: number

amount of time spent saving build artifacts

totalTimeInSeconds: number

total time for the build

billableTimeInSeconds: number

total billable time for the build

unitTestTimeInSeconds: number

total time for unit test execution step

editModeTestTimeInSeconds: number

total time for unit test execution step

playModeTestTimeInSeconds: number

total time for unit test execution step

lastBuiltRevision: string

source control commit id for the build

changeset: object[]

a list of source control changes between this and the last build

object
favorited: boolean

if the build is marked as do not delete or not

label: string

description given when a build is favorited

deleted: boolean

if the build is deleted or not

headless: object

if the build was built to run in linux headless mode

credentialsOutdated: boolean

if a newer credential has been attached to this buildtarget and the build can be re-signed

deletedBy: string

email address of the user who deleted this attempt

queuedReason: string , x ∈ { targetConcurrency , cooldown , billingService , buildConcurrency , concurrency , waitingForBuildAgent , evaluating , sentToBuilder , notPending }

reason the build is currently waiting

cooldownDate: string

time until this build will be reconsidered for building

scmBranch: string

scm branch to be built

unityVersion: string

'latest' or a unity dot version with underscores (ex. '4_6_5')

xcodeVersion: string

'latest' or a supported xcode version (ex. 'xcode7')

auditChanges: number
projectVersion: object
name: string

automatically generated name for the build

filename: string

filename for the primary artifact

projectName: string

name of the project

platform: string , x ∈ { ios , android , webplayer , webgl , standaloneosxintel , standaloneosxintel64 , standaloneosxuniversal , standalonewindows , standalonewindows64 , standalonelinux , standalonelinux64 , standalonelinuxuniversal , wsaplayer }
size: number

size of the the primary build artifact in bytes

created: string

creation date

lastMod: string

last modified date

bundleId: string

a unique identifier (com.example.name)

udids: string[]

iPhone unique identifiers that are able to install this build

string
links: object

links to build artifacts

projectName: string
projectId: string
projectGuid: string
orgId: string
orgFk: string
filetoken: string
links: object
artifacts: object[]
object
object
href: string
method: string
meta: object
buildReport: object
errors: integer
warnings: integer
testResults: object

results from the build's unit tests, if any

unit_test: object
unit_test_editmode: object
unit_test_playmode: object
error: string
`
Build Accepted [ { "build": 3, "buildtargetid": "android-builder", "buildTargetName": "Android Builder", "buildStatus": "queued", "cleanBuild": "false", "platform": "a ndroid", "created": "2015-11-19T22:02:20.244Z", "changeset": [], "favorited": false, "auditChanges": 1, "links": { "self": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/default-ios/builds/3" }, "log": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/default-ios/builds/3/log" }, "auditlog": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/default-ios/builds/3/auditlog" }, "cancel": { "method": "delete", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/default-ios/builds/3" } } } ] Build Already Started [ { "buildtargetid": "android-builder", "buildTargetName": "Android Builder", "error": "Cannot start build - already a build pending." } ]

Cancel all builds

DELETE /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds

Description

Cancel all builds in progress for this build target (or all targets, if '_all' is specified as the buildtargetid). Canceling an already finished build will do nothing and respond successfully.

Required Permissions

project:user

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
buildtargetid

unique id auto-generated from the build target name

path string
curl -X DELETE -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds buildsApi = BuildsApi(client) buildsApi.cancel_all_builds('{orgid}', '{projectid}', '{buildtargetid}')

Responses

Uses default content-types: application/json text/plain text/html text/csv

204 No Content
`

Build Status

GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}

Description

Retrieve information for a specific build. A Build resource contains information related to a build attempt for a build target, including the build number, changeset, build times, and other pertinent data.

Required Permissions

project:user

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
buildtargetid

unique id auto-generated from the build target name

path string
number

Build number or in some cases _all

path string
include

Extra fields to include in the response

query string
curl -X GET -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number} buildsApi = BuildsApi(client) build = buildsApi.get_build('{orgid}', '{projectid}', '{buildtargetid}', '{number}')

Responses

Uses default content-types: application/json text/plain text/html text/csv

200 OK

buildattempt

build: number
buildtargetid: string

unique id auto-generated from the build target name

buildTargetName: string (up to 64 chars)
buildGUID: string

unique GUID identifying this build

buildStatus: string , x ∈ { created , queued , sentToBuilder , started , restarted , success , failure , canceled , unknown }
cleanBuild: boolean

if the build was built without using data cached from previous builds

failureDetails: object[]

list of failure details for this build attempt, when available

object
label: string
resolutionHint: string
stages: string[]
string
failureType: string
count: number
canceledBy: string , x ∈ { api , service , service-timelimit , concurrency-timelimit , restart-limit , evaluation-timelimit , jenkins-timelimit , service-badconfiguration , billing-invalidsubscription }
platform: string , x ∈ { ios , android , webplayer , webgl , standaloneosxintel , standaloneosxintel64 , standaloneosxuniversal , standalonewindows , standalonewindows64 , standalonelinux , standalonelinux64 , standalonelinuxuniversal , wsaplayer }
workspaceSize: number

size of workspace in bytes

created: string

when the build was created

finished: string

when the build completely finished

checkoutStartTime: string

when the build starting checking out code

checkoutTimeInSeconds: number

amount of time spent checking out code

buildStartTime: string

when the build started compiling

buildTimeInSeconds: number

amount of time spend compiling

publishStartTime: string

when the build started saving build artifacts

publishTimeInSeconds: number

amount of time spent saving build artifacts

totalTimeInSeconds: number

total time for the build

billableTimeInSeconds: number

total billable time for the build

unitTestTimeInSeconds: number

total time for unit test execution step

editModeTestTimeInSeconds: number

total time for unit test execution step

playModeTestTimeInSeconds: number

total time for unit test execution step

lastBuiltRevision: string

source control commit id for the build

changeset: object[]

a list of source control changes between this and the last build

object
favorited: boolean

if the build is marked as do not delete or not

label: string

description given when a build is favorited

deleted: boolean

if the build is deleted or not

headless: object

if the build was built to run in linux headless mode

credentialsOutdated: boolean

if a newer credential has been attached to this buildtarget and the build can be re-signed

deletedBy: string

email address of the user who deleted this attempt

queuedReason: string , x ∈ { targetConcurrency , cooldown , billingService , buildConcurrency , concurrency , waitingForBuildAgent , evaluating , sentToBuilder , notPending }

reason the build is currently waiting

cooldownDate: string

time until this build will be reconsidered for building

scmBranch: string

scm branch to be built

unityVersion: string

'latest' or a unity dot version with underscores (ex. '4_6_5')

xcodeVersion: string

'latest' or a supported xcode version (ex. 'xcode7')

auditChanges: number
projectVersion: object
name: string

automatically generated name for the build

filename: string

filename for the primary artifact

projectName: string

name of the project

platform: string , x ∈ { ios , android , webplayer , webgl , standaloneosxintel , standaloneosxintel64 , standaloneosxuniversal , standalonewindows , standalonewindows64 , standalonelinux , standalonelinux64 , standalonelinuxuniversal , wsaplayer }
size: number

size of the the primary build artifact in bytes

created: string

creation date

lastMod: string

last modified date

bundleId: string

a unique identifier (com.example.name)

udids: string[]

iPhone unique identifiers that are able to install this build

string
links: object

links to build artifacts

projectName: string
projectId: string
projectGuid: string
orgId: string
orgFk: string
filetoken: string
links: object
artifacts: object[]
object
object
href: string
method: string
meta: object
buildReport: object
errors: integer
warnings: integer
testResults: object

results from the build's unit tests, if any

unit_test: object
unit_test_editmode: object
unit_test_playmode: object
error: string
`
{ "build": 2, "buildtargetid": "android-builder", "buildTargetName": "Android Builder", "buildStatus": "success", "cleanBuild": "false", "platform": "android", "workspaceSize": 8911006, "created": "2015-07-14T21:56:28.202Z", "finished": "2015-07-14T22:04:10.000Z", "checkoutStartTime": "2015-07-14T22:00:20.000Z", "checkoutTimeInSeconds": 40, "buildStartTime": "2015-07-14T22:01:00.000Z", "buildTimeInSeconds": 152.386056, "publishStartTime": "2015-07-14T22:03:33.000Z", "publishTimeInSeconds": 10.371839, "totalTimeInSeconds": 461.798, "lastBuiltRevision": "88e565df27ca35c2603c29eb924dc018f32a22c1", "changeset": [], "favorited": true, "auditChanges": 0, "projectVersion": { "name": "android-builder-2", "filename": "example-org/new-project/android-builder-2/android-builder.apk", "projectName": "Example Unity Project", "platform": "android", "size": 14452762, "created": "2015-07-14T22:03:45.847Z", "lastMod": "2015-07-14T22:03:46.251Z", "bundleId": "com.tsugi.example", "udids": [] }, "links": { "self": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2" }, "log": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2/log" }, "auditlog": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2/auditlog" }, "download_primary": { "method": "get", "href": "https://unitycloud-build-user-svc-dev-build.s3.amazonaws.com/example-org/new-project/android-builder-2/android-builder.apk?AWSAccessKeyId=AKIAI6ZGSQWNDMF7X33A&Expires=1447973385&Signature=ffKQIKOJsKN6qrwzxObXSSyCVts%3D&response-content-disposition=attachment%3B%20filename%3Dexample-org%2Fnew-project-android-2-1436910988202.apk&response-content-type=application%2Foctet-stream", "meta": { "type": "APK" } }, "create_share": { "method": "post", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2/share" }, "revoke_share": { "method": "delete", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2/share" }, "icon": { "method": "get", "href": "https://unitycloud-build-user-svc-dev-extras-pub.s3.amazonaws.com/example-org/new-project/android-builder-2/icon.png" } } }

Cancel build

DELETE /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}

Description

Cancel a build in progress. Canceling an already finished build will do nothing and respond successfully.

Required Permissions

project:user

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
buildtargetid

unique id auto-generated from the build target name

path string
number

Build number or in some cases _all

path string
curl -X DELETE -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number} buildsApi = BuildsApi(client) build = buildsApi.cancel_build('{orgid}', '{projectid}', '{buildtargetid}', '{number}')

Responses

Uses default content-types: application/json text/plain text/html text/csv

204 No Content
`

Update build information

PUT /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}

Description

Required Permissions

project:manager

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
buildtargetid

unique id auto-generated from the build target name

path string
number

Build number or in some cases _all

path string

Parameters are specified as application/json in the request body.

Options for build update

{"properties":{"favorited":{"type":"boolean"},"label":{"type":"string"}}}
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" -d '{"favorited": true}' https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number} buildsApi = BuildsApi(client) build = buildsApi.cancel_build('{orgid}', '{projectid}', '{buildtargetid}', '{number}', {"favorited": true}) responses:

Responses

Uses default content-types: application/json text/plain text/html text/csv

200 OK

buildattempt

build: number
buildtargetid: string

unique id auto-generated from the build target name

buildTargetName: string (up to 64 chars)
buildGUID: string

unique GUID identifying this build

buildStatus: string , x ∈ { created , queued , sentToBuilder , started , restarted , success , failure , canceled , unknown }
cleanBuild: boolean

if the build was built without using data cached from previous builds

failureDetails: object[]

list of failure details for this build attempt, when available

object
label: string
resolutionHint: string
stages: string[]
string
failureType: string
count: number
canceledBy: string , x ∈ { api , service , service-timelimit , concurrency-timelimit , restart-limit , evaluation-timelimit , jenkins-timelimit , service-badconfiguration , billing-invalidsubscription }
platform: string , x ∈ { ios , android , webplayer , webgl , standaloneosxintel , standaloneosxintel64 , standaloneosxuniversal , standalonewindows , standalonewindows64 , standalonelinux , standalonelinux64 , standalonelinuxuniversal , wsaplayer }
workspaceSize: number

size of workspace in bytes

created: string

when the build was created

finished: string

when the build completely finished

checkoutStartTime: string

when the build starting checking out code

checkoutTimeInSeconds: number

amount of time spent checking out code

buildStartTime: string

when the build started compiling

buildTimeInSeconds: number

amount of time spend compiling

publishStartTime: string

when the build started saving build artifacts

publishTimeInSeconds: number

amount of time spent saving build artifacts

totalTimeInSeconds: number

total time for the build

billableTimeInSeconds: number

total billable time for the build

unitTestTimeInSeconds: number

total time for unit test execution step

editModeTestTimeInSeconds: number

total time for unit test execution step

playModeTestTimeInSeconds: number

total time for unit test execution step

lastBuiltRevision: string

source control commit id for the build

changeset: object[]

a list of source control changes between this and the last build

object
favorited: boolean

if the build is marked as do not delete or not

label: string

description given when a build is favorited

deleted: boolean

if the build is deleted or not

headless: object

if the build was built to run in linux headless mode

credentialsOutdated: boolean

if a newer credential has been attached to this buildtarget and the build can be re-signed

deletedBy: string

email address of the user who deleted this attempt

queuedReason: string , x ∈ { targetConcurrency , cooldown , billingService , buildConcurrency , concurrency , waitingForBuildAgent , evaluating , sentToBuilder , notPending }

reason the build is currently waiting

cooldownDate: string

time until this build will be reconsidered for building

scmBranch: string

scm branch to be built

unityVersion: string

'latest' or a unity dot version with underscores (ex. '4_6_5')

xcodeVersion: string

'latest' or a supported xcode version (ex. 'xcode7')

auditChanges: number
projectVersion: object
name: string

automatically generated name for the build

filename: string

filename for the primary artifact

projectName: string

name of the project

platform: string , x ∈ { ios , android , webplayer , webgl , standaloneosxintel , standaloneosxintel64 , standaloneosxuniversal , standalonewindows , standalonewindows64 , standalonelinux , standalonelinux64 , standalonelinuxuniversal , wsaplayer }
size: number

size of the the primary build artifact in bytes

created: string

creation date

lastMod: string

last modified date

bundleId: string

a unique identifier (com.example.name)

udids: string[]

iPhone unique identifiers that are able to install this build

string
links: object

links to build artifacts

projectName: string
projectId: string
projectGuid: string
orgId: string
orgFk: string
filetoken: string
links: object
artifacts: object[]
object
object
href: string
method: string
meta: object
buildReport: object
errors: integer
warnings: integer
testResults: object

results from the build's unit tests, if any

unit_test: object
unit_test_editmode: object
unit_test_playmode: object
error: string
`
{ "build": 2, "buildtargetid": "android-builder", "buildTargetName": "Android Builder", "buildStatus": "success", "cleanBuild": "false", "platform": "android", "workspaceSize": 8911006, "created": "2015-07-14T21:56:28.202Z", "finished": "2015-07-14T22:04:10.000Z", "checkoutStartTime": "2015-07-14T22:00:20.000Z", "checkoutTimeInSeconds": 40, "buildStartTime": "2015-07-14T22:01:00.000Z", "buildTimeInSeconds": 152.386056, "publishStartTime": "2015-07-14T22:03:33.000Z", "publishTimeInSeconds": 10.371839, "totalTimeInSeconds": 461.798, "lastBuiltRevision": "88e565df27ca35c2603c29eb924dc018f32a22c1", "changeset": [], "favorited": true, "auditChanges": 0, "projectVersion": { "name": "android-builder-2", "filename": "example-org/new-project/android-builder-2/android-builder.apk", "projectName": "Example Unity Project", "platform": "android", "size": 14452762, "created": "2015-07-14T22:03:45.847Z", "lastMod": "2015-07-14T22:03:46.251Z", "bundleId": "com.tsugi.example", "udids": [] }, "links": { "self": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2" }, "log": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2/log" }, "auditlog": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2/auditlog" }, "download_primary": { "method": "get", "href": "https://unitycloud-build-user-svc-dev-build.s3.amazonaws.com/example-org/new-project/android-builder-2/android-builder.apk?AWSAccessKeyId=AKIAI6ZGSQWNDMF7X33A&Expires=1447973385&Signature=ffKQIKOJsKN6qrwzxObXSSyCVts%3D&response-content-disposition=attachment%3B%20filename%3Dexample-org%2Fnew-project-android-2-1436910988202.apk&response-content-type=application%2Foctet-stream", "meta": { "type": "APK" } }, "create_share": { "method": "post", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2/share" }, "revoke_share": { "method": "delete", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2/share" }, "icon": { "method": "get", "href": "https://unitycloud-build-user-svc-dev-extras-pub.s3.amazonaws.com/example-org/new-project/android-builder-2/icon.png" } } }

Get audit log

GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/auditlog

Description

Retrieve a list of settings changes between the last and current build.

Required Permissions

project:user

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
buildtargetid

unique id auto-generated from the build target name

path string
number

Build number or in some cases _all

path string
per_page

Number of audit log records to retrieve

query number 25
page

Skip to page number, based on per_page value

query number 1
curl -X GET -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/auditlog buildsApi = BuildsApi(client) auditlog = buildsApi.get_audit_log('{orgid}', '{projectid}', '{buildtargetid}', '{number}')

Responses

Uses default content-types: application/json text/plain text/html text/csv

200 OK
object
updatingUserEmail: string
updated: string (dateTime)
lines: object[]
object
label: string
field: string
to: string
from: string
`
[ { "updatingUserEmail": "julie.smith@example.org", "updated": "2015-08-04T17:18:24.532Z", "lines": [{ "from": "Latest 4.x", "to": "4.6.5", "label": "Unity version", "field": "buildtarget.settings.unityVersion" }] }, { "updatingUserEmail": "sandra.johnson@example.org", "updated": "2015-08-02T12:02:44.532Z", "lines": [{ "label": "Keypass", "field": "buildtarget.settings.platform.keystoreInfo.keypass", "from": "", "to": "changed" }] } ]

Re-sign a build artifact

POST /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/resign

Description

Re-sign a build artifact using the most recent credentials associated with the buildtarget.

Required Permissions

project:manager

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
buildtargetid

unique id auto-generated from the build target name

path string
number

Build number or in some cases _all

path string
curl -X POST -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/resign buildsApi = BuildsApi(client) build = buildsApi.resign_build_artifact('{orgid}', '{projectid}', '{buildtargetid}', '{number}')

Responses

Uses default content-types: application/json text/plain text/html text/csv

202 Accepted
object

buildattempt

build: number
buildtargetid: string

unique id auto-generated from the build target name

buildTargetName: string (up to 64 chars)
buildGUID: string

unique GUID identifying this build

buildStatus: string , x ∈ { created , queued , sentToBuilder , started , restarted , success , failure , canceled , unknown }
cleanBuild: boolean

if the build was built without using data cached from previous builds

failureDetails: object[]

list of failure details for this build attempt, when available

object
label: string
resolutionHint: string
stages: string[]
string
failureType: string
count: number
canceledBy: string , x ∈ { api , service , service-timelimit , concurrency-timelimit , restart-limit , evaluation-timelimit , jenkins-timelimit , service-badconfiguration , billing-invalidsubscription }
platform: string , x ∈ { ios , android , webplayer , webgl , standaloneosxintel , standaloneosxintel64 , standaloneosxuniversal , standalonewindows , standalonewindows64 , standalonelinux , standalonelinux64 , standalonelinuxuniversal , wsaplayer }
workspaceSize: number

size of workspace in bytes

created: string

when the build was created

finished: string

when the build completely finished

checkoutStartTime: string

when the build starting checking out code

checkoutTimeInSeconds: number

amount of time spent checking out code

buildStartTime: string

when the build started compiling

buildTimeInSeconds: number

amount of time spend compiling

publishStartTime: string

when the build started saving build artifacts

publishTimeInSeconds: number

amount of time spent saving build artifacts

totalTimeInSeconds: number

total time for the build

billableTimeInSeconds: number

total billable time for the build

unitTestTimeInSeconds: number

total time for unit test execution step

editModeTestTimeInSeconds: number

total time for unit test execution step

playModeTestTimeInSeconds: number

total time for unit test execution step

lastBuiltRevision: string

source control commit id for the build

changeset: object[]

a list of source control changes between this and the last build

object
favorited: boolean

if the build is marked as do not delete or not

label: string

description given when a build is favorited

deleted: boolean

if the build is deleted or not

headless: object

if the build was built to run in linux headless mode

credentialsOutdated: boolean

if a newer credential has been attached to this buildtarget and the build can be re-signed

deletedBy: string

email address of the user who deleted this attempt

queuedReason: string , x ∈ { targetConcurrency , cooldown , billingService , buildConcurrency , concurrency , waitingForBuildAgent , evaluating , sentToBuilder , notPending }

reason the build is currently waiting

cooldownDate: string

time until this build will be reconsidered for building

scmBranch: string

scm branch to be built

unityVersion: string

'latest' or a unity dot version with underscores (ex. '4_6_5')

xcodeVersion: string

'latest' or a supported xcode version (ex. 'xcode7')

auditChanges: number
projectVersion: object
name: string

automatically generated name for the build

filename: string

filename for the primary artifact

projectName: string

name of the project

platform: string , x ∈ { ios , android , webplayer , webgl , standaloneosxintel , standaloneosxintel64 , standaloneosxuniversal , standalonewindows , standalonewindows64 , standalonelinux , standalonelinux64 , standalonelinuxuniversal , wsaplayer }
size: number

size of the the primary build artifact in bytes

created: string

creation date

lastMod: string

last modified date

bundleId: string

a unique identifier (com.example.name)

udids: string[]

iPhone unique identifiers that are able to install this build

string
links: object

links to build artifacts

projectName: string
projectId: string
projectGuid: string
orgId: string
orgFk: string
filetoken: string
links: object
artifacts: object[]
object
object
href: string
method: string
meta: object
buildReport: object
errors: integer
warnings: integer
testResults: object

results from the build's unit tests, if any

unit_test: object
unit_test_editmode: object
unit_test_playmode: object
error: string
`
Resign Accepted [ { "build": 3, "buildtargetid": "default-ios", "buildTargetName": "iOS Builder", "buildStatus": "queued", "cleanBuild": "false", "platform": "ios", "created": "2015-11-19T22:02:20.244Z", "changeset": [], "favorited": false, "auditChanges": 1, "links": { "self": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/default-ios/builds/3" }, "log": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/default-ios/builds/3/log" }, "auditlog": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/default-ios/builds/3/auditlog" }, "cancel": { "method": "delete", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/default-ios/builds/3" } } } ] Resign Already Started [ { "buildtargetid": "default-ios", "buildTargetName": "iOS Builder", "error": "Cannot start build - already a build pending." } ]

List all builds for org

GET /orgs/{orgid}/builds

Description

List all running and finished builds, sorted by build number (optionally paginating the results). The response includes a Content-Range header that identifies the range of results returned and the total number of results matching the given query parameters.

Required Permissions

org:manager

Request Parameters

orgid

Organization identifier

path string
include

Extra fields to include in the response

query string
per_page

Number of audit log records to retrieve

query number 25
page

Skip to page number, based on per_page value

query number 1
buildStatus

Query for only builds of a specific status

query string
platform

Query for only builds of a specific platform

query string
showDeleted

Query for builds that have been deleted

query boolean
onlyFavorites

Query for builds that have been favorited

query boolean
cleanBuild

Query for builds that have either been built clean or using caches

query boolean
search

Regex string to use to restrict the results via search

query string
Default List curl -X GET -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/builds With Paging curl -X GET -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/builds?per_page=5&page=2 With Filtering curl -X GET -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/builds?buildStatus=success&platform=ios

Responses

Uses default content-types: application/json text/plain text/html text/csv

200 OK
object

buildattempt

build: number
buildtargetid: string

unique id auto-generated from the build target name

buildTargetName: string (up to 64 chars)
buildGUID: string

unique GUID identifying this build

buildStatus: string , x ∈ { created , queued , sentToBuilder , started , restarted , success , failure , canceled , unknown }
cleanBuild: boolean

if the build was built without using data cached from previous builds

failureDetails: object[]

list of failure details for this build attempt, when available

object
label: string
resolutionHint: string
stages: string[]
string
failureType: string
count: number
canceledBy: string , x ∈ { api , service , service-timelimit , concurrency-timelimit , restart-limit , evaluation-timelimit , jenkins-timelimit , service-badconfiguration , billing-invalidsubscription }
platform: string , x ∈ { ios , android , webplayer , webgl , standaloneosxintel , standaloneosxintel64 , standaloneosxuniversal , standalonewindows , standalonewindows64 , standalonelinux , standalonelinux64 , standalonelinuxuniversal , wsaplayer }
workspaceSize: number

size of workspace in bytes

created: string

when the build was created

finished: string

when the build completely finished

checkoutStartTime: string

when the build starting checking out code

checkoutTimeInSeconds: number

amount of time spent checking out code

buildStartTime: string

when the build started compiling

buildTimeInSeconds: number

amount of time spend compiling

publishStartTime: string

when the build started saving build artifacts

publishTimeInSeconds: number

amount of time spent saving build artifacts

totalTimeInSeconds: number

total time for the build

billableTimeInSeconds: number

total billable time for the build

unitTestTimeInSeconds: number

total time for unit test execution step

editModeTestTimeInSeconds: number

total time for unit test execution step

playModeTestTimeInSeconds: number

total time for unit test execution step

lastBuiltRevision: string

source control commit id for the build

changeset: object[]

a list of source control changes between this and the last build

object
favorited: boolean

if the build is marked as do not delete or not

label: string

description given when a build is favorited

deleted: boolean

if the build is deleted or not

headless: object

if the build was built to run in linux headless mode

credentialsOutdated: boolean

if a newer credential has been attached to this buildtarget and the build can be re-signed

deletedBy: string

email address of the user who deleted this attempt

queuedReason: string , x ∈ { targetConcurrency , cooldown , billingService , buildConcurrency , concurrency , waitingForBuildAgent , evaluating , sentToBuilder , notPending }

reason the build is currently waiting

cooldownDate: string

time until this build will be reconsidered for building

scmBranch: string

scm branch to be built

unityVersion: string

'latest' or a unity dot version with underscores (ex. '4_6_5')

xcodeVersion: string

'latest' or a supported xcode version (ex. 'xcode7')

auditChanges: number
projectVersion: object
name: string

automatically generated name for the build

filename: string

filename for the primary artifact

projectName: string

name of the project

platform: string , x ∈ { ios , android , webplayer , webgl , standaloneosxintel , standaloneosxintel64 , standaloneosxuniversal , standalonewindows , standalonewindows64 , standalonelinux , standalonelinux64 , standalonelinuxuniversal , wsaplayer }
size: number

size of the the primary build artifact in bytes

created: string

creation date

lastMod: string

last modified date

bundleId: string

a unique identifier (com.example.name)

udids: string[]

iPhone unique identifiers that are able to install this build

string
links: object

links to build artifacts

projectName: string
projectId: string
projectGuid: string
orgId: string
orgFk: string
filetoken: string
links: object
artifacts: object[]
object
object
href: string
method: string
meta: object
buildReport: object
errors: integer
warnings: integer
testResults: object

results from the build's unit tests, if any

unit_test: object
unit_test_editmode: object
unit_test_playmode: object
error: string
`
[ { "orgId": example-org, "projectId": new-project, "projectName": new-project, "build": 2, "buildtargetid": "android-builder", "buildTargetName": "Android Builder", "buildStatus": "success", "cleanBuild": "true", "platform": "android", "workspaceSize": 8911006, "created": "2015-07-14T21:56:28.202Z", "finished": "2015-07-14T22:04:10.000Z", "checkoutStartTime": "2015-07-14T22:00:20.000Z", "checkoutTimeInSeconds": 40, "buildStartTime": "2015-07-14T22:01:00.000Z", "buildTimeInSeconds": 152.386056, "publishStartTime": "2015-07-14T22:03:33.000Z", "publishTimeInSeconds": 10.371839, "totalTimeInSeconds": 461.798, "lastBuiltRevision": "88e565df27ca35c2603c29eb924dc018f32a22c1", "changeset": [], "favorited": false, "scmBranch": "master", "unityVersion": "latest", "auditChanges": 0, "projectVersion": { "name": "android-builder-2", "filename": "example-org/new-project/android-builder-2/android-builder.apk", "projectName": "New Project", "platform": "android", "size": 14452762, "created": "2015-07-14T22:03:45.847Z", "lastMod": "2015-07-14T22:03:46.251Z", "bundleId": "com.unity3d.example", "udids": [] }, "links": { "self": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2" }, "log": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2/log" }, "auditlog": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2/auditlog" }, "download_primary": { "method": "get", "href": "https://unitycloud-build-user-svc-dev-build.s3.amazonaws.com/example-org/new-project/android-builder-2/android-builder.apk?AWSAccessKeyId=AKIAI6ZGSQWNDMF7X33A&Expires=1447890477&Signature=e9Hs%2FYECpVlrMITqCRY5dSWXChE%3D&response-content-disposition=attachment%3B%20filename%3Dexample-org%2Fnew-project-android-2-1436910988202.apk&response-content-type=application%2Foctet-stream", "meta": { "type": "APK" } }, "create_share": { "method": "post", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2/share" }, "revoke_share": { "method": "delete", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/2/share" }, "icon": { "method": "get", "href": "https://unitycloud-build-user-svc-dev-extras-pub.s3.amazonaws.com/example-org/new-project/android-builder-2/icon.png" } } }, { "orgId": example-org, "projectId": new-project, "projectName": new-project, "build": 1, "buildtargetid": "android-builder", "buildTargetName": "Android Builder", "buildStatus": "success", "cleanBuild": "false", "platform": "android", "workspaceSize": 8910982, "created": "2015-07-14T21:51:26.520Z", "finished": "2015-07-14T21:54:43.000Z", "checkoutStartTime": "2015-07-14T21:51:45.000Z", "checkoutTimeInSeconds": 41, "buildStartTime": "2015-07-14T21:52:26.000Z", "buildTimeInSeconds": 120.410226, "publishStartTime": "2015-07-14T21:54:27.000Z", "publishTimeInSeconds": 4.846675, "totalTimeInSeconds": 196.48, "lastBuiltRevision": "88e565df27ca35c2603c29eb924dc018f32a22c1", "changeset": [], "favorited": false, "scmBranch": "master", "unityVersion": "latest", "auditChanges": 0, "projectVersion": { "name": "android-builder-1", "filename": "example-org/new-project/android-builder-1/android-builder.apk", "projectName": "Example Unity Project", "platform": "android", "size": 14443743, "created": "2015-07-14T21:54:34.395Z", "lastMod": "2015-07-14T21:54:34.776Z", "bundleId": "com.tsugi.example", "udids": [] }, "links": { "self": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/1" }, "log": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/1/log" }, "auditlog": { "method": "get", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/1/auditlog" }, "download_primary": { "method": "get", "href": "https://unitycloud-build-user-svc-dev-build.s3.amazonaws.com/example-org/new-project/android-builder-1/android-builder.apk?AWSAccessKeyId=AKIAI6ZGSQWNDMF7X33A&Expires=1447890477&Signature=5Z4ouUFyVIJ8jaChE%2F6K%2FMHHpiM%3D&response-content-disposition=attachment%3B%20filename%3Dexample-org%2Fnew-project-android-1-1436910686520.apk&response-content-type=application%2Foctet-stream", "meta": { "type": "APK" } }, "create_share": { "method": "post", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/1/share" }, "revoke_share": { "method": "delete", "href": "/api/v1/orgs/example-org/projects/new-project/buildtargets/android-builder/builds/1/share" }, "icon": { "method": "get", "href": "https://unitycloud-build-user-svc-dev-extras-pub.s3.amazonaws.com/example-org/new-project/android-builder-1/icon.png" } } } ]

Cancel builds for org

DELETE /orgs/{orgid}/builds

Description

Cancel all in progress builds for an organization. Canceling an already finished build will do nothing and respond successfully.

Required Permissions

org:manager

Request Parameters

orgid

Organization identifier

path string
curl -X DELETE -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/builds buildsApi = BuildsApi(client) build = buildsApi.cancel_builds_for_org('{orgid}')

Responses

Uses default content-types: application/json text/plain text/html text/csv

204 No Content
`

Get build log

GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/log

Description

Retrieve the plain text log for a specific build.

Please note that this route will normally redirect with a 303 code to the build log for a completed job, so it is important to follow redirects.

Required Permissions

project:user

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
buildtargetid

unique id auto-generated from the build target name

path string
number

Build number or in some cases _all

path string
offsetlines

Stream log from the given line number

query number 1
linenumbers

Include log line numbers in the text output

query boolean
lastLineNumber

The last line number seen, numbering will continue from here

query number
compact

Return the compact log, showing only errors and warnings

query boolean
withHtml

Surround important lines (errors, warnings) with SPAN and CSS markup

query boolean
Retrieve full log curl -L GET -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/log Retrieve HTML compact log curl -L GET -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/log?compact=true&withHtml=true # Retrieve full log buildsApi = BuildsApi(client) log = buildsApi.get_build_log('{orgid}', '{projectid}', '{buildtargetid}', '{number}') # Retrieve HTML compact log log = buildsApi.get_build_log('{orgid}', '{projectid}', '{buildtargetid}', '{number}', 1, compact='true', with_html='true')

Responses

Uses default content-types: application/json text/plain text/html text/csv

200 OK
`
Full text log Running Prebuild steps done. bvr 0.2.47 bvr-api 0.0.41 Using strategy: Default Cloning the remote Git repository ... WORKSPACESIZE | ARTIFACTSSIZE 8.50 MiB | 13.81 MiB Publishing build 2 of example-org/new-project for target 'android-builder'... Uploading /BUILD_PATH/example-org.new-project.android-builder/.build/last/android-builder/android-builder.apk ...done Uploading /BUILD_PATH/example-org.new-project.android-builder/.build/last/android-builder/extra_data/artifacts/icon.png ...done publishing finished successfully. done. postbuildstatus finished successfully. Deleting project workspace... Finished: SUCCESS Compact text log [Unity] Initialize engine version: 4.6.4f1 (99f88340878d) [Unity] Initialize engine version: 4.6.4f1 (99f88340878d) [Unity] Finished exporting player successfully. Warning: publishing finished successfully. Finished: SUCCESS Compact HTML log <span class="log_important_line">[Unity] <span class="log_important">Initialize engine version: </span>4.6.4f1 (99f88340878d)</span> <span class="log_important_line">[Unity] <span class="log_important">Initialize engine version: </span>4.6.4f1 (99f88340878d)</span> <span class="log_success_line">[Unity] <span class="log_success">Finished exporting player successfully.</span></span> <span class="log_warning_line"> <span class="log_warning">Warning</span>: </span> <span class="log_success_line"><span class="log_success">publishing finished successfully</span>.</span> <span class="log_success_line"><span class="log_success">Finished: SUCCESS</span></span>
303 See Other
`
default
error: string
detail: string[]
string
`

Get the build steps for a given build

GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/steps

Description

Retrieves all build steps for a build, this replaces the old method where we would manually download the build report artifacts and allows us to add more functionality into build steps.

Required Permissions

project:user

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
buildtargetid

unique id auto-generated from the build target name

path string
number

Build number or in some cases _all

path string
curl -X GET -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/steps

Responses

Uses default content-types: application/json text/plain text/html text/csv

200 OK
object
depth: integer
duration: number
name: string
messages: object[]
object
content: string
typeCode: integer
`
[{ "depth": 0, "duration": 67138.5108, "name": "Build player", "messages": [] }, { "depth": 1, "duration": 2839.5708, "name": "Compile scripts", "messages": [{ "content": "Library/PackageCache/com.unity.analytics@3.2.2/DataPrivacy/DataPrivacyButton.cs(28,13): warning CS0618: 'Application.ExternalEval(string)' is obsolete: 'Application.ExternalEval is deprecated. See https://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html for alternatives.'", "typeCode": 2, }] }, { "depth": 1, "duration": 0.027, "name": "Prepare splash screen", "messages": [] }])

Get the share link

GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/share

Description

Gets a share link if it exists

Required Permissions

project:user

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
buildtargetid

unique id auto-generated from the build target name

path string
number

Build number or in some cases _all

path string
curl -X GET -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/share buildsApi = BuildsApi(client) share = buildsApi.get_share('{orgid}', '{projectid}', '{buildtargetid}', '{number}')

Responses

Uses default content-types: application/json text/plain text/html text/csv

200 OK
shareid: string
shareExpiry: string
`
{ "shareid": "bJ5Pu6RYFl" }
404 Not Found
`

Create a new link to share a project

POST /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/share

Description

Create a new short link to share a project. If this is called when a share already exists, that share will be revoked and a new one created.

Required Permissions

project:user

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
buildtargetid

unique id auto-generated from the build target name

path string
number

Build number or in some cases _all

path string

application/x-www-form-urlencoded

Date when share link will expire

{"properties":{"shareExpiry":{"type":"string"}}}
curl -X POST -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/share buildsApi = BuildsApi(client) share = buildsApi.create_share('{orgid}', '{projectid}', '{buildtargetid}', '{number}', '{shareExpiry}')

Responses

Uses default content-types: application/json text/plain text/html text/csv

201 Created
shareid: string
shareExpiry: string
`
{ "shareid": "bJ5Pu6RYFl" }
404 Not Found
`

Modify existing share link

PUT /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/share

Description

Modify an existing share link. Only intended for updating the Expiry without revoking the link.

Required Permissions

project:user

Request Parameters

orgid

Organization identifier

path string
projectid

Project identifier

path string
buildtargetid

unique id auto-generated from the build target name

path string
number

Build number or in some cases _all

path string

application/x-www-form-urlencoded

Date when share link will expire

{"properties":{"shareExpiry":{"type":"string"}}}
curl -X POST -H "Content-Type: application/json" -H "Authorization: Basic [YOUR API KEY]" https://build-api.cloud.unity3d.com/api/v1/orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/share buildsApi = BuildsApi(client) share = buildsApi.modify_share('{orgid}', '{projectid}', '{buildtargetid}', '{number}', '{shareExpiry}')

Responses

Uses default content-types: application/json text/plain text/html text/csv

201 Created
shareid: string
shareExpiry: string
`
{ "shareid": "bJ5Pu6RYFl" }
404 Not Found
`

Revoke a shared link

DELETE /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/share

Description

Revoke a shared link, both {buildtargetid} and {number} may use _all to revoke all share links for a given buildtarget or entire project.

Required Permissions

project:user

Request Parameters