API reference

This guide describes interactions with Jaws Deploy platform programmatically via its RESTful API.

The API is focused on creating, deploying and promoting releases. More API endpoints related to topology management are coming soon.

Base URL

When issuing a request append the specific request endpoint to this base URL:

https://app.jawsdeploy.net/api

Authentication

All endpoints are protected with Basic Authentication. In order to authenticate against the API:

  • Go to Settings / Service Accounts
  • Create a service account and specify access rights using roles.
  • Create an API key for this account and store the key securely in a key-vault or a password manager.

When issuing an HTTP request attach the following request header:

Authorization: Basic <credentials>

‍where <credentials> is a string created by base-64 encoding login and API key delimited by a single colon. Pseudo-code:

request.Headers["Authorization"] =
    "Basic " +
    Base64_Encode("{login}:{apiKey}");

In case the credentials header is missing or is incorrect, the following response will be returned:

401 Unauthorized
{
   "error": "invalid credentials",
   "errorcode": 2002,
   "requestid": null
}

‍More information on creating the <credentials> token:
RFC 7617 - The 'Basic' HTTP Authentication Scheme (ietf.org)
HTTP authentication - HTTP | MDN (mozilla.org)

Requests and responses

POST, PUT and DELETE requests accept JSON-encoded bodies. Use the following request header when issuing these type of requests:

Content-Type: application/json

GET requests accept parameters in the query string.

The API responds with JSON-encoded bodies and standard HTTP status codes:

  • 200 OK when the request was successfully processed.
  • 400 Bad request when the request body is missing, when it is invalid (e.g. does not include required parameters) or when JSON content is malformed.
  • 401 Unauthorized when authentication fails (e.g. incorrect API key was used, or the API key did not have sufficient access rights).
  • 415 Unsupported Media Type when the Content-Type header was incorrect for endpoints that expect JSON payload (POST, PUT and DELETE).

Error codes

UnknownError = 1001
InvalidAccessToken = 2001
InvalidCredentials = 2002
InsufficientPermissions = 2003
InvalidParameter = 3001

Endpoints

Release - Create

This API endpoint creates a new release of a specific project. Release is an entity that represents state of the project (including a snapshot of all variable values and step logic). This endpoint does not trigger a deployment. Response includes releaseId which can be used to execute a deployment.

Request

Parameters
version
string
required
Unique version number of the new release.
projectId
string
required
Identifier of an existing project.
channelName
string
optional
Name of the channel, if project channels have been specified and the release should be controlled by one of the project channels.

When this value is not specified there are 2 possible behaviors:

- if the project has a channel tagged as Default - this channel will be used, but only when request field ignoreDefaultChannel is not specified, or set to false. When this field is set to true then the default channel will not be selected for this release (even if such channel exists in the project).

- if the project has no channels or ignoreDefaultChannel=true then release will be created without a channel, which means it can be deployed freely to any environment in this workspace
ignoreDefaultChannel
boolean
optional
Set to true to create a release without a channel, even if the project has a channel tagged as Default.
notes
string
optional
Release notes.
packageVersions
object
optional
Define package versions to be deployed with this release. Key is package ID and value is package version. Package IDs should exist in this project and versions should follow rules of Semantic Versioning 2.0.0 | Semantic Versioning (semver.org). Every package that belongs to the project and not specified in this property will fall back to its most recent (according to SemVer 2.0 rules) version. The most recent version is calculated at the time of creating the release (i.e. at the time of execution of this HTTP request), and not at deployment time. When a package ID incuded in this field does not exist in this project, or the version has invalid format (non-SemVer 2.0), or the version cannot be found - the request will fail with HTTP 400 status.
Request body

POST /release
{
  "version": "1.2.7023-RC1",
  "projectId": "a39dc3b5-39b2-478d-a179-51660813a5ff",
  "channelName": "NameOfTheChannel",
  "ignoreDefaultChannel": true,
  "notes": "Release notes",
  "packageVersions":
  {
    "package-01": "2.5.66-alpha",
    "package-02": "0.0.999"
  }
}

Response

Parameters
releaseId
string
Unique identifier of created release. Use this ID to further interact with the release - deploy or promote.
Response body

{
  "releaseId": "b34732f4-bcad-4b7f-a26b-a771cc7457ff"
}

Release - Deploy

This API endpoint deploys an existing release to specified environments or using specific lifecycle phase. After successful execution the response will include a list of deployment IDs which you can later use to check the deployments status.

Request

Parameters
releaseId
string
required
Unique identifier of the release to be deployed. This identifier can be obtained by calling Release - create endpoint.
phaseName
string
optional
Name of the phase to be deployed. When this value is not provided then environments must be provided.
environmentName
string
obsolete
Obsolete. Use environments instead.
environments
array[string]
optional
List of environment names to deploy to. When this value is not provided then phaseName must be provided.
redownloadPackages
boolean
optional
Instructs the deployment runner to force-download all required packages directly before executing the deployment, even if the packages are already present in the server’s package cache.
deploymentDateUnixMillis
number
optional
Deployment execution date. Allows postponing the deployment until a later date and time. Use Unix epoch time in milliseconds.
excludeStepNames
array[string]
optional
List of project step names that should be excluded in this deployment.
Request body

POST /release/deploy
{
  "releaseId": "b34732f4-bcad-4b7f-a26b-a771cc7457ff",
  "phaseName": "First phase",
  "environmentName": "Staging",
  "environments": ["Staging", "UAT"],
  "redownloadPackages": false,
  "deploymentDateUnixMillis": 1744308919000,
  "excludeStepNames": ["step A", "step C"]
}

Response

Parameters
deploymentIds
array[string]
List of unique identifiers of created deployments. Use these IDs to fetch deployment logs and state.
Response body

{
  "deploymentIds": [
    "603af550-e241-4a3f-9545-5971c2f455ff",
    "603af550-e241-4a3f-9545-5971c2f45500"
  ]
}

Release - Promote

This API endpoint deploys a specific release version of a given project to specified environments or using specific lifecycle phase. If no release version is provided then Jaws Deploy will pick an existing release with the highest version number (according to SemVer 2.0 rules). In such case the specified project needs to have at least one release. Otherwise an error will occur.

This endpoint is especially useful in CI/CD scenarios, where the build server does not track Jaws Deploy release identifiers. In such case it is enough to provide only project ID and the environment name to promote the latest release.

Similar to Release - Deploy response contains unique identifier of the created deployment entity.

Release version comparison and sorting is based on SemVer 2.0. More information: Semantic Versioning 2.0.0 | Semantic Versioning (semver.org)

Request

Parameters
projectId
string
required
Unique identifier of the project to be promoted.
version
string
optional
Version number that should be promoted. When not specified - release with the highest version number will be used.
phaseName
string
optional
Name of the phase to be promoted. When this value is not provided then environments must be provided.
environmentName
string
obsolete
Obsolete. Use environments instead.
environments
array[string]
optional
List of environment names to promote the release to. When this value is not provided then phaseName must be provided.
redownloadPackages
boolean
optional
Instructs the deployment runner to force-download all required packages directly before executing the deployment, even if the packages are already present in the server’s package cache.
deploymentDateUnixMillis
number
optional
Deployment execution date. Allows postponing the deployment until a later date and time. Use Unix epoch time in milliseconds.
excludeStepNames
array[string]
optional
List of project step names that should be excluded in this deployment.
Request body

POST /release/promote
{
  "projectId": "139118d5-bcac-4c92-b1d1-da755d7e78ff",
  "version": "1.0.5-rc2",
  "phaseName": "First phase",
  "environmentName": "Staging",
  "environments": ["Staging", "UAT"],
  "redownloadPackages": false,
  "deploymentDateUnixMillis": 1744308919000,
  "excludeStepNames": ["step A", "step C"]
}

Response

Parameters
deploymentIds
array[string]
List of unique identifiers of created deployments. Use these IDs to fetch deployment logs and state.
Response body

{
  "deploymentIds": [
    "603af550-e241-4a3f-9545-5971c2f455ff",
    "603af550-e241-4a3f-9545-5971c2f45500"
  ]
}

Deployment - Get status

This API endpoint returns deployment status and logs based on deployment unique identifier.

Request

Parameters
deploymentId
string
required
The unique identifier of the deployment entity.
skipLogs
boolean
optional
When set to true no logs will be returned - response will include only the deployment status information. By default logs are included in response.
getLogsAfter
number
optional
Specifies a .NET ticks value that represents a date. Only logs after this date will be returned.
More information on .NET ticks: https://learn.microsoft.com/en-us/dotnet/api/system.datetime.ticks?view=net-8.0#remarks.
Typically specify this value only after fetching first batch of deployment logs. The response of first batch will include a ticks value representing last returned log item. Use this value to implement log paging.
Request body

GET /deployment?
  deploymentId=603af550-e241-4a3f-9545-5971c2f455ff
  &skipLogs=true
  &getLogsAfter=1744308919000

Response

Parameters
status
object
Deployment status information.

Possible values of the Status property: Queued, Running, Completed, Failed, Cancelled, Validating, AwaitingSlot
logs
array[object]
Colleciton of deployment logs.

Possible values of the LogLevel property:
Trace,Debug, Information, Warning, Error, Critical, None
Response body

{
  "status": {
    "Status": "Completed",
    "ErrorCount": 0,
    "WarningCount": 0,
    "LastLogDate": "2024-08-12T08:39:20.443063+00:00",
    "LastLogDateTick": 638590487604430630,
    "LastUpdate": "2024-08-12T08:39:20.448381+00:00",
    "CancellationRequestedDate": null,
    "LastAttemptDate": "2024-08-12T08:39:10.204873+00:00",
    "CompleteDate": "2024-08-12T08:39:20.448381+00:00"
  },
  "logs": [
    {
      "CreatedLocalTime": null,
      "CreatedUtc": "2024-08-12T08:39:10.215781+00:00",
      "CreatedUtcTick": 638590487502157810,
      "Data": "Deployment starting",
      "DeploymentId": "c49f8f8b-7db4-4062-83c6-4a7c7f09a570",
      "DeploymentMonitorId": null,
      "ErrorCount": 0,
      "WarningCount": 0,
      "ExceptionData": null,
      "Id": "87d2f661-bed0-455a-a0f6-deb6a9b8f2c5",
      "LogLevel": "Information",
      "ParentLogId": null,
      "StepId": null
    },
    ...
  ]
}

Deployment - Cancel

This API endpoint interrupts and cancels a pending deployment based on unique deployment identifier.

Request

Parameters
deploymentId
string
required
The unique identifier of the deployment entity.
Request body

POST /deployment/cancel
{
  "deploymentId" : "f17ed947-8f62-4984-9f6d-ed9d7413966f"
}

Response

This endpoint returns an empty response body.

Package store - Upload package

Use this API endpoint to upload a package to the built-in workspace package store. Every workspace has its own package store.

This endpoint accepts files and text data at the same time. For this reason you must send the payload as form-data. Read more on MDN: Sending form data - Learn web development | MDN

Supported package types:

  • NuGet (*.nupkg)
  • zip
  • tar
  • tar.gz

This endpoint will read uploaded file name to determine:

  • Package type by looking at the file extensions (see above).
  • Pacakge version by looking at the filename suffix that matches Semantic Versioning 2.0.0 scheme major.minor.patch-[pre-release]
  • Package ID by looking at the file name after removing the extension, version and the trailing dot.
Example

Uploading a file named JawsDeploy-package.1.0.5-RC2.nupkg will result in the following:

Package ID: JawsDeploy-package
Version: 1.0.5-RC2
Type: NuGet

When sending the request make sure the file name follows the naming and versioning scheme explained above. The file name is important to identify the package and version correctly and avoid unnecessary duplicates in the package store. JawsDeploy supports multiple versions of the same package stored in the built-in workspace package store.

Request

Headers
Content-Type
string
required
Custom content type is required to indicate a Form-Data formatted request.
Parameters
workspaceId
string
required
Unique workspace identifier, which you can find under Settings / Workspaces in the App UI.
PackageFile
file
required
The package file to be uploaded.
Request body

POST /packagestore/package

Content-Type: multipart/form-data; boundary=<calculatePerRequest>

workspaceId=f17ed947-8f62-4984-9f6d-ed9d7413966f


<PackgeFile>

Response

This endpoint returns an empty response body.