Update .env from application

Update the .env file contents of an application, such as an application on a worker server.


PATCH/api/servers/{server}/applications/{application}/env

Update environment file

This endpoint replaces the contents of the .env file of your application. The whole file is overwritten, so send the complete contents. Both PATCH and PUT are accepted. When the server cannot be reached, it returns a 422 and the file stays as it was.

Required parameters

  • Name
    content
    Type
    string
    Description

    The new .env file contents. Minimum: 2 characters.

Request

PATCH
/api/servers/{server}/applications/{application}/env
curl -X PATCH "https://ploi.io/api/servers/{server}/applications/{application}/env" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"content": "APP_ENV=production\nQUEUE_CONNECTION=redis..."}'

Response

{
  "message": "Environment file has been updated"
}