# ai.newnal.illi.device.requestOnboardingCode

> Register the device (device id, model) under parent 1's device-app session and issue a one-time onboarding code shown on the device.

- Kind: procedure
- Authority: device.illi.newnal.ai
- Lexicon: 1
- Published by [illi-service.newnal.id](https://lexicon.garden/identity/did:plc:uztm7bi2ce42dez3uu3qafro), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.device.requestOnboardingCode)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.device.requestOnboardingCode/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.device.requestOnboardingCode/analytics)

## Procedure (`ai.newnal.illi.device.requestOnboardingCode`)

Type: procedure · POST

### Input (application/json)

- `attestation` (string)
- `deviceId` (string, required)
  - Constraints: maxLength: 64
- `firmwareVersion` (string): Version of the ILLI unit's OS image (the firmware build), reported by the device itself; not verified. Trusted software state comes from the key attestation.
  - Constraints: maxLength: 32
- `model` (string, required)
  - Constraints: maxLength: 64
- `timezone` (string): The device's IANA time zone (Asia/Seoul). device.link copies it to the home, and the home's daily works, upload counts and recommendations follow it. Absent or unknown to the server: Asia/Seoul.
  - Constraints: maxLength: 64

### Output (application/json)

- `code` (string, required)
- `deviceId` (string, required)
- `expiresAt` (string · datetime, required)

### Errors

- `DeviceAlreadyLinked`: No description in schema.
- `InvalidAttestation`: No description in schema.
- `DeviceRevoked`: No description in schema.
- `RateLimitExceeded`: No description in schema.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Register the device (device id, model) under parent 1's device-app session and issue a one-time onboarding code shown on the device.",
      "errors": [
        {
          "name": "DeviceAlreadyLinked"
        },
        {
          "name": "InvalidAttestation"
        },
        {
          "name": "DeviceRevoked"
        },
        {
          "name": "RateLimitExceeded"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "attestation": {
              "type": "string"
            },
            "deviceId": {
              "maxLength": 64,
              "type": "string"
            },
            "firmwareVersion": {
              "description": "Version of the ILLI unit's OS image (the firmware build), reported by the device itself; not verified. Trusted software state comes from the key attestation.",
              "maxLength": 32,
              "type": "string"
            },
            "model": {
              "maxLength": 64,
              "type": "string"
            },
            "timezone": {
              "description": "The device's IANA time zone (Asia/Seoul). device.link copies it to the home, and the home's daily works, upload counts and recommendations follow it. Absent or unknown to the server: Asia/Seoul.",
              "maxLength": 64,
              "type": "string"
            }
          },
          "required": [
            "deviceId",
            "model"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "code": {
              "type": "string"
            },
            "deviceId": {
              "type": "string"
            },
            "expiresAt": {
              "format": "datetime",
              "type": "string"
            }
          },
          "required": [
            "deviceId",
            "code",
            "expiresAt"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "ai.newnal.illi.device.requestOnboardingCode",
  "lexicon": 1
}
```
