Environment variables
A service's own environment variables. ?restart=true restarts the live service when its effective environment changed.
/api/v1/services/{id}/envThe service's own variables (not those of its env groups).
An API token: one created in the dashboard or by ferry login, or the server token stored in <data-dir>/api_token. GET requests may send it as ?access_token= instead.
In: header
Path Parameters
Service id or name.
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/services/string/env" \ -H "Authorization: Bearer $FERRY_TOKEN"[ { "key": "string", "value": "string" }]/api/v1/services/{id}/envUpserts set and deletes unset; the other variables stay.
An API token: one created in the dashboard or by ferry login, or the server token stored in <data-dir>/api_token. GET requests may send it as ?access_token= instead.
In: header
Path Parameters
Service id or name.
Query Parameters
Then restart the affected live services whose effective environment changed (the variables are saved either way; a failed restart is reported as the error).
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
PATCH /api/v1/services/{id}/env (and env groups): upsert set, delete unset.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/api/v1/services/string/env" \ -H "Authorization: Bearer $FERRY_TOKEN" \ -H "Content-Type: application/json" \ -d '{}'[ { "key": "string", "value": "string" }]/api/v1/services/{id}/envThe service's own variables become exactly vars. They are validated alone and merged with the linked env groups (size limits, ${{...}} references).
An API token: one created in the dashboard or by ferry login, or the server token stored in <data-dir>/api_token. GET requests may send it as ?access_token= instead.
In: header
Path Parameters
Service id or name.
Query Parameters
Then restart the affected live services whose effective environment changed (the variables are saved either way; a failed restart is reported as the error).
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
PUT /api/v1/services/{id}/env (replace all) and env group equivalent.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://example.com/api/v1/services/string/env" \ -H "Authorization: Bearer $FERRY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "vars": [ { "key": "string", "value": "string" } ] }'[ { "key": "string", "value": "string" }]