FerryDocs
ReferenceAPI reference

Environment variables

A service's own environment variables. ?restart=true restarts the live service when its effective environment changed.

GET/api/v1/services/{id}/env

The service's own variables (not those of its env groups).

Authorization

AuthorizationBearer <token>

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

id*string

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"  }]

Set and unset variables

PATCH/api/v1/services/{id}/env

Upserts set and deletes unset; the other variables stay.

Authorization

AuthorizationBearer <token>

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

id*string

Service id or name.

Query Parameters

restart?boolean

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"  }]
PUT/api/v1/services/{id}/env

The service's own variables become exactly vars. They are validated alone and merged with the linked env groups (size limits, ${{...}} references).

Authorization

AuthorizationBearer <token>

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

id*string

Service id or name.

Query Parameters

restart?boolean

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"  }]