# dev.cocore.devicePair.poll

> Published by [cocore.dev](https://lexicon.garden/identity/did:plc:5quuhkmwe2q4k3azfsgg7kdz)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.devicePair.poll)
- [Documentation](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.devicePair.poll/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.devicePair.poll/examples)

## Definitions

### `dev.cocore.devicePair.poll`

**Type**: `query`

Poll a device-pairing attempt by `deviceId`. While the user has not acted, returns `pending`. On approval, returns `session` together with the granted provider session. Terminal negative states are `denied`, `expired`, and `consumed`. An unknown `deviceId` is `unknown`.

#### Parameters

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

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `status` | `string` | Yes |  |
| `session` | `unknown` | No | The granted provider session; present only when `status` is `session`. |

#### Errors

- **InvalidRequest**: The `deviceId` parameter is missing.
- **NotFound**: No pairing attempt exists for this `deviceId`.

## Raw Schema

```json
{
  "id": "dev.cocore.devicePair.poll",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "InvalidRequest",
          "description": "The `deviceId` parameter is missing."
        },
        {
          "name": "NotFound",
          "description": "No pairing attempt exists for this `deviceId`."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "status"
          ],
          "properties": {
            "status": {
              "enum": [
                "unknown",
                "pending",
                "denied",
                "expired",
                "consumed",
                "session"
              ],
              "type": "string"
            },
            "session": {
              "type": "unknown",
              "description": "The granted provider session; present only when `status` is `session`."
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "deviceId"
        ],
        "properties": {
          "deviceId": {
            "type": "string"
          }
        }
      },
      "description": "Poll a device-pairing attempt by `deviceId`. While the user has not acted, returns `pending`. On approval, returns `session` together with the granted provider session. Terminal negative states are `denied`, `expired`, and `consumed`. An unknown `deviceId` is `unknown`."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
