{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "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. When the requester supplied an allowlisted `returnUrl` at `start`, an approval echoes it back so the verification UI can send the browser there.",
      "errors": [
        {
          "description": "Missing `userCode`, an invalid `decision`, or `approve` without a `session`.",
          "name": "InvalidRequest"
        },
        {
          "description": "No pairing attempt matches the `userCode`.",
          "name": "NotFound"
        },
        {
          "description": "The pairing attempt could not be approved in its current state.",
          "name": "Conflict"
        },
        {
          "description": "Too many confirm attempts from this client; retry later.",
          "name": "RateLimited"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "decision": {
              "enum": [
                "approve",
                "deny"
              ],
              "type": "string"
            },
            "session": {
              "description": "Provider session to grant to the device; required when `decision` is `approve`.",
              "type": "unknown"
            },
            "userCode": {
              "description": "The code the device displayed (case-insensitive).",
              "type": "string"
            }
          },
          "required": [
            "userCode",
            "decision"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "ok": {
              "type": "boolean"
            },
            "returnUrl": {
              "description": "Present on approval when the requester asked to be returned to an allowlisted URL.",
              "format": "uri",
              "type": "string"
            },
            "status": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "status"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "dev.cocore.devicePair.confirm",
  "lexicon": 1
}
