API Reference Last updated March 14, 2026

API Reference

The AgentBridge REST API follows predictable conventions. All requests use JSON bodies. All responses return a consistent envelope. This page covers the global rules that apply to every endpoint.

Base URL #

Base URL https://api.agentbridge.in

All API endpoints are relative to this base URL. The API is served exclusively over HTTPS — plain HTTP requests receive a 301 Moved Permanently redirect. HSTS is enabled with a max-age of one year and includeSubDomains. All data is hosted in AWS ap-south-1 (Mumbai).

If you are using the TypeScript SDK, the base URL is configured automatically. You can override it via the baseUrl constructor option for testing or self-hosted deployments.

Versioning #

The current API is v1. There is no version prefix in the URL — all endpoints are available directly under the base URL (e.g. /api/mcp/execute, not /v1/api/mcp/execute).

When breaking changes are introduced in the future, they will be published under a versioned path prefix (e.g. /v2/) with a minimum 6-month deprecation notice and migration guide. Non-breaking additions (new fields in responses, new optional parameters, new endpoints) are made to v1 without versioning.

Request Format #

  • All request bodies must be valid JSON (UTF-8 encoded)
  • Set Content-Type: application/json on every POST, PUT, and PATCH request
  • Authenticate with Authorization: Bearer <your-api-key> (see Authentication)
  • Query parameters use standard URL encoding
  • Request body size limit: 1 MB
bash — example request
curl -X POST https://api.agentbridge.in/api/mcp/execute \
  -H "Authorization: Bearer ab_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "slack",
    "tool": "send_message",
    "params": {
      "channel": "C012AB3CD",
      "text": "Hello from AgentBridge"
    }
  }'

Response Format #

Success Response #

Successful responses return HTTP 200 or 201 with a JSON envelope:

json — success envelope
{
  "status":      "success",
  "data":        { /* endpoint-specific payload */ },
  "latencyMs":   247,
  "executionId": "exec_01HXZ..."
}
status string Always "success" for successful responses.
data object The response payload. Shape varies by endpoint — see individual endpoint documentation for details.
latencyMs number End-to-end time in milliseconds from request receipt to response send, including any upstream provider API call.
executionId string Present on /mcp/execute responses. Unique identifier for the execution, usable for log lookup.

Error Response #

Errors return the appropriate HTTP status code with a JSON error envelope:

json — error envelope
{
  "statusCode":    422,
  "message":       "Provider returned an error",
  "error":         "Unprocessable Entity",
  "providerError": {
    "code":    "object_not_found",
    "message": "Could not find page with ID: abc123"
  }
}
statusCode number HTTP status code (matches the response status).
message string Human-readable error description.
error string HTTP status text (e.g. "Bad Request", "Unauthorized", "Not Found").
providerError object | undefined Present only on 422 responses. Contains the raw error body from the upstream provider. Shape varies by provider.

See the Error Reference for the complete error catalog with provider-specific examples.

All Endpoints #

Method Path Description Auth
POST /auth/signup Create a new AgentBridge account None
POST /auth/login Log in and receive a JWT session cookie None
POST /auth/logout Invalidate the current JWT session JWT
POST /api/mcp/execute Execute a tool on a connected provider Bearer
GET /integrations/providers List all available MCP providers and their tools Bearer / JWT
POST /integrations Create a new integration (store OAuth tokens) Bearer / JWT
DELETE /integrations/:providerId Disconnect and remove an integration Bearer / JWT
GET /logs List execution logs with pagination Bearer / JWT
GET /logs/:id Get a single execution log by ID Bearer / JWT
GET /api-keys List all API keys for the authenticated account Bearer / JWT
POST /api-keys Create a new API key Bearer / JWT
DELETE /api-keys/:id Revoke and delete an API key Bearer / JWT

HTTP Status Codes #

Status Meaning Common Cause Retryable
200OKRequest succeeded; data in response bodyN/A
201CreatedResource created successfully (API key, integration)N/A
400Bad RequestMissing or invalid request body parametersNo
401UnauthorizedAPI key missing, malformed, or revokedNo
403ForbiddenAPI key scope insufficient for this operationNo
404Not FoundResource not found, or provider integration not connectedNo
409ConflictIntegration for this provider already existsNo
422Unprocessable EntityProvider returned an error (check providerError)No
429Too Many RequestsRate limit exceeded; retry after X-RateLimit-ResetYes
500Internal Server ErrorAgentBridge server error; safe to retry with backoffYes
502Bad GatewayUpstream provider API unreachable or returned invalid responseYes

Pagination #

Endpoints that return lists (e.g. GET /logs, GET /api-keys) support offset-based pagination via page and limit query parameters.

page optional integer Page number (1-indexed). Defaults to 1.
limit optional integer Items per page. Defaults to 20. Maximum: 100.

The response envelope for paginated endpoints includes total count and current position:

json — paginated response
{
  "status": "success",
  "data": {
    "data":  [ /* array of items */ ],
    "total": 84,
    "page":  2,
    "limit": 20
  },
  "latencyMs": 43
}
bash — example paginated request
curl "https://api.agentbridge.in/logs?page=2&limit=50" \
  -H "Authorization: Bearer ab_live_xxxx"

To calculate whether more pages exist, check if page * limit < total. If true, increment page and make another request.

Content Negotiation #

The API always responds with Content-Type: application/json; charset=utf-8. All responses are JSON. Do not set Accept headers that exclude JSON — requests with an Accept header that cannot be satisfied will receive a 406 Not Acceptable response.

Request bodies must also be JSON. Sending Content-Type: application/x-www-form-urlencoded or multipart/form-data will result in a 400 Bad Request error.