management api

Everything the console does, as an API.

Proxies, spec versions, publishing, environments, drift, coverage, alerts, keys and domains - all of it is an operation here, and a command in the CLI. A write action that exists only in a browser is one you cannot perform at 3am.

This page is generated from the server

The operations below are not written about our API. They are read out of the document our API is served from: /v1 resolves its operations from it, validates every request against it before a handler runs, and compiles its bearerAuth scheme into the check that guards each one. An operation it declares that we have not implemented is a refusal to start, not a 404 you find.

The document itself is at /api/openapi.json - point a generator at it.

Getting a token

Issue one on your account page. It is shown once: we keep only its hash, so a token we could show you twice would be one a database dump could show anyone. It belongs to the account rather than to you, so it keeps working when the person who created it leaves.

export APIP_TOKEN=apip_...
curl -H "Authorization: Bearer $APIP_TOKEN" https://openapi-proxy.com/v1/proxies

The operations

Every operation with the schemas it declares. Send one. The try-it forms post to /v1 on this site with the token you paste into them - the same request the CLI would send, against your real account, so a delete deletes.

openapi-proxy.com management API 1.0.0

Everything the console does, as an API. This document is not written about the API - it IS the API: the server dispatches from it, validates every request against it, and a test walks its operations to prove the CLI can reach each one. We sell contract enforcement; our own contract being the implementation is the demo.

Authorize

bearerAuth http bearer

proxies

POST /proxies/{proxy_id}/token Rotate the gateway report token
GET /proxies/{proxy_id} One proxy
DELETE /proxies/{proxy_id} Delete a proxy
PATCH /proxies/{proxy_id} Change a proxy's name, upstream or mode
GET /proxies Every proxy on the account
POST /proxies Create a proxy

alerts

GET /proxies/{proxy_id}/alerts The alert rules on a proxy
POST /proxies/{proxy_id}/alerts Add an alert rule
DELETE /proxies/{proxy_id}/alerts/{alert_id} Remove a rule
PATCH /proxies/{proxy_id}/alerts/{alert_id} Silence a rule, or wake it up again

drift

GET /proxies/{proxy_id}/violations Drift, one row per shape of disagreement
GET /proxies/{proxy_id}/coverage How much of the traffic was actually weighed

specs

POST /proxies/{proxy_id}/publish Publish a version
GET /proxies/{proxy_id}/specs/{version_id} One version's document, verbatim
GET /proxies/{proxy_id}/specs The spec versions of a proxy
POST /proxies/{proxy_id}/specs Add a spec version, from bytes or from a URL
GET /proxies/{proxy_id}/diff What changed between two versions, in contract and in reality

environments

DELETE /proxies/{proxy_id}/environments/{name} Remove an environment
GET /proxies/{proxy_id}/environments Named pointers at versions
POST /proxies/{proxy_id}/environments Point an environment at a version

examples

GET /proxies/{proxy_id}/examples The mock examples set on a proxy
PUT /proxies/{proxy_id}/examples Create or update a mock example

Upserts on (operation_id, status, name): the same triple replaces its body, a new one is created. The body must be valid JSON and validate against that response's schema, or the request is refused - the mock is never made to serve a body its own validator would reject. Applying the change republishes the proxy, so the live mock returns it within a poll.

DELETE /proxies/{proxy_id}/examples/{example_id} Remove a mock example