# recover_booking_access

Recover a lost booking access token in two calls. request_code requires the existing booking contact; the response does not reveal whether it matches. verify_code requires the returned recoveryId and customer's 6-digit code. Success rotates the token, invalidating the old one. Codes expire in 10 minutes and allow at most 5 guesses.

Canonical: https://bookwise.live/docs/tools/recover_booking_access

Version: 1.1.0
Scope: Directory + business
Authentication: As specified in parameters
Category: Booking management

## Parameters

- **bookingId** (string; required): Parent booking ID from create_hold (holdId), confirm_booking, or list_bookings. Never pass a child allocation ID.
- **action** ("request_code" | "verify_code"; required): request_code sends a code to an existing matching contact; verify_code exchanges that code for a replacement accessToken.
- **contact** (string; optional): For request_code: existing booking email address or E.164 phone number.
- **recoveryId** (string; optional): For verify_code: recoveryId from request_code.
- **code** (string | integer; optional): For verify_code: 6-digit code supplied by the customer. Expires after 10 minutes; at most 5 attempts.

## Example MCP call

Replace placeholders with returned IDs and saved credentials. Example dates must be replaced with the customer's future dates.

```json
{
  "name": "recover_booking_access",
  "arguments": {
    "bookingId": "<bookingId>",
    "action": "request_code",
    "contact": "asha@example.com"
  }
}
```

## Input JSON Schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "bookingId": {
      "type": "string",
      "minLength": 1,
      "description": "Parent booking ID from create_hold (holdId), confirm_booking, or list_bookings. Never pass a child allocation ID."
    },
    "action": {
      "type": "string",
      "enum": [
        "request_code",
        "verify_code"
      ],
      "description": "request_code sends a code to an existing matching contact; verify_code exchanges that code for a replacement accessToken."
    },
    "contact": {
      "description": "For request_code: existing booking email address or E.164 phone number.",
      "type": "string",
      "minLength": 3,
      "maxLength": 254
    },
    "recoveryId": {
      "description": "For verify_code: recoveryId from request_code.",
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "code": {
      "description": "For verify_code: 6-digit code supplied by the customer. Expires after 10 minutes; at most 5 attempts.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      ]
    }
  },
  "required": [
    "bookingId",
    "action"
  ]
}
```

## Output JSON Schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "bookingId": {
      "type": "string"
    },
    "recoveryId": {
      "type": "string"
    },
    "accessToken": {
      "type": "string"
    },
    "nextStep": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "bookingId",
    "nextStep",
    "message"
  ],
  "additionalProperties": false
}
```

## Annotations

```json
{
  "readOnlyHint": false,
  "destructiveHint": false,
  "idempotentHint": false,
  "openWorldHint": true
}
```

On failure, inspect isError and content; domain errors may include structuredContent.code, retryable, details.fields or alternatives. Annotations are behavior hints, not authorization.
