Overview
API reference

REST API

JSON over HTTPS. Bearer authentication. Eight endpoints cover discovery, decision, validation, and booking handoff.

Base URL

https://api.b2a.bluepillow.com/v1

Authentication

Every request carries an Authorization: Bearer pk_… header. See API keys.

Idempotency

All POST endpoints require an Idempotency-Key header (UUID v4 recommended). Retrying with the same key returns the cached response.

Endpoints

Errors

Uniform error envelope. code is machine-stable; message is human-readable.

{
  "error": {
    "code": "invalid_request",
    "message": "field 'dates.check_in' is required",
    "field": "dates.check_in",
    "request_id": "req_01HXYZ...",
    "docs_url": "https://human.b2a.bluepillow.com/docs/api"
  }
}

Codes: invalid_request, authentication_failed, forbidden, not_found, conflict, rate_limited, upstream_unavailable, decision_expired, no_offers_found, internal_error.

Versioning

Optional B2A-Version: YYYY-MM-DD header pins behavior to a dated revision. Current: 2026-05-08.