Backups API – Version 2

Last modified: March 12, 2024

1 Introduction

The Backups API v2 lets you manage backups of the data in your app hosted in Mendix Cloud.

Data snapshots consist of a PostgreSQL database dump and all the file objects referenced from the database.

Database archives are a zip file which contains all the data in the snapshot, or the database and files separately if you prefer.

You cannot currently upload an archive through this API. This function is currently only supported via the Developer Portal. However, you can use this API to restore data from an existing environment snapshot.

This API focuses on working with snapshots and archives asynchronously, because these can be very long-running tasks for large quantities of data. It replaces the deprecated Backups API v1.

2 Authentication

The Backups API requires authentication via API keys that are bound to your Mendix account (for more information, see Deploy Authentication). In addition to the API Access permission, the Backups permission is also required to manage backups.

3 Examples

3.1 Downloading a Backup of Your Data

To download a backup of your data, do as follows:

  1. Make sure that you have an API key and the API Access and Backups permissions.

  2. If the snapshot already exists, find the snapshot ID.

  3. If the snapshot does not exist, call POST /api/v2/apps/<ProjectId>/environments/<EnvironmentId>/snapshots to create a snapshot. For more information, see the Request Creation of an Environment Snapshot section below.

  4. Use the value of snapshot_id in the output to create an archive file from the snapshot. To do so, call POST /api/v2/apps/<ProjectId>/environments/<EnvironmentId>/snapshots/<SnapshotId>/archives. For more information, see the Request Creation of a Snapshot Archive section below.

  5. Use the value of archive_id in the output to check whether the creation of the archive is completed. To do so, call GET /api/v2/apps/<ProjectId>/environments/<EnvironmentId>/snapshots/<SnapshotId>/archives/<ArchiveId>. For more information, see the Request Status of Creation of an Archive section below.

  6. After the archive is created, use the value of url in the output to download the backup archive.

4 API Calls

4.1 List Environment Snapshots

4.1.1 Description

Lists the snapshots of an environment. By setting the offset parameter, you can page through the list of snapshots created for an environment.

1
2
HTTP Method: GET
URL: https://deploy.mendix.com/api/v2/apps/<ProjectId>/environments/<EnvironmentId>/snapshots

4.1.2 Request

Request Parameters

Query Parameters

  • offset (Long): Number of items to offset. Default is 0.
  • limit (Long): Maximum number of items in response. Default is 100.

Example Request

1
2
3
4
5
6
GET /api/v2/apps/543857rfds-dfsfsd12c5e24-3224d32eg/environments/cd5fc610-edb0-43c5-a374-0439a6411ace/snapshots?offset=0&limit=2
Host: deploy.mendix.com

Content-Type: application/json
Mendix-Username: richard.ford51@example.com
Mendix-ApiKey:  26587896-1cef-4483-accf-ad304e2673d6

4.1.3 Output

An object with the following key-value pairs:

  • snapshots (List): List of snapshot objects.
  • total (Long): The total number of snapshots for the requested environment.
  • offset (Long): The offset value of the current request.
  • limit (Long): The limit value of the current request.

Error Codes

HTTP Status Error code Description
400 INVALID_PARAMETERS Not enough parameters given. Please set project_id and environment_id parameters.
400 NOT_SUPPORTED This endpoint can only be used with Mendix Cloud
403 NO_ACCESS The user does not have access to the backups of this environment.
404 ENVIRONMENT_NOT_FOUND Environment not found.
500 SNAPSHOT_LISTING_FAILED An error occurred while listing the backups. Please contact Support.

Example Output

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
	"limit": 5,
	"offset": 0,
	"total": 32,
	"snapshots": [
		{
			"snapshot_id": "5deda9e2-f882-4925-830c-45e73c57366e",
			"model_version": "8.12.7.11687",
			"comment": "Uploaded snapshot",
			"expires_at": "2021-08-05T18:38:41.000Z",
			"state": "completed",
			"status_message": "Completed extraction",
			"created_at": "2021-05-05T18:38:41.000Z",
			"finished_at": "2021-05-05T18:40:12.000Z",
			"updated_at": "2021-05-05T18:40:12.000Z"
		},
		{
			"snapshot_id": "bf45ed4d-3308-4fb9-876b-36453ba149bf",
			"model_version": "8.12.7.11687",
			"comment": "Automatically created nightly snapshot",
			"expires_at": "2021-05-18T01:41:27.000Z",
			"state": "completed",
			"status_message": "Completed backup creation",
			"created_at": "2021-05-04T01:41:27.000Z",
			"finished_at": "2021-05-04T01:45:47.000Z",
			"updated_at": "2021-05-04T01:45:47.000Z"
		}
	]
}

4.2 Request Creation of an Environment Snapshot

4.2.1 Description

Request the creation of a snapshot of an environment. The response is a JSON object containing the snapshot_id attribute that identifies a snapshot. Use the snapshot_id in an API request to check the progress of the creation of this snapshot.

1
2
HTTP Method: POST
URL: https://deploy.mendix.com/api/v2/apps/<ProjectId>/environments/<EnvironmentId>/snapshots

4.2.2 Request

Request Parameters

Request Body

A JSON object with the following attributes:

  • comment (String): Optional comment for this snapshot.

Example Request

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
POST /api/v2/apps/543857rfds-dfsfsd12c5e24-3224d32eg/environments/cd5fc610-edb0-43c5-a374-0439a6411ace/snapshots
Host: deploy.mendix.com

Content-Type: application/json
Mendix-Username: richard.ford51@example.com
Mendix-ApiKey:  26587896-1cef-4483-accf-ad304e2673d6

{
     "comment" :  "My snapshot"
}

4.2.3 Output

A JSON object with the following key-value pairs:

  • snapshot_id (String): Unique identification of the snapshot job.
  • status_message (String): Human readable status message of this job.
  • finished_at (String): ISO 8601 date and time when this job reached the end state.
  • updated_at (String): ISO 8601 date and time when this job was updated.
  • created_at (String): ISO 8601 date and time when this job was created.
  • state (String): Current state of this job. It always starts with queued followed by running and eventually reaches either failed or completed end states.
  • model_version (String): Model version that was running when the snapshot was created.
  • expires_at (String): ISO 8601 date and time when this snapshot will be expired.
  • comment (String): A comment describing this snapshot. Can be set by users for easier future reference.

Error Codes

HTTP Status Error code Description
400 INVALID_PARAMETERS Not enough parameters given. Please set project_id and environment_id parameters.
400 NOT_SUPPORTED This endpoint can only be used with Mendix Cloud
400 ENVIRONMENT_BUSY Environment is busy, please try again later or contact Support for assistance.
400 INVALID_STATE Failed to create a backup. There is currently a maintenance action in progress. Please wait until that is finished.
403 NO_ACCESS The user does not have access to the backups of this environment.
404 ENVIRONMENT_NOT_FOUND Environment not found.
404 NOT_FOUND Snapshot not found.
500 SERVICE_UNAVAILABLE Operation failed. Please try again later or contact Support if the problem persists.

Example Output

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
   "status_message":null,
   "model_version":null,
   "expires_at":"2020-05-18T16:00:18.000Z",
   "finished_at":null,
   "updated_at":null,
   "snapshot_id":"51dc7872-771e-4c3e-853b-352359444db6",
   "created_at":"2020-02-18T16:00:18.000Z",
   "comment":"My snapshot",
   "state":"queued"
}

4.3 Request Status of Creation of a Snapshot

4.3.1 Description

Check the current status of an ongoing snapshot creation.

1
2
HTTP Method: GET
URL: https://deploy.mendix.com/api/v2/apps/<ProjectId>/environments/<EnvironmentId>/snapshots/<SnapshotId>

4.3.2 Request

Request Parameters

  • ProjectId (String): Unique project identifier. Can be looked up via the Developer Portal or apps API.
  • EnvironmentId (String): Unique environment identifier. Can be looked up via the Developer Portal or environments API.
  • SnapshotId (String): Identifier of the snapshot being created.

Example Request

1
2
3
4
5
6
GET /api/v2/apps/543857rfds-dfsfsd12c5e24-3224d32eg/environments/cd5fc610-edb0-43c5-a374-0439a6411ace/snapshots/51dc7872-771e-4c3e-853b-352359444db6
Host: deploy.mendix.com

Content-Type: application/json
Mendix-Username: richard.ford51@example.com
Mendix-ApiKey:  26587896-1cef-4483-accf-ad304e2673d6

4.3.3 Output

An object with the following key-value pairs:

  • snapshot_id (String): Unique identification of the snapshot job.
  • status_message (String): Human readable status message of this job.
  • finished_at (String): ISO 8601 date and time when this job reached the end state.
  • updated_at (String): ISO 8601 date and time when this job was updated.
  • created_at (String): ISO 8601 date and time when this job was created.
  • state (String): Current state of this job. It always starts with queued, followed by running, and eventually reaches a failed or completed end state.
  • model_version (String): Model version that was running when the snapshot was created.
  • expires_at (String): ISO 8601 date and time when this snapshot will be expired.
  • comment (String): A comment describing this snapshot. Can be set by users for easier future reference.

Error Codes

HTTP Status Error code Description
400 INVALID_PARAMETERS Not enough parameters given. Please set project_id and environment_id parameters.
400 NOT_SUPPORTED This endpoint can only be used with Mendix Cloud
403 NO_ACCESS The user does not have access to the backups of this environment.
404 ENVIRONMENT_NOT_FOUND Environment not found.
404 NOT_FOUND Snapshot not found.
500 SERVICE_UNAVAILABLE Operation failed. Please try again later or contact Support if the problem persists.

Example Output

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
   "status_message":"Completed backup creation",
   "model_version":"1.0.0.7",
   "expires_at":"2020-05-18T16:00:18.000Z",
   "finished_at":"2020-02-18T16:00:19.000Z",
   "updated_at":"2020-02-18T16:00:19.000Z",
   "snapshot_id":"51dc7872-771e-4c3e-853b-352359444db6",
   "created_at":"2020-02-18T16:00:18.000Z",
   "comment":"Manually created snapshot",
   "state":"completed"
}

4.4 Request Creation of a Snapshot Archive

4.4.1 Description

Requests the creation of an archive of a backup snapshot. The response is a JSON object containing the archive_id attribute which identifies an archive. use this archive_id in an API request to check the progress of the creation of this archive, and obtain a URL to allow you to download it.

1
2
HTTP Method: POST
URL: https://deploy.mendix.com/api/v2/apps/<ProjectId>/environments/<EnvironmentId>/snapshots/<SnapshotId>/archives

4.4.2 Request

Request Parameters

  • ProjectId (String): Unique project identifier. Can be looked up via the Developer Portal or apps API.
  • EnvironmentId (String): Unique environment identifier. Can be looked up via the Developer Portal or environments API.
  • SnapshotId (String): Identifier of the snapshot for which you want to create an archive.

Query Parameters

  • data_type (String): The type of data to retrieve. Valid types are: database_only and files_and_database. Default value is files_and_database.

Example Request

1
2
3
4
5
6
7
POST /api/v2/apps/543857rfds-dfsfsd12c5e24-3224d32eg/environments/cd5fc610-edb0-43c5-a374-0439a6411ace/snapshots/5f8ace23-19df-4134-bd67-c338142a6097/archives?data_type=database_only

Host: deploy.mendix.com

Content-Type: application/json
Mendix-Username: richard.ford51@example.com
Mendix-ApiKey:  26587896-1cef-4483-accf-ad304e2673d6

4.4.3 Output

An object with the following key-value pairs:

  • archive_id (String): Unique identification of the archive job.
  • status_message (String): Human readable status message of this job.
  • finished_at (String): ISO 8601 date and time when this job reached the end state.
  • updated_at (String): ISO 8601 date and time when this job was updated.
  • created_at (String): ISO 8601 date and time when this job was created.
  • state (String): Current state of this job. It always starts with queued, followed by running, and eventually reaches either a failed or completed end state.
  • data_type (String): Type of data of the requested archive.
  • snapshot_id (String): Snapshot identifier of which this archive belongs to.
  • url (String): Direct URL to the backup archive. This URL can be used with download managers.

Error Codes

HTTP Status Error code Description
400 INVALID_PARAMETERS Not enough parameters given. Please set project_id and environment_id parameters.
400 NOT_SUPPORTED This endpoint can only be used with Mendix Cloud
400 UNSUPPORTED Unsupported data_type
403 NO_ACCESS The user does not have access to the backups of this environment.
404 ENVIRONMENT_NOT_FOUND Environment not found.
404 NOT_FOUND Snapshot not found.
500 SERVICE_UNAVAILABLE Operation failed. Please try again later or contact Support if the problem persists.

Example Output

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
   "status_message":null,
   "finished_at":null,
   "updated_at":null,
   "snapshot_id":"5f8ace23-19df-4134-bd67-c338142a6097",
   "data_type":"database_only",
   "created_at":"2020-02-18T17:01:56.000Z",
   "state":"queued",
   "archive_id":"a6f519aa-a68e-4054-9341-2cfec72ea184",
   "url":null
}

4.5 Request Status of Creation of an Archive

4.5.1 Description

After a request to create an archive is submitted, you can check the progress of the archive creation using the archive_id. The archive creation will eventually reach one of the following end states: completed or failed. When it is completed, the url attribute is populated with a direct link to your requested backup. This link is valid for eight hours after completion.

1
2
HTTP Method: GET
URL: https://deploy.mendix.com/api/v2/apps/<ProjectId>/environments/<EnvironmentId>/snapshots/<SnapshotId>/archives/<ArchiveId>

4.5.2 Request

Request Parameters

  • ProjectId (String): Unique project identifier. Can be looked up via the Developer Portal or apps API.
  • EnvironmentId (String): Unique environment identifier. Can be looked up via the Developer Portal or environments API.
  • SnapshotId (String): Identifier of the backup.
  • ArchiveId (String): Identifier of the archive being created.

Example Request

1
2
3
4
5
6
7
GET /api/v2/apps/543857rfds-dfsfsd12c5e24-3224d32eg/environments/cd5fc610-edb0-43c5-a374-0439a6411ace/snapshots/5f8ace23-19df-4134-bd67-c338142a6097/archives/a6f519aa-a68e-4054-9341-2cfec72ea184

Host: deploy.mendix.com

Content-Type: application/json
Mendix-Username: richard.ford51@example.com
Mendix-ApiKey:  26587896-1cef-4483-accf-ad304e2673d6

4.5.3 Output

An object with the following key-value pairs:

  • archive_id (String): Unique identification of the archive job.
  • status_message (String): Human readable status message of this job.
  • finished_at (String): ISO 8601 date and time when this job reached the end state.
  • updated_at (String): ISO 8601 date and time when this job was updated.
  • created_at (String): ISO 8601 date and time when this job was created.
  • state (String): Current state of this job. It always starts with queued, followed by running, and eventually reaches either a failed or completed end state.
  • data_type (String): Type of data of the requested archive.
  • snapshot_id (String): Snapshot identifier of which this archive belongs to.
  • url (String): Direct URL to the backup archive. This URL can be used to download your backup archive file.

Error Codes

HTTP Status Error code Description
400 INVALID_PARAMETERS Not enough parameters given. Please set project_id and environment_id parameters.
400 NOT_SUPPORTED This endpoint can only be used with Mendix Cloud
403 NO_ACCESS The user does not have access to the backups of this environment.
404 ENVIRONMENT_NOT_FOUND Environment not found.
404 NOT_FOUND Snapshot not found.
404 NOT_FOUND Archive not found.

Example Output

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
   "status_message":"Done preparing download archive",
   "finished_at":"2020-02-18T17:01:57.000Z",
   "updated_at":"2020-02-18T17:01:57.000Z",
   "snapshot_id":"5f8ace23-19df-4134-bd67-c338142a6097",
   "data_type":"database_only",
   "created_at":"2020-02-18T17:01:56.000Z",
   "state":"completed",
   "archive_id":"a6f519aa-a68e-4054-9341-2cfec72ea184",
   "url":"https://…"
}

4.6 Update an Existing Snapshot

4.6.1 Description

Set a new comment for an existing snapshot. The updated_at attribute remains unchanged after this operation.

1
2
HTTP Method: PUT
URL: https://deploy.mendix.com/api/v2/apps/<ProjectId>/environments/<EnvironmentId>/snapshots/<SnapshotId>

4.6.2 Request

Request Parameters

  • ProjectId (String): Unique project identifier. Can be looked up via the Developer Portal or apps API.
  • EnvironmentId (String): Unique environment identifier. Can be looked up via the Developer Portal or environments API.
  • SnapshotId (String): Identifier of the backup.
  • Comment (String): Optional comment for this snapshot.

Request Body

A JSON object with the following attributes:

  • comment (String): New comment for this snapshot.

Example Request

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
PUT /api/v2/apps/543857rfds-dfsfsd12c5e24-3224d32eg/environments/cd5fc610-edb0-43c5-a374-0439a6411ace/snapshots/51dc7872-771e-4c3e-853b-352359444db6
Host: deploy.mendix.com

Content-Type: application/json
Mendix-Username: richard.ford51@example.com
Mendix-ApiKey:  26587896-1cef-4483-accf-ad304e2673d6

{
     "comment" :  "Hello"
}

4.6.3 Output

An object with the following key-value pairs:

  • snapshot_id (String): Unique identification of the snapshot job.
  • status_message (String): Human-readable status message of this job.
  • finished_at (String): ISO 8601 date and time when this job reached the end state.
  • updated_at (String): ISO 8601 date and time when this job was updated.
  • created_at (String): ISO 8601 date and time when this job was created.
  • state (String): Current state of this job. It always starts with queued, followed by running, and eventually reaches either a failed or completed end state.
  • model_version (String): Model version that was running when the snapshot was created.
  • expires_at (String): ISO 8601 date and time when this snapshot will be expired.
  • comment (String): A comment describing this snapshot. Can be set by users for easier future reference.

Error Codes

HTTP Status Error code Description
400 INVALID_PARAMETERS Not enough parameters given. Please set project_id and environment_id parameters.
400 NOT_SUPPORTED This endpoint can only be used with Mendix Cloud
403 NO_ACCESS The user does not have access to the backups of this environment.
404 ENVIRONMENT_NOT_FOUND Environment not found.
404 NOT_FOUND Snapshot not found.
500 SERVICE_UNAVAILABLE Operation failed. Please try again later or contact Support if the problem persists.

Example Output

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
   "status_message":"Completed backup creation",
   "model_version":"1.0.0.7",
   "expires_at":"2020-05-18T16:00:18.000Z",
   "finished_at":"2020-02-18T16:00:19.000Z",
   "updated_at":"2020-02-18T16:00:19.000Z",
   "snapshot_id":"51dc7872-771e-4c3e-853b-352359444db6",
   "created_at":"2020-02-18T16:00:18.000Z",
   "comment":"Hello",
   "state":"completed"
}

4.7 Delete an Existing Snapshot

4.7.1 Description

Delete an existing snapshot.

1
2
HTTP Method: DELETE
URL: https://deploy.mendix.com/api/v2/apps/<ProjectId>/environments/<EnvironmentId>/snapshots/<SnapshotId>

4.7.2 Request

Request Parameters

  • ProjectId (String): Unique project identifier. Can be looked up via the Developer Portal or apps API.
  • EnvironmentId (String): Unique environment identifier. Can be looked up via the Developer Portal or environments API.
  • SnapshotId (String): Identifier of the backup.
  • Comment (String): Optional comment for this snapshot.

Example Request

1
2
3
4
5
6
DELETE /api/v2/apps/543857rfds-dfsfsd12c5e24-3224d32eg/environments/cd5fc610-edb0-43c5-a374-0439a6411ace/snapshots/51dc7872-771e-4c3e-853b-352359444db6
Host: deploy.mendix.com

Content-Type: application/json
Mendix-Username: richard.ford51@example.com
Mendix-ApiKey:  26587896-1cef-4483-accf-ad304e2673d6

4.7.3 Output

Error Codes

HTTP Status Error code Description
400 INVALID_PARAMETERS Not enough parameters given. Please set project_id and environment_id parameters.
400 NOT_SUPPORTED This endpoint can only be used with Mendix Cloud
403 NO_ACCESS The user does not have access to the backups of this environment.
404 ENVIRONMENT_NOT_FOUND Environment not found.
500 SERVICE_UNAVAILABLE Operation failed. Please try again later or contact Support if the problem persists.

Example Output

No content is returned when a backup has been successfully removed.

4.8 Request a Restore of a Snapshot to an Environment

4.8.1 Description

Restore a previously created backup snapshot to an environment. The environment to which the data will be restored must be stopped before using this call. The response of a successful call contains the details of the request. This call is only available for Mendix Cloud applications. Please note that the source_snapshot_id can be a snapshot created for a different environment, similar to the “restore into” functionality in the Developer Portal.

1
2
HTTP Method: POST
URL: https://deploy.mendix.com/api/v2/apps/<ProjectId>/environments/<EnvironmentId>/restores

4.8.2 Request

Request Parameters

Query Parameters

  • source_snapshot_id (String): Identifier of the snapshot that will be restored. This value is required; it must belong to a snapshot within the same application, although it could be a different environment.

  • db_only (Boolean): Boolean flag. Set this to true if you are doing a database-only restore operation. It defaults to false if not present.

Example Request

1
2
3
4
5
6
POST /api/v2/apps/b5f19af7-7453-465e-b9a1-d7556f524c1e/environments/d436e0cd-6200-4ac5-b858-849a6ddbb56a/restores?source_snapshot_id=5f8ace23-19df-4134-bd67-c338142a6097
Host: deploy.mendix.com

Content-Type: application/json
Mendix-Username: richard.ford51@example.com
Mendix-ApiKey:  26587896-1cef-4483-accf-ad304e2673d6
1
2
3
4
5
6
POST /api/v2/apps/b5f19af7-7453-465e-b9a1-d7556f524c1e/environments/d436e0cd-6200-4ac5-b858-849a6ddbb56a/restores?source_snapshot_id=5f8ace23-19df-4134-bd67-c338142a6097&db_only=true
Host: deploy.mendix.com

Content-Type: application/json
Mendix-Username: richard.ford51@example.com
Mendix-ApiKey:  26587896-1cef-4483-accf-ad304e2673d6

4.8.3 Output

An object with the following key-value pairs:

  • restore_id (String): Unique identification of the restore job.
  • status_message (String): Human readable status message of this job.
  • finished_at (String): ISO 8601 date and time when this job reached the end state.
  • updated_at (String): ISO 8601 date and time when this job was updated.
  • created_at (String): ISO 8601 date and time when this job was created.
  • state (String): Current state of this job. It always starts with queued, followed by running, and eventually reaches either a failed or completed end state.
  • source_snapshot_id (String): Identifier of the snapshot being restored.
  • source_environment_id (String): Identifier of the environment from which the source snapshot was created.
  • target_environment_id (String): Identifier of the target environment to which the snapshot is being restored.

Error Codes

HTTP Status Error code Description
400 INVALID_PARAMETERS Not enough parameters given. Please set project_id and environment_id parameters.
400 NOT_SUPPORTED This endpoint can only be used with Mendix Cloud
400 NOT_FOUND Source snapshot not found
400 INVALID_STATE Failed to restore a backup. There is currently a maintenance action in progress. Please wait until that is finished.
400 ERROR_NOT_ALLOWED Not allowed to restore backups.
400 ERROR_NOT_ALLOWED Restore failed, backup is not in the right state to start restoring.
400 ERROR_NOT_ALLOWED Please stop loft before restarting a backup.
400 ENVIRONMENT_BUSY Environment is busy, please try again later or contact Support for assistance.
403 NO_ACCESS The user does not have access to the backups of this environment.
404 ENVIRONMENT_NOT_FOUND Environment not found.
500 SERVICE_UNAVAILABLE Operation failed. Please try again later or contact Support if the problem persists.

Example Output

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
   "status_message":null,
   "restore_id":"11076b79-9df4-45d8-ac4b-dd79617138f5",
   "source_snapshot_id":"5f8ace23-19df-4134-bd67-c338142a6097",
   "finished_at":null,
   "updated_at":null,
   "target_environment_id":"d436e0cd-6200-4ac5-b858-849a6ddbb56a",
   "created_at":"2020-02-18T16:46:26.000Z",
   "state":"queued",
   "source_environment_id":"d436e0cd-6200-4ac5-b858-849a6ddbb56a"
}

4.9 Request Status of a Snapshot Restore

4.9.1 Description

Check the status of a restore request.

1
2
HTTP Method: GET
URL: https://deploy.mendix.com/api/v2/apps/<ProjectId>/environments/<EnvironmentId>/restores/<RestoreId>

4.9.2 Request

Request Parameters

  • ProjectId (String): Unique project identifier. Can be looked up via the Developer Portal or apps API.
  • EnvironmentId (String): Unique environment identifier. Can be looked up via the Developer Portal or environments API.
  • RestoreId (String): Identifier of the request to restore the data.

Example Request

1
2
3
4
5
6
GET /api/v2/apps/b5f19af7-7453-465e-b9a1-d7556f524c1e/environments/d436e0cd-6200-4ac5-b858-849a6ddbb56a/restores/11076b79-9df4-45d8-ac4b-dd79617138f5
Host: deploy.mendix.com

Content-Type: application/json
Mendix-Username: richard.ford51@example.com
Mendix-ApiKey:  26587896-1cef-4483-accf-ad304e2673d6

4.9.3 Output

An object with the following key-value pairs:

  • restore_id (String): Unique identification of the restore job.
  • status_message (String): Human0readable status message of this job.
  • finished_at (String): ISO 8601 date and time when this job reached the end state.
  • updated_at (String): ISO 8601 date and time when this job was updated.
  • created_at (String): ISO 8601 date and time when this job was created.
  • state (String): Current state of this job. It always starts with queued, followed by running, and eventually reaches either a failed or completed end state.
  • source_snapshot_id (String): Identifier of the snapshot being restored.
  • source_environment_id (String): Identifier of the environment from which the source snapshot was created.
  • target_environment_id (String): Identifier of the target environment to which the snapshot is being restored.

Error Codes

HTTP Status Error code Description
400 INVALID_PARAMETERS Not enough parameters given. Please set project_id and environment_id parameters.
400 NOT_SUPPORTED This endpoint can only be used with Mendix Cloud
400 NOT_FOUND Restore not found
403 NO_ACCESS The user does not have access to the backups of this environment.
404 ENVIRONMENT_NOT_FOUND Environment not found.

Example Output

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
   "status_message":"Restore completed",
   "restore_id":"11076b79-9df4-45d8-ac4b-dd79617138f5",
   "source_snapshot_id":"5f8ace23-19df-4134-bd67-c338142a6097",
   "finished_at":"2020-02-18T16:46:26.000Z",
   "updated_at":"2020-02-18T16:46:26.000Z",
   "target_environment_id":"d436e0cd-6200-4ac5-b858-849a6ddbb56a",
   "created_at":"2020-02-18T16:46:26.000Z",
   "state":"completed",
   "source_environment_id":"d436e0cd-6200-4ac5-b858-849a6ddbb56a"
}