Skip to content

Agent API: create access sheets

Pay with x402 in USDC on Base. Then a Bearer JWT to create sheets and revoke guest links. Wallet identity, no SMS.

First run

  1. POST /api/agent/subscribe — 402, pay, retry → JWT
  2. POST /api/agent/fiches — Bearer + Idempotency-Key
  3. POST /api/agent/fiches/{id}/share — guest URL
curl -sS -X POST https://sesapp.fr/api/agent/subscribe \
  -H 'content-type: application/json' \
  -d '{}'
# 402 + PAYMENT-REQUIRED → retry with PAYMENT-SIGNATURE
# (or X-Agent-Dev in DEV). Response includes JWT.

curl -sS -X POST https://sesapp.fr/api/agent/fiches \
  -H "Authorization: Bearer $JWT" \
  -H 'content-type: application/json' \
  -H 'Idempotency-Key: listing-1' \
  -d '{"name":"Gîte des Pins","formattedAddress":"13 rue Parrot, 75012 Paris","lat":48.8466,"lon":2.3742,"accessCode":"4281","wifiName":"GitePins","wifiPassword":"secret","locale":"fr","instructions":"# Bienvenue\n\n[Ajouter le WiFi](sesapp:wifi)"}'

curl -sS -X POST https://sesapp.fr/api/agent/fiches/FICHE_ID/share \
  -H "Authorization: Bearer $JWT" \
  -H 'content-type: application/json' \
  -d '{}'

Agent

15 USDC

/ 30 days

  • 20 active sheets
  • REST + MCP
  • Revocable links
  • 0.50 USDC per extra sheet

POST /api/agent/subscribe

Fleet

79 USDC

/ 30 days

  • 200 active sheets
  • REST + MCP
  • Revocable links
  • 0.25 USDC per extra sheet · webhooks

POST /api/agent/subscribe?plan=fleet

Platform

250 USDC

/ 30 days

  • Fair-use sheets
  • REST + MCP
  • Revocable links
  • Fair-use · webhooks · SLA / OEM

POST /api/agent/subscribe?plan=platform

Discovery (GEO)

REST

  • POST /api/agent/subscribe — x402, then JWT
  • GET /api/agent/subscribe — plan, quota, expiry
  • POST /api/agent/geocode — address → lat/lon
  • GET /api/agent/fiches — list
  • POST /api/agent/fiches — create (Idempotency-Key)
  • GET /api/agent/fiches/{id} — one sheet
  • PATCH / DELETE /api/agent/fiches/{id}
  • POST /api/agent/fiches/{id}/share — { expiresAt? }
  • GET /api/agent/fiches/{id}/shares
  • DELETE /api/agent/share/{token} — revoke (?delayDays=7 soft)
  • GET/POST /api/agent/webhooks — Fleet / Platform
  • GET/PATCH/DELETE /api/agent/webhooks/{id}

MCP tools

subscribe, status, geocode, list_fiches, get_fiche, create_fiche, update_fiche, delete_fiche, share_fiche, list_shares, revoke_share, register_webhook, list_webhooks, update_webhook, delete_webhook.

Flip book (Markdown)

Field instructions is the guest booklet. Cover (map, name, address, access code) is generated — do not repeat it. Split pages with a line containing only ---. Photos: https URLs only (no upload). Never put wifiPassword in Markdown (GPS 150 m). Intents: [Ajouter le WiFi](sesapp:wifi) needs wifiName / wifiPassword; [Ajouter le contact](sesapp:contact) needs phoneNumber.

Agent playbook with a JSON example: /llms.txt. Same text on the OpenAPI instructions property.

Webhooks (Fleet / Platform)

POST HTTPS. Headers X-SesApp-Event, X-SesApp-Id, X-SesApp-Signature (t=unix,v1=hmac_sha256(secret, timestamp + "." + body)). Events: fiche.viewed, share.created, share.revoked, wifi.unlocked, quota.warning. Secret shown once. 3 retries. Rate limits: 60 / 180 / 600 req/min. No bulk import endpoint — loop POST /fiches with Idempotency-Key.

x402 payment

POST /api/agent/subscribe without PAYMENT-SIGNATURE returns 402 with the PAYMENT-REQUIRED header. After settlement, the response includes a JWT. Past quota, creating a sheet returns 402 (overage: 0.50 USDC Agent, 0.25 Fleet).

CORS is open (Access-Control-Allow-Origin: *). OPTIONS returns 204.