IP Devices

RegisterCertificates

Register one or more device certificates. If a device has already been added to your team (onboarded) this will delete its existing cert and replace it with the new one. It is recommended to update existing devices with their new certificates before registering them here. If it is not onboarded, please use the OnboardDevice endpoint to complete the process which allows your device(s) to use nRF Cloud.

This endpoint supports asynchronous bulk operations. Your data will be validated, and if valid, you will receive an HTTP 202 response with a bulkOpsRequestId. You can use this id with the bulk ops endpoints to track the request's processing status. If the bulk ops request indicates FAILED status, check the JSON errors file (URL in the bulk ops request details), fix the offending rows, then re-submit the CSV with only those rows.

Each CSV row must in the format deviceId,"certPem", where:

FieldRequiredDescriptionValidation Pattern
deviceId<div style="width:90px"></div>YesA globally unique device id (UUIDs are highly recommended)/^[a-z0-9:_-]{1,128}$/i
certPemYesA unique ES256 X.509 certificate in PEM format, wrapped in double quotes (to allow for line breaks in CSV)/^-{5}BEGIN CERTIFICATE-{5}(\r\n|\r|\n)([^-]+)(\r\n|\r|\n)-{5}END CERTIFICATE-{5}(\r\n|\r|\n)$/

Example of a CSV row:

All values set

<span style="font-family:Courier">f69c0e45-7f04-4949-8def-bb2215b4223e,"-----BEGIN CERTIFICATE-----<br/>MIIB7DCCAZMCFD...Av3CVgjzn5BLS03X7lyf4w==<br/> -----END CERTIFICATE-----<br/>"</span>

Also note:

  • Max number of rows is 1000.
  • Do not use a header.
  • Do not leave any blank lines.

Example of uploading CSV data as a binary file:

curl -X POST $API_HOST/v1/devices/certificates \
--data-binary @$PATH_TO_CSV_FILE \
-H "Content-Type: application/octet-stream" \
-H "Authorization: Bearer $API_KEY"

Note that for some unknown reason, curl will strip the final line break in each ES256 public key when sending the CSV file using a non-binary content-type, e.g., using syntax such as -d @$PATH_TO_CSV_FILE -H "Content-Type: text/csv". Therefore, with curl use --data-binary only. If you want to send the CSV as text, use a REST client like Postman or Insomnia.

post/devices/certificates

Headers

content-type'text/plain;charset=UTF8' | 'text/plain;charset=ASCII' | 'text/plain' | 'application/octet-stream' | 'text/csv' required

Request body

string required

Response

bulkOpsRequestIdstring required

Universally Unique Lexicographically Sortable Identifier (using Crockford's alphabet).

Example response

{
  "bulkOpsRequestId": "01EZZJVDQJPWT7V4FWNVDHNMM5"
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.