Skip to main content

Through the API

Convoy's API creates, updates, rolls back and removes your stations. Convoy gives you its address and an integrator key; every call carries it:

API_URL=https://<address-convoy-gives-you>
API_KEY=<your-integrator-key>
curl -s "$API_URL/v1/tenants" -H "Authorization: Bearer $API_KEY"

Without a valid key: 401. A station is addressed by its slug, or by your id, ext:<external_id>: you never need to keep our slug. Another integrator's station answers 404, like a station that does not exist.

Convoy sets the slug at creation, returns it in every response, and never changes it. It derives it from your external_id and ends it with -station (teranga gives teranga-station). The slug is public: it names the station's addresses, mcp-<slug>.convoy-ai.com. An external_id that looks like a private identifier (an email address, a UUID, more than 40 characters) is never written there: the slug then comes from display_name, or failing that from an opaque name.

Every response about a station has the same shape:

{
"slug": "teranga-station",
"external_id": "teranga",
"display_name": "Teranga",
"state": "ready",
"config_digest": "…",
"servers": [{"kind": "mcp", "url": "https://mcp-teranga-station.convoy-ai.com", "state": "running", "public": true}]
}

state is provisioning, ready, degraded (something does not serve: the response says what) or deleting.

Check​

callanswers
GET /v1/tenants/{id}the station's state, its servers as they really run
GET /v1/tenantsall your stations, in the same shape
POST /v1/tenants/{id}/compare with {"config": {…}}same, and the list of top-level keys that differ (differs) between your file and the config that runs. Changes nothing
GET /v1/tenants/{id}/specseach API's pinned OpenAPI spec: where it came from (source_url), its base_url, its digest, when it was read
GET /v1/tenants/{id}/runsthe change log: who did what, when, and how it ended
curl -s -X POST "$API_URL/v1/tenants/ext:teranga/compare" \
-H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" \
-d @- <<'JSON'
{"config": {"station": {"id": "teranga", "name": "Teranga"}, "global": {"language": "fr"}}}
JSON
# {"slug": "teranga-station", "same": false, "differs": ["apis", "skills"]}

The config travels as JSON: it is the same object as your YAML file.

What a config refuses is read in a publish's response: see Before you publish. Checking a config without publishing it is not yet available to you.

Publish​

POST /v1/tenants creates the station, starts the servers asked for:

curl -s -X POST "$API_URL/v1/tenants" \
-H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" \
-d @- <<'JSON'
{
"external_id": "teranga",
"display_name": "Teranga",
"config": {"station": {"id": "teranga", "name": "Teranga"}, "global": {"language": "fr"}},
"servers": [{"kind": "mcp"}]
}
JSON
responsemeaning
201the station is created; ready only once every server serves this station: the MCP exposes the config's skills
200the same body was already sent: the station exists, its servers are brought current and asked
422the config is refused (the list of faults, see Before you publish), an unknown key (unknown_keys), an unreadable OpenAPI spec, an API whose address is not public (a local or private-network address), or the station's keys are refused (below); nothing is written
409a station with the same external_id already exists with another config: change it with /resync (the response says so)
502the station is registered but does not serve yet: it is degraded, and the response says why. Sending the same body again resumes where it stopped

servers takes mcp: the address Claude, ChatGPT or any MCP agent connects to, see Connect an agent. Each server's url is in the response.

A server can also be added later, and removed:

calleffect
POST /v1/tenants/{id}/servers with {"kind": "mcp"}starts that server; returns its url
DELETE /v1/tenants/{id}/servers/{kind}stops it

Your APIs' keys​

The keys the station sends to your APIs go through neither the config nor this API: the config only names a variable (key_env, token_env, username_env, password_env, see Sources). You give their values once to Convoy, outside the config, with the hosts they are allowed to go to. Only this station's servers receive them; they are never in a response, the change log or the logs.

Every publish (POST /v1/tenants, /resync, /redeploy, /rollback) checks them before touching anything, and answers 422 this station's keys are refused when:

  • a variable the config names has no value: every call to that API would fail;
  • a value given is read by no API of the config;
  • the base_url of an API that reads a key is not on one of the hosts given with it: a changed config cannot send a key elsewhere;
  • a value has the shape of a known production key (sk_live_, rk_live_): the stations served today run on test accounts.

The response names the variable, never its value. Giving or changing a key yourself is not yet available to you: you pass it to Convoy, then send the same request again.

Update​

calleffect
POST /v1/tenants/{id}/resync with the same body as the create (external_id, display_name, config)applies a new config. It is judged as at creation: with an error, 422 and nothing is written. A body with only config gets a 422
POST /v1/tenants/{id}/redeploy, with no bodyputs the station on Convoy's current version, with the config it already has. If that version now refuses the config: 422, and no server is touched

Both answer ready once every server serves the new config, otherwise 502 and degraded. A 409 core mismatch says the platform is being upgraded: nothing is changed, send it again later.

Two changes to the same station never run at once: the second gets a 409 busy straight away. Send it again once the first one is done.

Roll back​

GET /v1/tenants/{id}/versions lists the last ten versions, most recent first (version, config_digest, created_at, current). POST /v1/tenants/{id}/rollback with {"version": n} applies that version's config again, like a /resync:

curl -s -X POST "$API_URL/v1/tenants/ext:teranga/rollback" \
-H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" \
-d '{"version": 3}'

An unknown version answers 404. A version Convoy's current version refuses answers 422. A version that ran on another version of the platform answers 409 (images moved): that rollback is not yet available to you.

Remove​

DELETE /v1/tenants/{id} sets the station to deleting, then removes its servers, its config, its keys and its route; the response is 204. Meanwhile any change gets a 409. If a step fails, the response (502) says what is already removed: sending the same DELETE again finishes the job. The change log (/runs) stays after the delete, so you can tell who removed what.

Follow the state​

Between two changes, Convoy looks at each ready station every minute. If a server stops or no longer serves the station, if the ref of an added line is gone at the tenant, or if a list a search ranks fails, grows past 500 rows or no longer has a single priced row (a few rows without a price are only noted), it goes degraded; once all is well again, it goes back to ready. Each move is recorded in /runs.