# ai.newnal.illi.device.getState

> Everything the device needs to render: status, onboarding code while waiting, home, parents, members, pending requests and the acknowledged event cursor.

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

## Query (`ai.newnal.illi.device.getState`)

Type: query · GET

### Parameters (query string)

- `deviceId` (string, required)
  - Constraints: maxLength: 64

### Output (application/json)

- `deviceId` (string, required)
- `home` (ref)
  - Reference: `#homeRef`
- `lastEventId` (integer)
- `members` (array)
  - `items` (ref)
    - Reference: `ai.newnal.illi.home.defs#memberView`
- `onboardingCode` (ref)
  - Reference: `#onboardingCode`
- `parent1` (ref)
  - Reference: `#parent1`
- `parents` (array)
  - `items` (ref)
    - Reference: `ai.newnal.illi.home.defs#parentView`
- `pendingRequests` (array)
  - `items` (ref)
    - Reference: `#pendingRequest`
- `status` (string, required)
  - Constraints: knownValues: registered | awaitingLink | active | unlinked | retired

### Errors

- `DeviceNotFound`: No description in schema.

## #homeRef (`ai.newnal.illi.device.getState#homeRef`)

Type: object

### Properties

- `homeId` (string · tid, required)
- `name` (string, required)

## #onboardingCode (`ai.newnal.illi.device.getState#onboardingCode`)

Type: object

### Properties

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

## #parent1 (`ai.newnal.illi.device.getState#parent1`)

Type: object

### Properties

- `did` (string · did, required)
- `handle` (string · handle)

## #pendingRequest (`ai.newnal.illi.device.getState#pendingRequest`)

Type: object

### Properties

- `expiresAt` (string · datetime, required)
- `requestId` (string, required)
- `slot` (integer)
- `type` (string, required)
  - Constraints: knownValues: parentCreation

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "homeRef": {
      "properties": {
        "homeId": {
          "format": "tid",
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "homeId",
        "name"
      ],
      "type": "object"
    },
    "main": {
      "description": "Everything the device needs to render: status, onboarding code while waiting, home, parents, members, pending requests and the acknowledged event cursor.",
      "errors": [
        {
          "name": "DeviceNotFound"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "deviceId": {
              "type": "string"
            },
            "home": {
              "ref": "#homeRef",
              "type": "ref"
            },
            "lastEventId": {
              "type": "integer"
            },
            "members": {
              "items": {
                "ref": "ai.newnal.illi.home.defs#memberView",
                "type": "ref"
              },
              "type": "array"
            },
            "onboardingCode": {
              "ref": "#onboardingCode",
              "type": "ref"
            },
            "parent1": {
              "ref": "#parent1",
              "type": "ref"
            },
            "parents": {
              "items": {
                "ref": "ai.newnal.illi.home.defs#parentView",
                "type": "ref"
              },
              "type": "array"
            },
            "pendingRequests": {
              "items": {
                "ref": "#pendingRequest",
                "type": "ref"
              },
              "type": "array"
            },
            "status": {
              "knownValues": [
                "registered",
                "awaitingLink",
                "active",
                "unlinked",
                "retired"
              ],
              "type": "string"
            }
          },
          "required": [
            "deviceId",
            "status"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "deviceId": {
            "maxLength": 64,
            "type": "string"
          }
        },
        "required": [
          "deviceId"
        ],
        "type": "params"
      },
      "type": "query"
    },
    "onboardingCode": {
      "properties": {
        "code": {
          "type": "string"
        },
        "expiresAt": {
          "format": "datetime",
          "type": "string"
        }
      },
      "required": [
        "code",
        "expiresAt"
      ],
      "type": "object"
    },
    "parent1": {
      "properties": {
        "did": {
          "format": "did",
          "type": "string"
        },
        "handle": {
          "format": "handle",
          "type": "string"
        }
      },
      "required": [
        "did"
      ],
      "type": "object"
    },
    "pendingRequest": {
      "properties": {
        "expiresAt": {
          "format": "datetime",
          "type": "string"
        },
        "requestId": {
          "type": "string"
        },
        "slot": {
          "type": "integer"
        },
        "type": {
          "knownValues": [
            "parentCreation"
          ],
          "type": "string"
        }
      },
      "required": [
        "requestId",
        "type",
        "expiresAt"
      ],
      "type": "object"
    }
  },
  "id": "ai.newnal.illi.device.getState",
  "lexicon": 1
}
```
