nRF Cloud Device Job Service (0.0.1)

Download OpenAPI specification:

Public REST API specification

REST API that allows jobs to be run for a set of devices.

Job

Job operations

listJobs

Retrieve a list of device jobs

Authorizations:
ApiKeyAuth
query Parameters
operationName
string (OperationName) [ 6 .. 128 ] characters ^(?!-)[a-zA-Z0-9:_-]{6,128}$
Examples:
  • operationName=my-custom-op-name -

User-defined operation name identifier, e.g. my-custom-op. Allows for querying based on that name, e.g., fetching the current execution for a specific operation, or getting a list of jobs with the same operation name. Custom names starting with "nrfcloud" are not allowed because these are reserved for internal use.

pageLimit
number (PageLimit)
Examples:
  • pageLimit=100 -
pageNextToken
string (PageToken) [ 1 .. 256 ] characters ^[^\s]{1,256}$
Examples:
  • pageNextToken=def456eubdkw9038kdd93l -

Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding.

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "total": 1,
  • "pageNextToken": "4bb1f9ab35bd"
}

createJob

Create a device job

Authorizations:
ApiKeyAuth
Request Body schema: application/json
required
name
string (JobName) [ 1 .. 128 ] characters ^.{1,128}$
description
string (Description) [ 0 .. 1024 ] characters ^.{0,1024}$

Text describing something. Details.

required
object (JobDocument)

JSON object containing all the information a device needs to process the job.

target
string (JobTarget) [ 6 .. 128 ] characters ^[a-z0-9:_-]{6,128}$

Identifier for the device group targeted for this job.

DeviceIdsTargetCriteria (object) or DeviceTagsTargetCriteria (object) or FirmwareTypeTargetCriteria (object) or FirmwareVersionsTargetCriteria (object) (JobTargetCriteria)

Criteria a device must fit to be considered for a job.

targetListType
string (JobTargetListType)
Enum: "LOCKED" "UNLOCKED"
object (JobSchedule)
object

Responses

Request samples

Content type
application/json
Example
{
  • "name": "my-unscheduled-job",
  • "document": {
    },
  • "targetCriteria": {
    }
}

Response samples

Content type
application/json
Example
{
  • "id": "66a2afc3-ab5b-4437-ae7c-0bf0d79c72ca",
  • "name": "my-fota-job",
  • "status": "CREATED",
  • "target": "my-device-group",
  • "targetListType": "LOCKED",
  • "document": {
    },
  • "configuration": {
    },
  • "createdAt": "2024-04-16T12:34:56Z"
}

getJob

Get information about a device job

Authorizations:
ApiKeyAuth
path Parameters
required
NominalStringUuid (string) <uuid> (Uuid) = 36 characters ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3...
Examples:
  • 66a2afc3-ab5b-4437-ae7c-0bf0d79c72ca -
  • 7e836295-fd41-4ac3-a782-34ad7a19f2cd - Triggers a 404 error.

Universally unique identifier

Responses

Response samples

Content type
application/json
{
  • "id": "66a2afc3-ab5b-4437-ae7c-0bf0d79c72ca",
  • "name": "my-scheduled-job",
  • "status": "IN_PROGRESS",
  • "target": "my-device-group",
  • "targetListType": "UNLOCKED",
  • "document": {
    },
  • "schedule": {
    },
  • "configuration": {
    },
  • "createdAt": "2024-04-16T12:34:56Z",
  • "executionMetrics": {
    }
}

deleteJob

Delete a device job

Authorizations:
ApiKeyAuth
path Parameters
required
NominalStringUuid (string) <uuid> (Uuid) = 36 characters ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3...
Examples:
  • 60ec8c44-78b3-483b-b096-e8477164f6b9 -

Universally unique identifier

Responses

updateJob

Update a job's status and target list type. Changing the status to IN_PROGRESS starts the job. Changing the status to CANCELED will cancel all currently QUEUED executions and put the job in a CANCELED state, although any IN_PROGRESS executions will continue to run. Locking a target list prevents any devices that are newly eligible for this job to be automatically added.

Authorizations:
ApiKeyAuth
path Parameters
required
NominalStringUuid (string) <uuid> (Uuid) = 36 characters ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3...
Examples:
  • 66a2afc3-ab5b-4437-ae7c-0bf0d79c72ca -
  • a4615678-5e40-4214-ab1e-955a135ab51e -
  • 51d4f7fc-b34c-40ff-b4da-54389a8f842b -
  • 51d4f7fc-b34c-40ff-b4da-54389a8f842b -

Universally unique identifier

Request Body schema: application/merge-patch+json
required
name
string (JobName) [ 1 .. 128 ] characters ^.{1,128}$
description
string (Description) [ 0 .. 1024 ] characters ^.{0,1024}$

Text describing something. Details.

status
string
Enum: "IN_PROGRESS" "CANCELED" "ARCHIVED"
statusDetail
string (Description) [ 0 .. 1024 ] characters ^.{0,1024}$

Text describing something. Details.

targetListType
string
Enum: "LOCKED" "UNLOCKED"

Responses

Request samples

Content type
application/merge-patch+json
Example
{
  • "status": "CANCELED"
}

retryJobExecutions

Cancel all executions in a FAILED or TIMED_OUT status, then create new job to retry.

Authorizations:
ApiKeyAuth
path Parameters
required
NominalStringUuid (string) <uuid> (Uuid) = 36 characters ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3...
Examples:
  • ddfd4256-40ac-48a3-a78a-6af980031b47 -

Universally unique identifier

Responses

Response samples

Content type
application/json
{
  • "id": "66a2afc3-ab5b-4437-ae7c-0bf0d79c72ca",
  • "name": "Retry my-fota-job",
  • "status": "IN_PROGRESS",
  • "targetListType": "LOCKED",
  • "document": {
    },
  • "configuration": {
    },
  • "createdAt": "2024-04-16T12:34:56Z"
}

Job execution

Job execution operations

listJobExecutions

Get a list of job executions for a device job

Authorizations:
ApiKeyAuth
path Parameters
required
NominalStringUuid (string) <uuid> (Uuid) = 36 characters ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3...
Examples:
  • 5aa580be-fbfd-452d-aca0-cccc7894c4a9 -

Universally unique identifier

query Parameters
status
string (JobExecutionStatus)
Enum: "QUEUED" "IN_PROGRESS" "TIMED_OUT" "CANCELED" "REJECTED" "FAILED" "SUCCEEDED" "DOWNLOADING"
Examples:
  • status=IN_PROGRESS -
pageLimit
number (PageLimit)
Examples:
  • pageLimit=100 -
pageNextToken
string (PageToken) [ 1 .. 256 ] characters ^[^\s]{1,256}$
Examples:
  • pageNextToken=def456eubdkw9038kdd93l -

Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding.

Responses

Response samples

Content type
application/json

Example response for getting a list of job executions for jobId 5aa580be-fbfd-452d-aca0-cccc7894c4a9.

{
  • "items": [
    ],
  • "total": 1,
  • "pageNextToken": "def456"
}

bulkUpdateJobExecutionStatus

This operation only affects job executions that are in the following states: QUEUED, TIMED_OUT, FAILED. If no device IDs are specified in the request body, all job executions will be updated.

Authorizations:
ApiKeyAuth
path Parameters
required
NominalStringUuid (string) <uuid> (Uuid) = 36 characters ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3...
Examples:
  • ddfd4256-40ac-48a3-a78a-6af980031b47 -

Universally unique identifier

Request Body schema: application/merge-patch+json
required
status
string
Enum: "QUEUED" "CANCELED"
detail
string (Description) [ 0 .. 1024 ] characters ^.{0,1024}$

Text describing something. Details.

Array of NominalStringDeviceId (string) (DeviceId) [ 1 .. 100 ] items [ items [ 1 .. 128 ] characters ^[a-zA-Z0-9:_-]{1,128}$ ]

Responses

Request samples

Content type
application/merge-patch+json
{
  • "status": "CANCELED",
  • "deviceIds": [
    ]
}

retryJobExecutions

Cancel all executions in a FAILED or TIMED_OUT status, then create new job to retry.

Authorizations:
ApiKeyAuth
path Parameters
required
NominalStringUuid (string) <uuid> (Uuid) = 36 characters ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3...
Examples:
  • ddfd4256-40ac-48a3-a78a-6af980031b47 -

Universally unique identifier

Responses

Response samples

Content type
application/json
{
  • "id": "66a2afc3-ab5b-4437-ae7c-0bf0d79c72ca",
  • "name": "Retry my-fota-job",
  • "status": "IN_PROGRESS",
  • "targetListType": "LOCKED",
  • "document": {
    },
  • "configuration": {
    },
  • "createdAt": "2024-04-16T12:34:56Z"
}

listJobExecutionsForJobAndDevice

Get list of job executions for a device in a job

Authorizations:
ApiKeyAuth
path Parameters
required
NominalStringUuid (string) <uuid> (Uuid) = 36 characters ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3...
Examples:
  • 5aa580be-fbfd-452d-aca0-cccc7894c4a9 -
  • 5aa580be-fbfd-452d-aca0-cccc7894c4a9 -

Universally unique identifier

required
NominalStringDeviceId (string) (DeviceId) [ 1 .. 128 ] characters ^[a-zA-Z0-9:_-]{1,128}$
Examples:
  • nrf-1234567890123456789000 -
  • nrf-1234567890123456789000 -

This is the canonical device id used in the device certificate, and as the MQTT client id.

query Parameters
pageLimit
number (PageLimit)
Examples:
  • pageLimit=100 -
pageNextToken
string (PageToken) [ 1 .. 256 ] characters ^[^\s]{1,256}$
Examples:
  • pageNextToken=def456eubdkw9038kdd93l -

Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding.

Responses

Response samples

Content type
application/json
Example

Example response for getting a list of job executions for jobId 5aa580be-fbfd-452d-aca0-cccc7894c4a9 and deviceId nrf-1234567890123456789000.

{
  • "items": [
    ],
  • "total": 1,
  • "pageNextToken": "def456"
}

updateJobExecutionStatus

By default, this operation updates the current job execution. For updating a specific job execution, specify the execution ID in the request body.

Authorizations:
ApiKeyAuth
path Parameters
required
NominalStringUuid (string) <uuid> (Uuid) = 36 characters ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3...
Examples:
  • 61fc1cd5-b789-4167-8892-12c8d92f94dd -
  • 61fc1cd5-b789-4167-8892-12c8d92f94dd -

Universally unique identifier

required
NominalStringDeviceId (string) (DeviceId) [ 1 .. 128 ] characters ^[a-zA-Z0-9:_-]{1,128}$
Examples:
  • nrf-1234567890123456789000 -
  • nrf-1234567890123456789000 -

This is the canonical device id used in the device certificate, and as the MQTT client id.

Request Body schema: application/merge-patch+json
required
NominalStringUuid (string) <uuid> (Uuid) = 36 characters ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3...

Universally unique identifier

status
string (JobExecutionStatus)
Enum: "QUEUED" "IN_PROGRESS" "TIMED_OUT" "CANCELED" "REJECTED" "FAILED" "SUCCEEDED" "DOWNLOADING"
detail
string (Description) [ 0 .. 1024 ] characters ^.{0,1024}$

Text describing something. Details.

Responses

Request samples

Content type
application/merge-patch+json
Example
{
  • "id": "61fc1cd5-b789-4167-8892-12c8d92f94dd",
  • "status": "TIMED_OUT",
  • "detail": "failed to fetch bundle"
}

listJobExecutionsForDevice

Get list of job executions for a device

Authorizations:
ApiKeyAuth
path Parameters
required
NominalStringDeviceId (string) (DeviceId) [ 1 .. 128 ] characters ^[a-zA-Z0-9:_-]{1,128}$
Examples:
  • nrf-1234567890123456789000 -

This is the canonical device id used in the device certificate, and as the MQTT client id.

query Parameters
pageLimit
number (PageLimit)
Examples:
  • pageLimit=100 -
pageNextToken
string (PageToken) [ 1 .. 256 ] characters ^[^\s]{1,256}$
Examples:
  • pageNextToken=def456eubdkw9038kdd93l -

Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding.

Responses

Response samples

Content type
application/json

Example response for getting a list of job executions for deviceId nrf-1234567890123456789000.

{
  • "items": [
    ],
  • "total": 1,
  • "pageNextToken": "def456"
}

getCurrentJobExecution

Get the current device job execution for a device

Authorizations:
ApiKeyAuth
path Parameters
required
NominalStringDeviceId (string) (DeviceId) [ 1 .. 128 ] characters ^[a-zA-Z0-9:_-]{1,128}$
Examples:
  • nrf-1234567890123456789000 -

This is the canonical device id used in the device certificate, and as the MQTT client id.

query Parameters
operationName
string (OperationName) [ 6 .. 128 ] characters ^(?!-)[a-zA-Z0-9:_-]{6,128}$
Examples:
  • operationName=my-custom-op-name -

User-defined operation name identifier, e.g. my-custom-op. Allows for querying based on that name, e.g., fetching the current execution for a specific operation, or getting a list of jobs with the same operation name. Custom names starting with "nrfcloud" are not allowed because these are reserved for internal use.

Responses

Response samples

Content type
application/json
{
  • "id": "52eb33a0-101b-4034-a515-dfbf43be754e",
  • "jobId": "5aa580be-fbfd-452d-aca0-cccc7894c4a9",
  • "deviceInfo": {
    },
  • "status": "IN_PROGRESS",
  • "retryable": true,
  • "createdAt": "2024-04-16T12:45:00Z",
  • "tenantId": "dc6ec7f2-b930-4165-90d0-9003234378a2"
}

Job bundle

Job bundle operations

uploadBundle

Upload a bundle as a .zip file, whether binary or base64-encoded. The bundle must contain a manifest.json file that conforms to this JSON schema:

{
  name?: string,
  description?: string,
  fwversion: string,
  'format-version': 1,
  files: {
    file: string,
    size: number
  }[]
}

Notes:

  • ? fields are optional
  • files is an array of objects, all of which should be of the same type.
  • type values application and mcuboot apply only to nRF91 FOTA. Values softdevice and init_packet apply only to Bluetooth LE FOTA.
  • For Bluetooth LE devices using FOTA, the .zip file must contain both the init_packet and the firmware image (application or soft device). The type field for the manifest must be application or softdevice, not init_packet.
  • 'format-version' should always be set to 1
  • fwversion is validated against this regular expression: /^[a-zA-Z0-9._-]{1,30}$/
  • The Zephyr build system produces dfu_application.zip in the build/zephyr folder, which contains a manifest.json plus the update binary. However, the manifest is currently generated without the required fwversion field, so you will need to add that field.
  • If you use the nRFCloud.com user interface to upload your zip file, you are given options to fill in the name, description, and fwversion fields. The UI will then properly generate the manifest.json file and zip file.
  • Although nRF Cloud supports modem FOTA, we do not allow uploading modem firmware. These updates are made available only by Nordic Semiconductor.

An example of a valid manifest:

{
  "name": "My application update",
  "description": "Changelog: Fixed an issue with sleep mode. Power consumption improvements.",
  "fwversion": "1.1",
  "format-version": 1,
  "files": [
    {
      "file": "my_application_v1_1.hex.bin",
      "type": "application",
      "size": 695672
    }
  ]
}

Following are examples of uploading with curl (base64 and binary):

  export FILE=$(base64 path/to/my-file.zip)
  # If you get a console error such as "Argument list too long" try using a REST client like Postman.
  curl -X POST $API_HOST/bundles -H "Authorization: Bearer $API_KEY" -H "Content-Type: text/plain" -d $FILE
  curl -X POST $API_HOST/bundles -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/zip" --data-binary @/path/to/my-file.zip

For more information, see the FOTA documentation.

Authorizations:
ApiKeyAuth
Request Body schema:
required
string <byte> (Base64EncodedString) [ 1 .. 1333333 ] characters

Base64-encoded content.

Responses

Request samples

Content type
UEsDBBQACAAIALh42FgAAAAAAAAAAAwAAAAbACAAbXlfYXBwbGljYXRpb25fdjFfMS5oZXguYmluVVQNAAe97Xlmvu15Zr3teWZ1eAsAAQT1AQAABBQAAADLSM3JyVcozy/KSeECAFBLBwgtOwivDgAAAAwAAABQSwMEFAAIAAgAtXrYWAAAAAAAAAAAKwEAAA0AIABtYW5pZmVzdC5qc29uVVQNAAd38XlmePF5ZnfxeWZ1eAsAAQT1AQAABBQAAABNj8sKwkAMRff9itC1DozLbgV3gnuRMraxDXQeTKYvi/9uZyzUTSDnnlzIkgHkRmnMC8ivMyjnOqpUIGugd7UKmB+iUiNXnlzk0Ty3yjTY2aaAC01YgzJAzD3CSKEF7hAdaFujgJsd0UNlDfc63QNp5+2AGk1g8at/jQN63sqlkBu1Xqtw3CP5w9Qhr9t9XQCWNDccz/Vc/n1RDrKUosVJPMmk2iSH2SX5z9xDpncM5SmBzzof2Sf7AlBLBwjvpMcuuQAAACsBAABQSwMEFAAIAAgAtXrYWAAAAAAAAAAAsAAAABgAIABfX01BQ09TWC8uX21hbmlmZXN0Lmpzb25VVA0AB3fxeWZ48XlmoPF5ZnV4CwABBPUBAAAEFAAAAGNgFWNnYGJg8E1MVvAPVohQgAKQGAMnEBsBcR0Qg/gbGIgCjiEhQVAmSMcCIBZAU8KIEJdKzs/VSywoyEnVy0ksLiktTk1JSSxJVQ4IBiks+FiZBqK7c9YYg2gAUEsHCHtVkvVcAAAAsAAAAFBLAQIUAxQACAAIALh42FgtOwivDgAAAAwAAAAbACAAAAAAAAAAAACkgQAAAABteV9hcHBsaWNhdGlvbl92MV8xLmhleC5iaW5VVA0AB73teWa+7Xlmve15ZnV4CwABBPUBAAAEFAAAAFBLAQIUAxQACAAIALV62FjvpMcuuQAAACsBAAANACAAAAAAAAAAAACkgXcAAABtYW5pZmVzdC5qc29uVVQNAAd38XlmePF5ZnfxeWZ1eAsAAQT1AQAABBQAAABQSwECFAMUAAgACAC1ethYe1WS9VwAAACwAAAAGAAgAAAAAAAAAAAApIGLAQAAX19NQUNPU1gvLl9tYW5pZmVzdC5qc29uVVQNAAd38XlmePF5ZqDxeWZ1eAsAAQT1AQAABBQAAABQSwUGAAAAAAMAAwAqAQAATQIAAAAA

Response samples

Content type
application/json
{
  • "id": "87918b0b-47ac-4527-8130-bc6dbab6423c",
  • "files": [
    ],
  • "visibility": "PRIVATE",
  • "sizeBytes": 733,
  • "createdAt": "2024-04-16T12:45:00Z"
}

listBundles

Get a list of device job bundles

Authorizations:
ApiKeyAuth
query Parameters
pageLimit
number (PageLimit)
Examples:
  • pageLimit=100 -
pageNextToken
string (PageToken) [ 1 .. 256 ] characters ^[^\s]{1,256}$
Examples:
  • pageNextToken=def456eubdkw9038kdd93l -

Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding.

public
boolean
Examples:
  • public=true -

Filter by public or private bundles

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "total": 1,
  • "pageNextToken": "def456"
}

getBundle

Get information about a specific bundle

Authorizations:
ApiKeyAuth
path Parameters
required
Uuid (NominalStringUuid (string)) or LegacyBundleId (string) (GetBundleRequest)
Examples:
  • 66a2afc3-ab5b-4437-ae7c-0bf0d79c72ca -

Responses

Response samples

Content type
application/json
{
  • "id": "52eb33a0-101b-4034-a515-dfbf43be754e",
  • "files": [
    ],
  • "sizeBytes": 141442,
  • "visibility": "PRIVATE",
  • "createdAt": "2024-04-16T12:45:00Z"
}

deleteBundle

Delete a device job bundle

Authorizations:
ApiKeyAuth
path Parameters
required
NominalStringUuid (string) <uuid> (Uuid) = 36 characters ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3...
Examples:
  • 66a2afc3-ab5b-4437-ae7c-0bf0d79c72ca -

Universally unique identifier

Responses

Job event

listJobEvents

Get list of scheduled events for a job

Authorizations:
ApiKeyAuth
path Parameters
required
NominalStringUuid (string) <uuid> (Uuid) = 36 characters ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3...
Examples:
  • 5aa580be-fbfd-452d-aca0-cccc7894c4a9 -

Universally unique identifier

query Parameters
pageLimit
number (PageLimit)
Examples:
  • pageLimit=100 -
pageNextToken
string (PageToken) [ 1 .. 256 ] characters ^[^\s]{1,256}$
Examples:
  • pageNextToken=def456eubdkw9038kdd93l -

Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding.

Responses

Response samples

Content type
application/json

Example response for getting a list of scheduled events for jobId 5aa580be-fbfd-452d-aca0-cccc7894c4a9.

{
  • "items": [
    ],
  • "total": 1,
  • "pageNextToken": "def456"
}

updateJobEvent

Update the trigger date of a scheduled job event

Authorizations:
ApiKeyAuth
path Parameters
required
NominalStringUuid (string) <uuid> (Uuid) = 36 characters ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3...
Examples:
  • 61fc1cd5-b789-4167-8892-12c8d92f94dd -

Universally unique identifier

required
NominalStringUuid (string) <uuid> (Uuid) = 36 characters ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3...
Examples:
  • 08e0e058-74a0-46e1-9d67-495ce2893f47 -

Universally unique identifier

Request Body schema: application/merge-patch+json
required
date
required
number (EpochTimeInMilliseconds)

: Scheduled start or end time in milliseconds since UNIX epoch.

Responses

Request samples

Content type
application/merge-patch+json
{
  • "date": 1726512267341
}