# dev.cocore.devicePair.confirm

> 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.confirm)
- [Documentation](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.devicePair.confirm/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.devicePair.confirm/examples)

## Definitions

### `dev.cocore.devicePair.confirm`

**Type**: `procedure`

Approve or deny a pending device-pairing attempt, identified by the `userCode` the device displayed. Called from the verification UI by a signed-in user. Approving requires the provider `session` to grant to the device.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `session` | `unknown` | No | Provider session to grant to the device; required when `decision` is `approve`. |
| `decision` | `string` | Yes |  |
| `userCode` | `string` | Yes | The code the device displayed (case-insensitive). |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `ok` | `boolean` | Yes |  |
| `status` | `string` | Yes |  |

#### Errors

- **InvalidRequest**: Missing `userCode`, an invalid `decision`, or `approve` without a `session`.
- **NotFound**: No pairing attempt matches the `userCode`.
- **Conflict**: The pairing attempt could not be approved in its current state.

## Raw Schema

```json
{
  "id": "dev.cocore.devicePair.confirm",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "userCode",
            "decision"
          ],
          "properties": {
            "session": {
              "type": "unknown",
              "description": "Provider session to grant to the device; required when `decision` is `approve`."
            },
            "decision": {
              "enum": [
                "approve",
                "deny"
              ],
              "type": "string"
            },
            "userCode": {
              "type": "string",
              "description": "The code the device displayed (case-insensitive)."
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "InvalidRequest",
          "description": "Missing `userCode`, an invalid `decision`, or `approve` without a `session`."
        },
        {
          "name": "NotFound",
          "description": "No pairing attempt matches the `userCode`."
        },
        {
          "name": "Conflict",
          "description": "The pairing attempt could not be approved in its current state."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "ok",
            "status"
          ],
          "properties": {
            "ok": {
              "type": "boolean"
            },
            "status": {
              "type": "string"
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Approve or deny a pending device-pairing attempt, identified by the `userCode` the device displayed. Called from the verification UI by a signed-in user. Approving requires the provider `session` to grant to the device."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
