# ai.newnal.illi.device.link

> Published by [illi-service.newnal.id](https://lexicon.garden/identity/did:plc:uztm7bi2ce42dez3uu3qafro)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.device.link)
- [Documentation](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.device.link/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.device.link/examples)

## Definitions

### `ai.newnal.illi.device.link`

**Type**: `procedure`

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.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `code` | `string` | Yes |  |
| `displayName` | `string` | No | 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. |
| `homeId` | `string` (tid) | No |  |
| `homeName` | `string` | Yes |  |
| `parentHonorific` | `string` | No | How the family calls parent 1 (e.g. 할머니, 어머니); written to the parentSlot record. Required by the family app. |
| `parentName` | `string` | No | Parent 1's name as the family and the device show it (e.g. 이순자); written to the parentSlot record. Required by the family app. |
| `relationship` | `string` | No | The root admin's relationship to the parents (e.g. 큰아들). |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `device` | `ref` → `ai.newnal.illi.home.defs#deviceView` | Yes |  |
| `homeId` | `string` (tid) | Yes |  |
| `role` | `string` | Yes |  |
| `sphere` | `string` | Yes |  |

#### Errors

- **InvalidOnboardingCode**
- **CodeExpired**
- **DeviceAlreadyLinked**
- **ScopeMissing**
- **PdsUnavailable**
- **RateLimitExceeded**

## Raw 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
}
```
