# api.lawyer — legal work as an API

api.lawyer is the demand side of legal work for agents: one HTTP surface where
a Matter (one Client, one legal objective) is opened, advanced through the six
Stage Verbs (intake, prepare, examine, review, sign, file), and settled — with
every capability classified by its effect (read, record, act) and gated exactly
where the law gates it.

Blog: https://api.lawyer/blog.md (the posts as markdown), with feeds at
https://api.lawyer/blog/rss.xml and https://api.lawyer/blog/feed.json; every post
in full: https://api.lawyer/llms-full.txt.

## The typed catalog, in one paragraph

Reads are keyless — dockets, registers, statuses, file-wrappers. Open workflows
(drafting, review, assembly, docketing) run agent-native end to end. The
reserved acts — a filing signature, a demand letter on attorney letterhead,
legal advice itself — are the one class an agent cannot perform: they escalate
to an independent, verified professional on the gigs.lawyer network who reviews
and, in their own judgment, signs under their own license. Every outcome is
typed: OK, EMPTY, BLOCKED — never a silent failure, never a faked success.

## The reserved-act boundary

Agents can't practice law; they can call it. The Reserved-Act Catalog is
platform-counsel-owned: where an act is reserved, the API answers with a typed
pending state and routes the act to a licensed human whose refusal is final.
Building on this API is how a product avoids practicing law, not how it risks
it.

## Quickstart

```sh
npx api.lawyer                       # CLI + MCP server (npx api.lawyer mcp serve)
curl https://api.lawyer/matters      # keyless first value — a typed OK envelope
curl https://api.lawyer/pricing      # the Pricing Document ({"model":"free"})
curl https://api.lawyer/healthz      # liveness, typed
```

Preview build: in-memory stores, deterministic clock, no live filings. Nothing
here is legal advice.

## The access-tier ladder

1. **anonymous** — keyless. Every read surface, and anonymous sandbox
   provisioning: POST /workspaces (a practice-management workspace),
   POST /tenants (an integrator Tenant grain), or POST /firms (the firm
   envelope grain — member-executed Enrollment grants and a lattice-derived
   roster) — no email, no approval, no key.
2. **identified** — an id.org.ai sign-in binds the grain to your principal
   (declared on the capability card only where the identity plane is wired).
3. **credential_verified** — id.org.ai license verification, fresh at
   act-class. Not live yet: the doors that need it answer a typed BLOCKED
   naming this upgrade path — they never pretend to verify.
4. **delegated** — a verified principal grants scoped authority to their
   agent; X-Actor/X-Mandate provenance is carried but no mandate verifier is
   live yet, so a door that requires a proven grant refuses with the cure.

## Sandbox doctrine

A workspace, tenant, or firm from the doors above is a full-contract sandbox: the
same routes, the same typed envelopes, synthetic seed state, and every
response carries provenance { "environment": "sandbox", "simulated": true }.
Escalations to gigs.lawyer never leave the building — a deterministic
in-process counterparty answers the Gig post, and YOU play the Signer via the
same gig-result door the live network calls back on. Fixtures are synthetic
identifiers only. Anonymous grains expire on a TTL and creation is bounded
per caller; reset is a fresh POST, never an in-place wipe.

The guided rendering of this walk — order → Matter → stages → Gig →
attest/decline → Meter release, every step a real call, labeled synthetic
throughout — lives at https://api.lawyer/sandbox (keyless, shareable).

### Magic fixtures (deterministic, contract-tested)

Every workspace honors named well-known values with promised outcomes —
script against these, listed live at GET /workspaces/{id}/fixtures:

- `sg_fixture_eligible` (attestation.signedBy) — always verifies eligible.
- `sg_fixture_lapsed` (attestation.signedBy) — always fails standing; the
  gig-result answers 422 and the Gig stays pending.
- `sg_fixture_lapsed_coverage` (attestation.signedBy) — always fails the
  coverage predicate: Coverage verified in force once, policy lapsed since;
  the 422 names the cure (re-verify the coverage in force) and the Gig
  stays pending.
- `Conflict Fixture Industries` (adverseParties[]) — always a conflict hit:
  the Matter carries the conflict_hit Signal from intake.
- `[fixture:ack-due]` (asset.title prefix) — the Deadline Ladder always
  sits inside the final week; the daily-ack rung is live from the first read.
- `Declan Declines (fixture)` (client.name) — every reserved-act Gig is
  declined: the Matter lands in needs_client_direction (Declination
  Finality), reopened only by a journaled Client Direction.
- `Fiona Fulfills (fixture)` (client.name) — every reserved-act Gig is
  attested by the eligible fixture Signer: repeated advances walk clean to
  the fulfilled terminal.

Every firm grain holds a fixture BENCH the same way, listed live at
GET /firms/{id}/fixtures:

- `mb_fixture_eligible` (memberId) — always derives eligible on the roster.
- `mb_fixture_suspended` (memberId) — always derives ineligible on the
  standing predicate, without any Register being consulted.
- `mb_fixture_revoking` (memberId) — enrolls, then revokes mid-scenario;
  the next roster read blanks the row (derivation, not deletion).

## The data catalog (empty-but-real)

GET https://api.lawyer/catalog lists the data SKUs sold on this surface —
zero today, stated as a typed EMPTY envelope that also carries the
declaration contract a SKU must satisfy: posted flat price, fee line,
Merchant of Record, meter grain, and the data ProofPredicate —
"no record, no charge": the served record releases the meter; an empty
result inside a stated scope is a record; a not-found, an unreachable
upstream, and a retried failed call never meter. A SKU appears only when it
is live, priced, and metered.

## Run our tests

The public-contract suite is published and digest-pinned:

```sh
curl https://api.lawyer/verify/suite.json   # the suite (api.qa/suite@1)
npx autonomous-qa verify https://api.lawyer # the independent verifier
```

Details and the pin: https://api.lawyer/verify. Independent verdict:
https://api.qa/api.lawyer.

## Machine surfaces

- Capability card (AXP probe manifest): https://api.lawyer/.well-known/agents.json
- OpenAPI 3.1 contract: https://api.lawyer/openapi.json
- Pricing Document: https://api.lawyer/pricing
- Self-classification (agent classes + ladder): https://api.lawyer/icp.json
- Data catalog: https://api.lawyer/catalog
- Published test suite: https://api.lawyer/verify
- This file: https://api.lawyer/llms.txt
- Conformance (independent verifier): https://api.qa/api.lawyer

## Blog

Every post also answers as markdown at its address plus .md; the index is https://api.lawyer/blog.md.

- [The market is solving the opposite problem](https://api.lawyer/blog/the-market-is-solving-the-opposite-problem): Legal AI puts AI inside the law firm. api.lawyer puts lawyers inside the AI, as the legal services layer for the agentic economy.
- [The endpoint is easy. The substrate is the product.](https://api.lawyer/blog/the-substrate-is-the-product): Calling a lawyer is harder than calling software. Eight primitives sit underneath the call. Here is which of them run today, and which are still ahead.
- [AI prepares. Lawyers judge.](https://api.lawyer/blog/ai-prepares-lawyers-judge): AI compresses the production of legal work. What remains is smaller, faster and concentrated in judgment, and a refusal is completed work, not a failed one.
- [Agents need a legal path into the real world](https://api.lawyer/blog/agents-need-a-legal-path-into-the-real-world): Intelligence doesn't confer legal authority. When an agent reaches a boundary that needs judgment, a credential or a signature, api.lawyer is the escalation layer that lets the workflow continue.
