# ai.newnal.illi.device.getState

> 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.getState)
- [Documentation](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.device.getState/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.device.getState/examples)

## Definitions

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

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `homeId` | `string` (tid) | Yes |  |
| `name` | `string` | Yes |  |

### `ai.newnal.illi.device.getState`

**Type**: `query`

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

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `deviceId` | `string` | Yes |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `deviceId` | `string` | Yes |  |
| `home` | `ref` → `#homeRef` | No |  |
| `lastEventId` | `integer` | No |  |
| `members` | `array` | No |  |
| `onboardingCode` | `ref` → `#onboardingCode` | No |  |
| `parent1` | `ref` → `#parent1` | No |  |
| `parents` | `array` | No |  |
| `pendingRequests` | `array` | No |  |
| `status` | `string` | Yes |  |

#### Errors

- **DeviceNotFound**

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

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `code` | `string` | Yes |  |
| `expiresAt` | `string` (datetime) | Yes |  |

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

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |
| `handle` | `string` (handle) | No |  |

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

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `expiresAt` | `string` (datetime) | Yes |  |
| `requestId` | `string` | Yes |  |
| `slot` | `integer` | No |  |
| `type` | `string` | Yes |  |

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