Create an nRF9x Device
POST/v1/organizations/:organization_slug/projects/:project_slug/long-range/devices
Different API host
Send this request to https://api.nrfcloud.com, not the default Memfault API host.
Create a single Device for a given Project using an onboarding token, an attestation token, or a device certificate.
nRF Cloud verifies tokens before creating devices. Certificates are registered under the device ID provided in the request. To onboard multiple devices in one request, use Create nRF9x Devices in Bulk.
The request body must contain exactly one credential. The required fields depend on the credential:
| Credential | Device | Fields |
|---|---|---|
| Onboarding token | nRF93M1 | onboardingToken (required): a signed JWT attesting to the device's identity and the public key nRF Cloud uses to verify the device's JWTs. deviceId (optional): the expected device ID. If provided, it must match the ID in the token; otherwise, the request fails. |
| Attestation token | nRF9151, nRF9161 | attestationToken (required): the attestation token returned by the modem's AT%ATTESTTOKEN command. |
| Certificate | nRF9160 | deviceId (required): the device ID under which to register the certificate. certificate (required): the device's X.509 certificate in PEM format. It must end with a newline after -----END CERTIFICATE-----. |
Requests that combine fields from different credential types or include unrecognized fields are rejected.
Return Value
Returns the ID of the onboarded device. For token-based requests, this is the device ID in the token.
Request
Responses
- 200
- 400
- 422
OK
Bad Request
Unprocessable Entity