Skip to content

API

Entry point for the Get2Dial control-plane HTTP API: where it lives, how it is shaped, and where to go next.

The control plane (cmd/control) serves a tenant-scoped HTTP API on port 8080. Application routes are versioned under /api/v1; health/metrics and WebSockets live at the root. Every response shares a single JSON envelope, every request is authenticated and scoped to the caller’s tenant, and errors follow one error model.

This section is organized as:

  • Conventions — base URL, the response envelope, pagination, content type, tenant scoping.
  • Authentication — obtaining and using a token, plus the separate node (edge) auth scheme.
  • Errors — the error envelope and status codes.
  • Endpoints — the grouped endpoint reference.
Terminal window
HTTP_ALLOWED_ORIGINS=https://app.get2dial.com # strict CORS allow-list
# Web apps target the API via a build-time public base URL:
NEXT_PUBLIC_CONTROL_API=https://api.get2dial.com
Terminal window
# Authenticate, then call a scoped endpoint with the returned token.
curl -s https://api.get2dial.com/api/v1/auth/login \
-H 'Content-Type: application/json' \
-d '{"email":"agent@example.com","password":"••••••••"}'
curl -s https://api.get2dial.com/api/v1/auth/me \
-H 'Authorization: Bearer <jwt>'
  • A generated OpenAPI reference is planned to render in this section so the docs stay in sync with the code. Until then the route table in cmd/control/main.go is the authoritative endpoint list.
  • All endpoints are tenant-scoped from the JWT — there is no global tenant.