Skip to main content

Apps - Download app

Route URL​

POST https://playcanvas.com/api/apps/download

Description​

This will allow you to download an app which you can self host on your own server. The request will start a download job and the job details will be returned in the response. You can poll the job by id until its status is either 'complete' or 'error'. When the job is complete, its data.download_url property holds the URL to download the app package.

Use format to choose the package type. Omit it or set it to static for the standard self-hostable package, or set it to npm for a Vite-based npm project. See Downloading a Build for details on the available download formats and NPM project structure.

Example​

curl -H "Authorization: Bearer {accessToken}" -H "Content-Type: application/json" -X POST -d '{"project_id": {projectId}, "scenes": [{sceneId}], "name": "My App", "format": "npm"}' "https://playcanvas.com/api/apps/download"

Parameters​

NameTypeRequiredDefaultDescription
project_idnumber✔️—The id of the project.
namestring✔️—The name of the app. Must be less than 1000 characters.
scenesnumber[]✔️—A list of scene ids to be included in the app. When you specify scenes then the first scene in the list will be used as the initial scene of the application.
branch_idstringMain branchThe id of the branch.
descriptionstring—The description of the app. Must be less than 10,000 characters.
versionstring—The version of the app. Can be a string up to 20 characters.
release_notesstring—Release notes for the app. Can be a string up to 10,000 characters.
scripts_concatenatebooleanfalseSet it to true if you want scripts to be concatenated.
scripts_minifybooleanfalseSet it to true if you want scripts to be minified. Only applies when scripts_concatenate is true.
scripts_sourcemapsbooleanfalseSet it to true if you want script sourcemaps to be generated.
optimize_scene_formatbooleanfalseSet it to true if you want scenes to be in an optimized format (see Optimize Scene Format for more information).
formatstringstaticDownload package type: static or npm. See Downloading a Build.
engine_versionstringLatest supportedSet it to an Engine version string (full list of releases) if a specific version is needed for the app. If you omit it, the app uses the latest Engine version the Editor supports for your project's major version.

Response Schema​

Status: 201 Created
{
"status": "running" | "complete" | "error",
"messages": list of strings,
"created_at": date,
"modified_at": date,
"data": {
"concatenate": boolean,
"branch_id": string,
"optimize_scene_format": boolean,
"format": "static" | "npm",
"minify": boolean,
"name": string,
"sourcemaps": boolean,
"scenes": list of int scene ids,
"engineVersion": string,
"preload_bundle": boolean,
"project_id": int,
"owner_id": int
},
"id": int
}

Errors​

CodeDescription
401Unauthorized
403Forbidden
404Project not found
404Owner not found
404Scene not found
429Too many requests

Rate Limiting​

This route uses a strict rate limit.