FerryDocs
ReferenceAPI reference

Env groups

Shared variable sets linked to services (a service's own variables win over its groups'), and linking / unlinking them.

List env groups

GET/api/v1/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

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/env-groups" \  -H "Authorization: Bearer $FERRY_TOKEN"
[  {    "created_at": "2019-08-24T14:15:22Z",    "id": "string",    "name": "string",    "updated_at": "2019-08-24T14:15:22Z",    "services": [      "string"    ],    "vars": [      {        "key": "string",        "value": "string"      }    ]  }]

Create an env group

POST/api/v1/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

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

POST /api/v1/env-groups

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/env-groups" \  -H "Authorization: Bearer $FERRY_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "created_at": "2019-08-24T14:15:22Z",  "id": "string",  "name": "string",  "updated_at": "2019-08-24T14:15:22Z",  "services": [    "string"  ],  "vars": [    {      "key": "string",      "value": "string"    }  ]}

Get an env group

GET/api/v1/env-groups/{id}

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

Env group id or name.

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/env-groups/string" \  -H "Authorization: Bearer $FERRY_TOKEN"
{  "created_at": "2019-08-24T14:15:22Z",  "id": "string",  "name": "string",  "updated_at": "2019-08-24T14:15:22Z",  "services": [    "string"  ],  "vars": [    {      "key": "string",      "value": "string"    }  ]}

Delete an env group

DELETE/api/v1/env-groups/{id}

Refused while services are linked to it (they would lose its variables at their next restart), unless force=true; restart=true then restarts the linked live services so they drop the variables now.

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

Env group id or name.

Query Parameters

force?boolean

Delete even though services are linked to it.

restart?boolean

With force: restart the linked live services whose environment changes.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/api/v1/env-groups/string" \  -H "Authorization: Bearer $FERRY_TOKEN"
Empty
PATCH/api/v1/env-groups/{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

Env group 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/env-groups/string/env" \  -H "Authorization: Bearer $FERRY_TOKEN" \  -H "Content-Type: application/json" \  -d '{}'
{  "created_at": "2019-08-24T14:15:22Z",  "id": "string",  "name": "string",  "updated_at": "2019-08-24T14:15:22Z",  "services": [    "string"  ],  "vars": [    {      "key": "string",      "value": "string"    }  ]}
PUT/api/v1/env-groups/{id}/env

The group's variables become exactly vars, validated alone and in the combined environment of every linked service.

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

Env group 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/env-groups/string/env" \  -H "Authorization: Bearer $FERRY_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "vars": [      {        "key": "string",        "value": "string"      }    ]  }'
{  "created_at": "2019-08-24T14:15:22Z",  "id": "string",  "name": "string",  "updated_at": "2019-08-24T14:15:22Z",  "services": [    "string"  ],  "vars": [    {      "key": "string",      "value": "string"    }  ]}
POST/api/v1/services/{id}/env-groups

The group's variables apply from the service's next deploy or restart (its own variables win). Linking an already linked group is a no-op.

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.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

POST /api/v1/services/{id}/env-groups

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/services/string/env-groups" \  -H "Authorization: Bearer $FERRY_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "group": "string"  }'
{  "auto_deploy": true,  "branch": "string",  "build_command": "string",  "cpu_limit": 0,  "created_at": "2019-08-24T14:15:22Z",  "custom_domains": [    "string"  ],  "deploy_hook_key": "string",  "disk_mount_path": "string",  "dockerfile_path": "string",  "health_check_path": "string",  "id": "string",  "image": "string",  "instances": 0,  "live_deploy_id": "string",  "memory_limit_mb": 0,  "name": "string",  "port": 0,  "publish_dir": "string",  "repo_url": "string",  "root_dir": "string",  "runtime": "auto",  "schedule": "string",  "start_command": "string",  "suspended": true,  "type": "web_service",  "updated_at": "2019-08-24T14:15:22Z",  "deploy_hook_path": "string",  "env_groups": [    "string"  ],  "hosts": [    "string"  ],  "internal_host": "string",  "internal_port": 0,  "latest_deploy": {    "commit_message": "string",    "commit_sha": "string",    "created_at": "2019-08-24T14:15:22Z",    "error": "string",    "finished_at": "2019-08-24T14:15:22Z",    "id": "string",    "image": "string",    "port": 0,    "service_id": "string",    "source": {      "branch": "string",      "commit": "string",      "kind": "git",      "repo_url": "string"    },    "started_at": "2019-08-24T14:15:22Z",    "status": "queued",    "trigger": "create"  },  "state": "not_deployed",  "url": "string"}
DELETE/api/v1/services/{id}/env-groups/{group}

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.

group*string

Env group id or name.

Response Body

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/api/v1/services/string/env-groups/string" \  -H "Authorization: Bearer $FERRY_TOKEN"
{  "auto_deploy": true,  "branch": "string",  "build_command": "string",  "cpu_limit": 0,  "created_at": "2019-08-24T14:15:22Z",  "custom_domains": [    "string"  ],  "deploy_hook_key": "string",  "disk_mount_path": "string",  "dockerfile_path": "string",  "health_check_path": "string",  "id": "string",  "image": "string",  "instances": 0,  "live_deploy_id": "string",  "memory_limit_mb": 0,  "name": "string",  "port": 0,  "publish_dir": "string",  "repo_url": "string",  "root_dir": "string",  "runtime": "auto",  "schedule": "string",  "start_command": "string",  "suspended": true,  "type": "web_service",  "updated_at": "2019-08-24T14:15:22Z",  "deploy_hook_path": "string",  "env_groups": [    "string"  ],  "hosts": [    "string"  ],  "internal_host": "string",  "internal_port": 0,  "latest_deploy": {    "commit_message": "string",    "commit_sha": "string",    "created_at": "2019-08-24T14:15:22Z",    "error": "string",    "finished_at": "2019-08-24T14:15:22Z",    "id": "string",    "image": "string",    "port": 0,    "service_id": "string",    "source": {      "branch": "string",      "commit": "string",      "kind": "git",      "repo_url": "string"    },    "started_at": "2019-08-24T14:15:22Z",    "status": "queued",    "trigger": "create"  },  "state": "not_deployed",  "url": "string"}