Skip to main content

REST API Reference

Traditional HTTP API for non-MCP consumers (n8n, Zapier, scripts, mobile apps).

Base URL

https://ascend-gateway-v5.ascendgtm.workers.dev

Authentication

All API endpoints require a Bearer token:

Authorization: Bearer YOUR_TOKEN

Endpoints

POST /api/v1/TENANT/DOMAIN

Proxy a request to any registered API domain.

Path parameters:

  • tenant — Tenant ID (e.g., ascend, kahuna)
  • domain — API domain (e.g., hubspot, google_ads, slack)

Request body: Domain-specific parameters (same as the MCP tool schema).

Example:

curl -X POST /api/v1/ascend/hubspot \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"action": "search", "object_type": "deals", "filters": [{"propertyName": "dealstage", "operator": "EQ", "value": "closedwon"}]}'

GET /health

Health check endpoint (no auth required).

{
"status": "healthy",
"services": {"kv": "up", "d1": "up"},
"tokens": {"total": 57, "expiring_soon": 0, "expired": 0},
"providers": 62
}

POST /mcp

MCP Streamable HTTP endpoint. Used by AI agents (Claude, ChatGPT, Cursor).

Implements the Model Context Protocol specification with:

  • JSON-RPC 2.0 message format
  • Dynamic Client Registration (RFC 7591)
  • OAuth 2.1 with PKCE (S256)
  • Streamable HTTP transport

Response Format

All responses follow this structure:

{
"success": true,
"status": 200,
"data": { /* upstream API response */ },
"cache": "MISS"
}

Error responses:

{
"error": "Description",
"code": "ERROR_CODE",
"status": 401
}

Error Codes

CodeHTTP StatusDescription
AUTH_FAILED401Invalid or missing token
TENANT_NOT_FOUND404Tenant config not found
TENANT_SUSPENDED403Account suspended
CONFIG_MISSING404Provider not configured
TOKEN_MISSING404No API token for provider
TOKEN_EXPIRED401OAuth token expired
UPSTREAM_ERRORvariesTarget API returned error
VALIDATION_ERROR400Invalid parameters
RATE_LIMITED429Too many requests
TIMEOUT50430s timeout exceeded