---
title: "Pearl Cleaners & Alterations public API"
description: "Callback, NLWeb /ask and A2A endpoints."
canonical: "https://pearlcleaners.ca/docs/api.md"
last-updated: "2026-12-04"
---

# Pearl Cleaners & Alterations public API

OpenAPI description: https://pearlcleaners.ca/openapi.json. Every endpoint is public and needs no credentials. Optional anonymous bearer tokens are described in https://pearlcleaners.ca/auth.md.

## POST /api/callback

Sends a callback request to the shop by email. JSON body with `name` and `phone` (required), and optional `service`, `message` and `best-time`. Send an `Idempotency-Key` header of 16-80 letters, digits or hyphens. A 503 means direct delivery is not configured; give the person the phone number instead.

## POST /ask

NLWeb v0.55. Send `{"query":{"text":"are you open on Saturday?"}}`. Add `"prefer":{"streaming":true}` or `Accept: text/event-stream` for server-sent events (`start`, `result`, `complete`).

## POST /a2a

A2A JSON-RPC endpoint (method `message/send`). Agent card: https://pearlcleaners.ca/.well-known/agent-card.json.

## Test mode

Test mode (sandbox): add the header `Pearl-Test-Mode: true` (or `?test=true`) to `POST /api/callback`. The request is fully validated and returns `{"ok":true,"test":true,"delivered":false}`, but nothing is sent to the shop. Every other endpoint is read-only, so it is safe to call directly.

Sandbox environment: https://pearlcleaners.ca/sandbox mirrors the API (`/sandbox/api/callback`, `/sandbox/mcp`, `/sandbox/mcp/docs`, `/sandbox/ask`, `/sandbox/a2a`). Every request there runs in test mode and responses carry `Pearl-Environment: sandbox`. `GET https://pearlcleaners.ca/sandbox` lists the endpoints.

## Web Bot Auth

Key directory: https://pearlcleaners.ca/.well-known/http-message-signatures-directory (Web Bot Auth, HTTP Message Signatures). It lists the Ed25519 key Pearl's server would sign its own automated requests with, and the response is itself signed. Pearl's server does not crawl or call other sites today.

## Versioning and deprecation

Versioning and deprecation: the API is version 1 (optional `Pearl-Api-Version: 1` header, echoed in responses). Breaking changes ship as a new version next to the old one. A version being retired is marked `deprecated: true` in the OpenAPI document and its responses carry `Deprecation` (RFC 9745) and `Sunset` (RFC 8594) headers at least 90 days before removal.

## Discovery

- ARD catalog: https://pearlcleaners.ca/.well-known/ard.json
- API catalog (RFC 9727): https://pearlcleaners.ca/.well-known/api-catalog
- Schema feed: https://pearlcleaners.ca/schemamap.xml
