API Reference

EmbiPay exposes REST APIs for Admin (Bearer token) and Agent (agent_key) operations. Rate limited at 60 requests/minute.

Authentication

  • Admin API: Authorization: Bearer <ADMIN_API_TOKEN> or Supabase session JWT (user in adminkeys)
  • Agent API: Authorization: Bearer <agent_key>

Endpoints

MethodPathDescription
POST/api/admin/create-walletCreate agent wallet
POST/api/admin/create-shared-poolCreate shared expense pool
POST/api/admin/contribute-to-poolContribute to pool (with optional usage_limit)
GET/api/admin/pool-detailsGet pool with allocation breakdown
POST/api/admin/record-pool-usageRecord pool usage (blocks when exhausted; -1=unlimited)
POST/api/admin/pool-exitRemove agent from pool (Milestone 3)
GET/api/admin/pool-overuseList contributions with usage_limit < -1 (overuse)
POST/api/admin/create-loanCreate A2A loan
POST/api/admin/approveLoanApprove loan
POST/api/admin/record-repaymentRecord loan repayment
GET/api/admin/loan-detailsGet loan with schedule
GET/api/admin/fetch-a2a-loansList all A2A loans
POST/api/admin/register-webhookRegister webhook URL
GET/api/admin/register-webhookList registered webhooks
GET/api/admin/fetchAllLedgersFetch ledger entries
GET/api/agent/fetch-tasksAgent: fetch pending tasks
POST/api/agent/complete-taskAgent: complete task
POST/api/agent/feedbackAgent: send feedback (bug, suggestion)

OpenAPI Specification

Download the OpenAPI 3.0 spec for tooling and code generation:

api-spec.json →