Deploy API – Version 2

Last modified: March 7, 2024

1 Introduction

The Deploy API allows you to manage application environments in Mendix Cloud. Version 2 introduces improved APIs for some actions.

2 Authentication

The Deploy API requires authentication via API keys, as discussed in the Authentication section of Deploy API v1.

3 API Calls

3.1 Upload Package

3.1.1 Description

Uploads a deployment package from the local system to a specific app. This package can then be transported to a specific environment for deployment.

1
2
HTTP Method: POST
URL: https://deploy.mendix.com/api/v2/apps/<AppId>/packages/upload?name=<PackageName>

3.1.2 Request

3.1.2.1 Request Parameters
3.1.2.2 Example Request
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
POST /api/v2/apps/calc/packages/upload?name=calc_1.0.0.45.mda
Host: deploy.mendix.com

Mendix-Username: richard.ford51@example.com
Mendix-ApiKey:  26587896-1cef-4483-accf-ad304e2673d6
Content-Type: multipart/form-data; boundary=MultipartBoundary

--MultipartBoundary
Content-Disposition: form-data;

@%USERPROFILE%/Documents/Mendix/calc-main/releases/calc_1.0.0.45.mda
--MultipartBoundary--

Curl example:

1
curl -v -F "file=@%USERPROFILE%/Documents/Mendix/calc-main/releases/calc_1.0.0.45.mda"  -X POST -H "Mendix-Username: richard.ford51@example.com" -H "Mendix-ApiKey: 26587896-1cef-4483-accf-ad304e2673d6" "https://deploy.mendix.com/api/v2/apps/calc/packages/upload?name=calc_1.0.0.45.mda"

3.1.3 Output

The API call returns the following JSON:

1
2
3
4
{
    "PackageId": "<packageID>",
    "JobId": "<JobID>"
}

Where:

  • <packageID> is the ID of the package which will be created by the API
  • <JobID> is the ID of the job that is creating the package — the status of the job can be interrogated with the Job Status API

3.2 Job Status

3.2.1 Description

Find the status of a job using the JobID returned from an API call.

1
2
HTTP Method: GET
URL: https://deploy.mendix.com/api/v2/apps/<AppId>/jobs/<JobId>

3.2.2 Request

3.2.2.1 Request Parameters
  • AppId (String): Subdomain name of an app
  • JobID (String): the ID of a job that was triggered by a previous API call
3.2.2.2 Example Request
1
2
3
4
5
GET /api/v2/apps/calc/jobs/66046953-ecf7-4550-a889-4b7e9f1e1705
Host: deploy.mendix.com

Mendix-Username: richard.ford51@example.com
Mendix-ApiKey:  26587896-1cef-4483-accf-ad304e2673d6

3.2.3 Output

The API call returns the following JSON:

1
2
3
{
    "Status": "<status>"
}

Where <status> is one of the following:

  • Queued
  • Running
  • Completed
  • Failed