# ai.newnal.illi.device.link

> The caller enters the device's onboarding code and becomes the root admin: creates the home and the family sphere on the caller's PDN with parent 1 and the caller as first members.

- 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.link)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.device.link/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.device.link/analytics)

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

Type: procedure · POST

### Input (application/json)

- `code` (string, required)
  - Constraints: maxLength: 16
- `displayName` (string): The root admin's name as the family and the device see it (e.g. 김은수). Required by the family app; optional on the wire for compatibility.
  - Constraints: maxLength: 64
- `homeId` (string · tid)
- `homeName` (string, required)
  - Constraints: maxLength: 64
- `parentHonorific` (string): How the family calls parent 1 (e.g. 할머니, 어머니); written to the parentSlot record. Required by the family app.
  - Constraints: maxLength: 32
- `parentName` (string): Parent 1's name as the family and the device show it (e.g. 이순자); written to the parentSlot record. Required by the family app.
  - Constraints: maxLength: 64
- `relationship` (string): The root admin's relationship to the parents (e.g. 큰아들).
  - Constraints: maxLength: 32

### Output (application/json)

- `device` (ref, required)
  - Reference: `ai.newnal.illi.home.defs#deviceView`
- `homeId` (string · tid, required)
- `role` (string, required)
  - Constraints: knownValues: rootAdmin
- `sphere` (string, required)

### Errors

- `InvalidOnboardingCode`: No description in schema.
- `CodeExpired`: No description in schema.
- `DeviceAlreadyLinked`: No description in schema.
- `ScopeMissing`: No description in schema.
- `PdsUnavailable`: No description in schema.
- `RateLimitExceeded`: No description in schema.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "The caller enters the device's onboarding code and becomes the root admin: creates the home and the family sphere on the caller's PDN with parent 1 and the caller as first members.",
      "errors": [
        {
          "name": "InvalidOnboardingCode"
        },
        {
          "name": "CodeExpired"
        },
        {
          "name": "DeviceAlreadyLinked"
        },
        {
          "name": "ScopeMissing"
        },
        {
          "name": "PdsUnavailable"
        },
        {
          "name": "RateLimitExceeded"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "code": {
              "maxLength": 16,
              "type": "string"
            },
            "displayName": {
              "description": "The root admin's name as the family and the device see it (e.g. 김은수). Required by the family app; optional on the wire for compatibility.",
              "maxLength": 64,
              "type": "string"
            },
            "homeId": {
              "format": "tid",
              "type": "string"
            },
            "homeName": {
              "maxLength": 64,
              "type": "string"
            },
            "parentHonorific": {
              "description": "How the family calls parent 1 (e.g. 할머니, 어머니); written to the parentSlot record. Required by the family app.",
              "maxLength": 32,
              "type": "string"
            },
            "parentName": {
              "description": "Parent 1's name as the family and the device show it (e.g. 이순자); written to the parentSlot record. Required by the family app.",
              "maxLength": 64,
              "type": "string"
            },
            "relationship": {
              "description": "The root admin's relationship to the parents (e.g. 큰아들).",
              "maxLength": 32,
              "type": "string"
            }
          },
          "required": [
            "code",
            "homeName"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "device": {
              "ref": "ai.newnal.illi.home.defs#deviceView",
              "type": "ref"
            },
            "homeId": {
              "format": "tid",
              "type": "string"
            },
            "role": {
              "knownValues": [
                "rootAdmin"
              ],
              "type": "string"
            },
            "sphere": {
              "type": "string"
            }
          },
          "required": [
            "homeId",
            "sphere",
            "role",
            "device"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "ai.newnal.illi.device.link",
  "lexicon": 1
}
```
