# Prepare a personal recommendation offer

Disabled until the paid pilot is configured. Exact city coverage over a bounded public collection page; no model call or charge.

Operation: prepareAskBrendan
POST /api/ask-brendan/prepare

Access: anonymous. Automatic retries: none. Redirects: manual. Request body limit: 4096 bytes.
Default timeout: 30 seconds. Response limit: 16 MiB. Pagination is opt-in and bounded; an exhausted bound reports incomplete execution.

[HTML reference](/developers/api/prepareAskBrendan) · [Authoritative schemas](/api/openapi.json)

## Wire contract

```json
{
  "operationId": "prepareAskBrendan",
  "summary": "Prepare a personal recommendation offer",
  "tags": [
    "Ask Brendan"
  ],
  "description": "Disabled until the paid pilot is configured. Exact city coverage over a bounded public collection page; no model call or charge.",
  "x-public-access": "anonymous",
  "x-public-side-effect": "coordination",
  "x-public-body-limit": 4096,
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "city": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "occasion": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            },
            "preferences": {
              "default": "",
              "type": "string",
              "maxLength": 2000
            },
            "minutes": {
              "type": "integer",
              "minimum": 30,
              "maximum": 480
            }
          },
          "required": [
            "city",
            "occasion",
            "minutes"
          ],
          "additionalProperties": false
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Offer or insufficient coverage",
      "content": {
        "application/json": {
          "schema": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "const": "ready"
                  },
                  "id": {
                    "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)$"
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  "amount": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  },
                  "priceVersion": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "purchaseUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "network": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "asset": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "recipient": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                },
                "required": [
                  "status",
                  "id",
                  "expiresAt",
                  "amount",
                  "priceVersion",
                  "purchaseUrl",
                  "network",
                  "asset",
                  "recipient"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "status": {
                    "const": "unsupported"
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "status",
                  "message"
                ],
                "additionalProperties": false
              }
            ]
          }
        }
      }
    },
    "400": {
      "description": "Request failed; never automatically retry a purchase. Retain the order reference for reconciliation.",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "403": {
      "description": "Request failed; never automatically retry a purchase. Retain the order reference for reconciliation.",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "409": {
      "description": "Request failed; never automatically retry a purchase. Retain the order reference for reconciliation.",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "410": {
      "description": "Request failed; never automatically retry a purchase. Retain the order reference for reconciliation.",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "413": {
      "description": "Request failed; never automatically retry a purchase. Retain the order reference for reconciliation.",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "415": {
      "description": "Request failed; never automatically retry a purchase. Retain the order reference for reconciliation.",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "422": {
      "description": "Request failed; never automatically retry a purchase. Retain the order reference for reconciliation.",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "429": {
      "description": "Request failed; never automatically retry a purchase. Retain the order reference for reconciliation.",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "502": {
      "description": "Request failed; never automatically retry a purchase. Retain the order reference for reconciliation.",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "503": {
      "description": "Request failed; never automatically retry a purchase. Retain the order reference for reconciliation.",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "504": {
      "description": "Request failed; never automatically retry a purchase. Retain the order reference for reconciliation.",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    }
  }
}
```

## Synthetic examples

### curl

```bash
curl --fail-with-body --max-time 30 --max-filesize 16777216 --request POST 'https://irvinebroque.com/api/ask-brendan/prepare' --header 'Accept: application/json' --header 'Content-Type: application/json' --data-binary @request.json
```

### TypeScript

```typescript
import { PublicApi } from '@irvinebroque/public-api';
const api = new PublicApi();
const result = await api.askBrendan.prepare({
  "body": {
    "city": "fixture",
    "occasion": "fixture",
    "minutes": 30
  }
});
console.log(result.status, result.headers.get('content-type')); // Keep transient capabilities in memory.
```

### CLI

```bash
irvinebroque askBrendan prepare --body-file request.json
```

### request.json

```json
{
  "city": "fixture",
  "occasion": "fixture",
  "minutes": 30
}
```
