Skip to main content

Base URL

All API requests are made to:

Request Format

All requests and responses use JSON. Set the Content-Type header to application/json for all requests that include a body.

Authentication

The Middlewr API uses Bearer token authentication via API keys. Include your API key in the Authorization header of every request:
See the Authentication page for details on creating and managing API keys.

Rate Limiting

API requests are rate limited to ensure fair usage and platform stability. Rate limit details are returned in the response headers: If you exceed the rate limit, the API returns a 429 Too Many Requests response. Back off and retry after the X-RateLimit-Reset time.

Resource Endpoints

The API is organized around the following resources:

Links

Create, read, update, and delete links — including links with rule graphs for automated routing.

Tags

Organize links with colored tags for filtering and categorization.

Domains

Manage custom branded domains for your links.

Workspaces

Create and manage workspaces for team collaboration.

Members

Manage workspace members and their permissions.

Analytics

Retrieve click analytics including per-branch data for rule-engine links.

Billing

Manage workspace billing, plans, and subscriptions.

Common Error Codes

The API uses standard HTTP status codes to indicate the success or failure of a request. Error responses include a JSON body with details:
Rule graph compilation errors include structured validation data: