---
updatedAt: 2026-06-02T22:39:26.000Z
agentTools:
  projectIndex: https://synaccess.readme.io/llms.txt
---

# Device Provisioning

This section describes the local PDU API commands used to register a device with Synaccess Cloud and verify cloud connectivity. These endpoints are useful for scripting enrollment, recovery, and validation workflows.

<br />

**PDU Cloud API** These calls are made directly against the PDU’s local web API. They require an authenticated local session cookie, shown below as `SPID=$SPID`.

**Register Hosted Cloud Credentials**\
`POST /api/system/cloudRegistration`

Use this when the script has the Synaccess Cloud username/password and wants the PDU to exchange them for cloud credentials.

Request:

```json
{
  "cloudUsername": "user@example.com",
  "cloudPw": "cloud-password"
}
```

Example:

```bash
curl -k --cookie "SPID=$SPID" \
  -H "Content-Type: application/json" \
  -d '{"cloudUsername":"user@example.com","cloudPw":"cloud-password"}' \
  "https://<pdu-host>/api/system/cloudRegistration"
```

Success:

```text
HTTP 200
```

Behavior:

* Restarts the hosted cloud processes.
* On failure, clears stored hosted-cloud credentials.

Errors:

```text
422 Missing Username/Password in request.
422 Invalid Data Types.
422 Cloud registration failed. Check credentials and network connection
403 No Permission
```

To clear cloud credentials, submit an empty username:

```bash
curl -k --cookie "SPID=$SPID" \
  -H "Content-Type: application/json" \
  -d '{"cloudUsername":"","cloudPw":""}' \
  "https://<pdu-host>/api/system/cloudRegistration"
```

Important: `cloudRegistration` updates credentials, but does not necessarily enable hosted cloud. If needed, enable cloud separately:

```bash
curl -k --cookie "SPID=$SPID" \
  -H "Content-Type: application/json" \
  -d '{"network":{"cloudEnabled":true}}' \
  "https://<pdu-host>/api/conf"
```

Depending on firmware/API shape, `{"cloudEnabled":true}` may also be accepted by `/api/conf`.

**Check Cloud Status** `GET /api/cloudStatus`

Example:

```bash
curl -k --cookie "SPID=$SPID" \
  "https://<pdu-host>/api/cloudStatus"
```

Success:

```json
{
  "status": "OK"
}
```

Status behavior:

* `HTTP 200` + `{"status":"OK"}` means the PDU is cloud-connected.
* `HTTP 422` + `{"status":"<reason>"}` means cloud is not connected and includes the device-side reason.
* `HTTP 500` means the PDU could not determine cloud status.
* `HTTP 403` means the local session lacks network-settings permission.

**Recommended Polling** Do not assume registration is complete just because `cloudRegistration` returns `200`. Poll `cloudStatus`.

```bash
for i in $(seq 1 60); do
  code=$(curl -k -s -o /tmp/cloud_status.json -w "%{http_code}" \
    --cookie "SPID=$SPID" \
    "https://<pdu-host>/api/cloudStatus")

  if [ "$code" = "200" ] && grep -q '"status":"OK"' /tmp/cloud_status.json; then
    echo "Cloud connected"
    exit 0
  fi

  sleep 5
done

echo "Cloud did not report OK"
cat /tmp/cloud_status.json
exit 1
```