Skip to Content
SeyloDocs
API referenceEnvironment

Save a service's environment

POST
/api/v1/env.set

Replaces the service's .env text. Syntax errors are refused; context problems (for example an internal address of a service on another node) are saved and returned as diagnostics. The new values apply on the next deploy or restart.

Needs env.edit on the service (a grant on its project covers it). Available to MCP clients and the assistant.

Authorization

cookieseylo_session<token>

Request Body

application/json
  1. body
serviceId*string

Panel-issued id.

Match^[a-z0-9]{16}$
text*string

Contents of a .env file.

Lengthlength <= 262144
expectedUpdatedAt?|null

Response Body

Success.

application/json
  1. response
updatedAt*string
Formatdate-time
diagnostics*array<>
restartNeeded*boolean
Example Request
curl -X POST 'https://example.com/api/v1/env.set' \  -H 'Content-Type: application/json' \  -d '{  "serviceId": "string",  "text": "string"}'
Example Response
{  "updatedAt": "2019-08-24T14:15:22Z",  "diagnostics": [    {      "code": "invalid-line",      "severity": "error",      "message": "string",      "detail": "string",      "params": {},      "range": {        "start": 0,        "end": 0,        "startLine": 1,        "startColumn": 1,        "endLine": 1,        "endColumn": 1      },      "fixes": [        {          "kind": "edit",          "title": "string",          "edits": [            {              "range": {                "start": 0,                "end": 0,                "startLine": 1,                "startColumn": 1,                "endLine": 1,                "endColumn": 1              },              "text": "string"            }          ]        }      ]    }  ],  "restartNeeded": true}