menu
Menu
Mobify DevCenter
search_icon_focus

Mobify Cloud API Reference

New to the Mobify Cloud API? Read the Overview →

The Mobify Cloud API allows you to configure and manage how your projects are deployed on Mobify Cloud. Currently, we offer HTTP endpoints (via a RESTful interface) focused on cache control, redirect management, and target management.

The Mobify Cloud API is also documented as an OpenAPI Schema.

List Projects

List a user's projects.
GET https://cloud.mobify.com/api/projects/

URL Parameters

FieldTypeDescription
limitintegerOptional. Number of results to return per page.
offsetintegerOptional. The initial index from which to return the results.
organizationstringOptional. Filter results by organization. Pass empty value to filter personal projects (the projects that do not have an organization associated)

Response

200

Success response

{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"name": "Progressive SSR project",
"url": "http://www.example.com/",
"slug": "progressive-ssr-project",
"organization": "my-organization"
}
]
}

Create Project

Create a new project.
POST https://cloud.mobify.com/api/projects/

URL Parameters

FieldTypeDescription

Request Body

FieldTypeDescription
namestringOptional. User-friendly name for this project.
urlstringOptional.
organizationstringOptional.

Request example

{
"organization": "testorg",
"name": "test 6",
"url": "https://www.mobify.com"
}

Response

200

Read Project

Read data about a project.
GET https://cloud.mobify.com/api/projects/{project_slug}/

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.

Response

200

Success response

{
"name": "test project",
"url": "https://www.google.com",
"slug": "test-project",
"organization": "my-organization"
}

Update Project

Update a project settings.
PATCH https://cloud.mobify.com/api/projects/{project_slug}/

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.

Request Body

FieldTypeDescription
namestringOptional. User-friendly name for this project.
urlstringOptional.
organizationstringOptional.

Request example

{
"name": "new name",
"url": "https://www.mobify.com",
"organization": "my-organization"
}

Response

200

Success response

{
"name": "test project",
"url": "https://www.google.com",
"slug": "test-project",
"organization": "my-organization"
}

Delete Project

Delete a project.
DELETE https://cloud.mobify.com/api/projects/{project_slug}/

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.

Response

204

List Bundles

List bundles of a project
GET https://cloud.mobify.com/api/projects/{project_slug}/bundles/

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.
limitintegerOptional. Number of results to return per page.
offsetintegerOptional. The initial index from which to return the results.
searchstringOptional. A search term.

Response

200

Success response

{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"id": 3,
"message": "Bundle 2",
"active": true,
"status": 0,
"user": "fixture+progressive.ssr@test.com",
"created_at": "2020-05-27T22:45:35.781615Z",
"updated_at": "2020-07-09T04:59:37.733245Z",
"is_uploaded": true,
"is_ssr_bundle": true,
"ssr_runtime": "12.x",
"ssr_runtime_description": "NodeJS 12.x"
},
{
"id": 2,
"message": "Bundle 1",
"active": true,
"status": 0,
"user": "fixture+progressive.ssr@test.com",
"created_at": "2020-05-27T22:45:35.703516Z",
"updated_at": "2020-07-09T04:57:02.399510Z",
"is_uploaded": true,
"is_ssr_bundle": true,
"ssr_runtime": "10.x",
"ssr_runtime_description": "NodeJS 10.x"
},
{
"id": 1,
"message": "Bundle 0",
"active": true,
"status": 0,
"user": "fixture+progressive.ssr@test.com",
"created_at": "2020-05-27T22:45:35.646125Z",
"updated_at": "2020-07-09T06:12:19.633249Z",
"is_uploaded": true,
"is_ssr_bundle": true,
"ssr_runtime": "8.10",
"ssr_runtime_description": "NodeJS 8.10"
}
]
}

List Targets

List a project's targets.
GET https://cloud.mobify.com/api/projects/{project_slug}/target/

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.
limitintegerOptional. Number of results to return per page.
offsetintegerOptional. The initial index from which to return the results.
searchstringOptional. A search term.

Response

200

Success response

{
"count": 4,
"next": null,
"previous": null,
"results": [
{
"slug": "production",
"name": "Production",
"hostname": null,
"current_deploy": {
"status": "queued",
"is_ssr_deploy": false,
"updated_at": "2018-07-25T21:35:24.312882+00:00",
"bundle": {
"status": 0,
"api_bundle_preview_email_url": "/api/projects/progressive-ssr-project/bundle/0/preview-email/",
"go_preview_url": "http://go.dev:8000/progressive-ssr-project/b/0",
"updated_at": "2018-07-25T21:35:24.311809+00:00",
"app_preview_url": null,
"message": "Reset Bundle. Disables adaptation.",
"id": 0,
"is_uploaded": true,
"created_at": "2018-07-25T21:35:24.311775+00:00",
"preview_url": "http://http.www.example.com.tag.mobifyproxy.com/#mobify-override&mobify-path=true&mobify-url=http://unicorns.mobify.com/sites/progressive-ssr-project/bundles/0/loader.js&mobify-domain=&mobify-all=true&mobify=1&mobify-debug=1&mobify-js=1",
"is_ssr_bundle": false,
"user_email": ""
},
"is_in_progress": true,
"deploy_settings": null,
"deploy_type": "reset_bundle",
"created_at": "2018-07-25T21:35:24.312855+00:00",
"deploy_duration": 778590.636166,
"applied_deploy_settings": false,
"status_message": "Queueing Bundle"
},
"ssr_external_hostname": "www-testing.example.com",
"ssr_external_domain": "example.com",
"ssr_region": "eu-central-1",
"ssr_whitelisted_ips": "103.12.25.0/24",
"ssr_proxy_configs": [
{
"host": "www.proxyhost1.com",
"protocol": "https"
},
{
"host": "www.proxyhost2.com"
}
]
}
]
}

Create Target

Create a new target.
POST https://cloud.mobify.com/api/projects/{project_slug}/target/

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.

Request Body

FieldTypeDescription
slugstringOptional.
namestringOptional. User-friendly name for this target.
hostnamestringOptional. Hostname (literal or JavaScript regular expression between / characters) on which this target should be loaded by the V8 Tag.
ssr_external_hostnamestringOptional. The full hostname to be used for a Universal PWA SSR deployment (e.g. www.customer.com).
ssr_external_domainstringOptional. The domain to be used for a Universal PWA SSR deployment (e.g. customer.com).
ssr_regionOptional. The AWS region to which a Universal PWA SSR should be deployed (e.g. us-east-1). Allowed values us-east-1, us-east-2, us-west-1, us-west-2, ap-south-1, ap-northeast-2, ap-southeast-1, ap-southeast-2, ap-northeast-1, ca-central-1, eu-central-1, eu-west-1, eu-west-2, eu-west-3
ssr_whitelisted_ipsstringOptional. Optional space-separated list of IP addresses (CIDR blocks) that can access this target. Leave blank to whitelist all IPs.
ssr_proxy_configsarrayOptional. Proxy Configs. The value should be a JSON array..

Request example

{
"name": "Testing EU",
"slug": "testing-eu",
"ssr_external_hostname": "www-testing.example.com",
"ssr_external_domain": "example.com",
"ssr_region": "eu-central-1",
"ssr_whitelisted_ips": "103.12.25.0/24",
"ssr_proxy_configs": [
{
"host": "www.proxyhost1.com",
"protocol": "https"
},
{
"host": "www.proxyhost2.com"
}
]
}

Response

200

Success response

{
"name": "Testing EU",
"slug": "testing-eu",
"ssr_external_hostname": "www-testing.example.com",
"ssr_external_domain": "example.com",
"ssr_region": "eu-central-1",
"ssr_whitelisted_ips": "103.12.25.0/24",
"ssr_proxy_configs": [
{
"host": "www.proxyhost1.com",
"protocol": "https"
},
{
"host": "www.proxyhost2.com"
}
]
}

Read Target

Read data about a target.
GET https://cloud.mobify.com/api/projects/{project_slug}/target/{target_slug}/

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.
target_slugstringRequired. The target identifier.

Response

200

Success response

{
"slug": "ssr-target-successful",
"name": "Testing EU",
"hostname": "www0.somewhere.com",
"current_deploy": {
"status": "queued",
"is_ssr_deploy": true,
"updated_at": "2018-08-10T16:54:38.871068+00:00",
"bundle": {
"status": 0,
"api_bundle_preview_email_url": "/api/projects/progressive-ssr-project/bundle/2/preview-email/",
"go_preview_url": "http://go.dev:8000/progressive-ssr-project/b/2",
"updated_at": "2018-07-25T21:35:24.801637+00:00",
"app_preview_url": null,
"message": "SSR Bundle 1 (failed deploy 81)",
"id": 2,
"is_uploaded": true,
"created_at": "2018-07-25T21:35:24.762928+00:00",
"preview_url": "http://http.www.example.com.tag.mobifyproxy.com/#mobify-override&mobify-path=true&mobify-url=http://unicorns.mobify.com/sites/progressive-ssr-project/bundles/2/loader.js&mobify-domain=&mobify-all=true&mobify=1&mobify-debug=1&mobify-js=1",
"is_ssr_bundle": true,
"user_email": "fixture+progressive.ssr@test.com"
},
"external_publish_id": "None",
"external_progress_update": null,
"external_progress_percentage": null,
"is_in_progress": true,
"deploy_settings": null,
"external_progress_status": null,
"deploy_type": "publish",
"created_at": "2018-08-10T16:54:38.871027+00:00",
"deploy_duration": 2.356207,
"external_progress_message": null,
"applied_deploy_settings": false,
"status_message": "Queueing Bundle",
"user_email": "fixture+tag.page.staff@test.com",
"external_progress_description": null
},
"ssr_external_hostname": "www-testing.example.com",
"ssr_external_domain": "example.com",
"ssr_region": "eu-central-1",
"ssr_whitelisted_ips": "103.12.25.0/24",
"ssr_proxy_configs": [
{
"host": "www.proxyhost1.com",
"protocol": "http"
},
{
"host": "www.proxyhost2.com",
"protocol": "https"
}
]
}

Update Target

Update a target. Important: This endpoint automatically re-deploys the current bundle if any of the SSR-related properties are changed.
PATCH https://cloud.mobify.com/api/projects/{project_slug}/target/{target_slug}/

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.
target_slugstringRequired. The target identifier.

Request Body

FieldTypeDescription
namestringOptional. User-friendly name for this target.
hostnamestringOptional. Hostname (literal or JavaScript regular expression between / characters) on which this target should be loaded by the V8 Tag.
ssr_external_hostnamestringOptional. The full hostname to be used for a Universal PWA SSR deployment (e.g. www.customer.com).
ssr_external_domainstringOptional. The domain to be used for a Universal PWA SSR deployment (e.g. customer.com).
ssr_regionOptional. The AWS region to which a Universal PWA SSR should be deployed (e.g. us-east-1). Allowed values us-east-1, us-east-2, us-west-1, us-west-2, ap-south-1, ap-northeast-2, ap-southeast-1, ap-southeast-2, ap-northeast-1, ca-central-1, eu-central-1, eu-west-1, eu-west-2, eu-west-3
ssr_whitelisted_ipsstringOptional. Optional space-separated list of IP addresses (CIDR blocks) that can access this target. Leave blank to whitelist all IPs.
ssr_proxy_configsarrayOptional. Proxy Configs. The value should be a JSON array..

Request example

{
"name": "Testing EU",
"ssr_external_hostname": "www-testing.example.com",
"ssr_external_domain": "example.com",
"ssr_region": "eu-central-1",
"ssr_whitelisted_ips": "103.12.25.0/24",
"ssr_proxy_configs": [
{
"host": "www.proxyhost1.com",
"protocol": "http"
},
{
"host": "www.proxyhost2.com",
"protocol": "https"
}
]
}

Response

200

Success response

{
"slug": "ssr-target-successful",
"name": "Testing EU",
"hostname": "www0.somewhere.com",
"current_deploy": {
"status": "queued",
"is_ssr_deploy": true,
"updated_at": "2018-08-10T16:54:38.871068+00:00",
"bundle": {
"status": 0,
"api_bundle_preview_email_url": "/api/projects/progressive-ssr-project/bundle/2/preview-email/",
"go_preview_url": "http://go.dev:8000/progressive-ssr-project/b/2",
"updated_at": "2018-07-25T21:35:24.801637+00:00",
"app_preview_url": null,
"message": "SSR Bundle 1 (failed deploy 81)",
"id": 2,
"is_uploaded": true,
"created_at": "2018-07-25T21:35:24.762928+00:00",
"preview_url": "http://http.www.example.com.tag.mobifyproxy.com/#mobify-override&mobify-path=true&mobify-url=http://unicorns.mobify.com/sites/progressive-ssr-project/bundles/2/loader.js&mobify-domain=&mobify-all=true&mobify=1&mobify-debug=1&mobify-js=1",
"is_ssr_bundle": true,
"user_email": "fixture+progressive.ssr@test.com"
},
"external_publish_id": "None",
"external_progress_update": null,
"external_progress_percentage": null,
"is_in_progress": true,
"deploy_settings": null,
"external_progress_status": null,
"deploy_type": "publish",
"created_at": "2018-08-10T16:54:38.871027+00:00",
"deploy_duration": 2.356207,
"external_progress_message": null,
"applied_deploy_settings": false,
"status_message": "Queueing Bundle",
"user_email": "fixture+tag.page.staff@test.com",
"external_progress_description": null
},
"ssr_external_hostname": "www-testing.example.com",
"ssr_external_domain": "example.com",
"ssr_region": "eu-central-1",
"ssr_whitelisted_ips": "103.12.25.0/24",
"ssr_proxy_configs": [
{
"host": "www.proxyhost1.com",
"protocol": "http"
},
{
"host": "www.proxyhost2.com",
"protocol": "https"
}
]
}

Delete Target

Delete a target.
DELETE https://cloud.mobify.com/api/projects/{project_slug}/target/{target_slug}/

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.
target_slugstringRequired. The target identifier.

Response

204

List Redirects

For server-side rendered projects. List a target’s redirects.
GET https://cloud.mobify.com/api/projects/{project_slug}/target/{target_slug}/redirect/

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.
target_slugstringRequired. The target identifier.
limitintegerOptional. Number of results to return per page.
offsetintegerOptional. The initial index from which to return the results.
searchstringOptional. A search term.
orderingstringOptional. Which field to use when ordering the results.

Response

200

Success response

{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"from_path": "/spring",
"to_url": "/summer",
"forward_querystring": false,
"http_status_code": 301,
"publishing_status": "Pending",
"user_email": "john.doe@mobify.com",
"updated_by": "john.doe@mobify.com",
"created_at": "2020-02-26T18:05:28.873516Z",
"updated_at": "2020-02-26T18:05:35.625877Z"
}
]
}

Create Redirect

For server-side rendered projects. Create redirect(s). Accepts either an object with values for a single redirect, or an array of objects for bulk creation. We recommend that you always create redirects in your staging target, and then clone them to your production target. This allows you to test the redirects and verify that they work as expected.
POST https://cloud.mobify.com/api/projects/{project_slug}/target/{target_slug}/redirect/

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.
target_slugstringRequired. The target identifier.

Request Body

FieldTypeDescription
from_pathstringOptional.
to_urlstringOptional.
forward_querystringstringOptional.
forward_wildcardstringOptional.
http_status_codeOptional. Allowed values 301, 302

Request example

{
"from_path": "/spring/*",
"to_url": "/summer",
"forward_querystring": false,
"forward_wildcard": true
}

Response

200

Success response

{
"from_path": "/spring",
"to_url": "/summer",
"forward_querystring": false,
"forward_wildcard": true,
"http_status_code": 301,
"publishing_status": "Pending",
"user_email": "john.doe@mobify.com",
"updated_by": "john.doe@mobify.com",
"created_at": "2020-02-26T18:05:28.873516Z",
"updated_at": "2020-02-26T18:05:35.625877Z"
}

Read Redirect

For server-side rendered projects. Read data about a redirect by from_path.
GET https://cloud.mobify.com/api/projects/{project_slug}/target/{target_slug}/redirect/{from_path}

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.
target_slugstringRequired. The target identifier.
from_pathstringRequired. The redirect's from_path.

Response

200

Update Redirect

For server-side rendered projects. Update a redirect by from_path. We recommend that you always change redirects in your staging target, and then clone the changes to your production target.
PATCH https://cloud.mobify.com/api/projects/{project_slug}/target/{target_slug}/redirect/{from_path}

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.
target_slugstringRequired. The target identifier.
from_pathstringRequired. The redirect's from_path.

Request Body

FieldTypeDescription
from_pathstringOptional.
to_urlstringOptional.
forward_querystringstringOptional.
forward_wildcardstringOptional.
http_status_codeOptional. Allowed values 301, 302

Request example

{
"from_path": "/spring",
"to_url": "/summer",
"http_status_code": "301"
}

Response

200

Success response

{
"from_path": "/spring",
"to_url": "/summer",
"http_status_code": 301,
"publishing_status": "Pending",
"user_email": "john.doe@mobify.com",
"updated_by": "john.doe@mobify.com",
"created_at": "2020-02-26T18:05:28.873516Z",
"updated_at": "2020-02-26T18:05:35.625877Z"
}

Delete Redirect

For server-side rendered projects. Delete a redirect by from_path. We recommend that you always delete redirects in your staging target, and then clone the changes to your production target.
DELETE https://cloud.mobify.com/api/projects/{project_slug}/target/{target_slug}/redirect/{from_path}

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.
target_slugstringRequired. The target identifier.
from_pathstringRequired. The redirect's from_path.

Response

204

List Organizations

List a user's organizations.
GET https://cloud.mobify.com/api/organizations/

URL Parameters

FieldTypeDescription
limitintegerOptional. Number of results to return per page.
offsetintegerOptional. The initial index from which to return the results.

Response

200

Success response

{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"uuid": "58c8da00-a596-4e62-9b93-dfc26a73528e",
"name": "my org",
"slug": "my-org",
"created_at": "2020-07-14T19:33:21.197800Z",
"updated_at": "2020-07-21T17:02:38.745978Z"
}
]
}

Get Profile

Get the profile information for the authenticated user.
GET https://cloud.mobify.com/api/users/me/profile/

URL Parameters

FieldTypeDescription

Response

200

Success response

{
"firstname": "thomas",
"lastname": "berko",
"email": "thomas.berko@example.com"
}

Update Profile

Update the profile information for the authenticated user.
PATCH https://cloud.mobify.com/api/users/me/profile/

URL Parameters

FieldTypeDescription

Request Body

FieldTypeDescription
firstnamestringOptional.
lastnamestringOptional.

Request example

{
"firstname": "thomas",
"lastname": "berko"
}

Response

200

Success response

{
"firstname": "thomas",
"lastname": "berko",
"email": "thomas.berko@example.com"
}

Create Deploy

Deploy a bundle to a target. Returns the status of the deploy object. Important: some publish information may not be immediately reflected in the HTTP response because publishing is an asynchronous operation. Query the target in a few seconds for the latest information regarding the publish operation.
POST https://cloud.mobify.com/api/projects/{project_slug}/target/{target_slug}/deploy/

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.
target_slugstringRequired. The target identifier.

Request Body

FieldTypeDescription
bundle_idstringOptional.

Request example

{
"bundle_id": "22"
}

Response

200

Success response

{
"status": "queued",
"is_ssr_deploy": true,
"updated_at": "2019-10-09T19:43:04.108157+00:00",
"bundle": {
"status": 0,
"api_bundle_preview_email_url": "/api/projects/progressive-ssr-project/bundle/3/preview-email/",
"go_preview_url": "http://go.dev:8000/progressive-ssr-project/b/3",
"updated_at": "2019-10-09T17:31:00.418509+00:00",
"app_preview_url": null,
"message": "SSR Bundle 2 (running deploy 83)",
"id": 3,
"is_uploaded": true,
"created_at": "2019-10-09T17:31:00.383617+00:00",
"preview_url": "http://http.www.example.com",
"is_ssr_bundle": true,
"user_email": "fixture+progressive.ssr@test.com"
},
"external_publish_id": "None",
"external_progress_update": null,
"external_progress_percentage": null,
"is_in_progress": true,
"deploy_settings": null,
"external_progress_status": null,
"deploy_type": "publish",
"created_at": "2019-10-09T19:43:04.108107+00:00",
"deploy_duration": 0.305502,
"external_progress_message": null,
"external_publish_details": {},
"applied_deploy_settings": false,
"status_message": "Queueing Bundle",
"user_email": "fixture+progressive.ssr@test.com",
"external_progress_description": null
}

Create Cache Invalidation

Invalidate a target's cached objects in the CDN and Application Cache.
POST https://cloud.mobify.com/api/projects/{project_slug}/target/{target_slug}/invalidation/

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.
target_slugstringRequired. The target identifier.

Request Body

FieldTypeDescription
patternstringOptional.
itemsarrayOptional.
namespacestringOptional.

Request example

{
"pattern": "/path/to/products/*/",
"items": [
"product_1",
"product_2"
],
"namespace": "demo"
}

Response

200

Success response

{
"result": "Cache invalidation is in progress.",
"slug": "testing-eu",
"count": 2
}

Clone Redirects

For server-side rendered projects. Clone all redirects from your staging target to your production target. Important: when you clone redirects, you're replacing all the redirects in the production target with all the redirects in the staging target.
POST https://cloud.mobify.com/api/projects/{project_slug}/target/{to_target_slug}/redirect/clone/

URL Parameters

FieldTypeDescription
project_slugstringRequired. The project your targets belong to.
to_target_slugstringRequired. The destination target identifier for clone operation.

Request Body

FieldTypeDescription
from_target_slugstringOptional.

Request example

{
"from_target_slug": "staging"
}

Response

200