DOC
/docs
Environment endpoints
GET
/admin/applications/:applicationId/environments
List environments

Lists all environments and hostnames for the application.

Request

X-Tenant-ID: tenant-uuid
Authorization: Bearer <admin-jwt>

Response

{
  "environments": [
    {
      "id": 1,
      "name": "Development",
      "isDevelopment": true,
      "hosts": []
    }
  ]
}
POST
/admin/applications/:applicationId/environments
Create environment

Creates an environment. Only one development environment is allowed per application.

Request

X-Tenant-ID: tenant-uuid
Authorization: Bearer &lt;admin-jwt&gt;

{ "name": "Staging", "description": "Pre-production", "isDevelopment": false }

Response

{
  "environment": {
    "id": 3,
    "name": "Staging",
    "description": "Pre-production",
    "isDevelopment": false,
    "hosts": []
  }
}
GET
/admin/applications/:applicationId/environments/:environmentId
Get environment

Returns one environment and its hostnames.

Request

X-Tenant-ID: tenant-uuid
Authorization: Bearer <admin-jwt>

Response

{
  "environment": {
    "id": 3,
    "name": "Staging",
    "hosts": [
      {
        "id": 9,
        "hostname": "staging.example.com"
      }
    ]
  }
}
PATCH
/admin/applications/:applicationId/environments/:environmentId
Update environment

Updates environment name or description.

Request

X-Tenant-ID: tenant-uuid
Authorization: Bearer &lt;admin-jwt&gt;

{ "description": "QA environment" }

Response

{
  "environment": {
    "id": 3,
    "name": "Staging",
    "description": "QA environment"
  }
}
DELETE
/admin/applications/:applicationId/environments/:environmentId
Delete environment

Deletes a non-development environment and its related config/rules.

Request

X-Tenant-ID: tenant-uuid
Authorization: Bearer <admin-jwt>

Response

204 No Content
POST
/admin/applications/:applicationId/environments/:environmentId/hosts
Add hostname

Adds a normalized hostname for runtime environment resolution.

Request

X-Tenant-ID: tenant-uuid
Authorization: Bearer &lt;admin-jwt&gt;

{ "hostname": "https://staging.example.com/app" }

Response

{
  "host": {
    "id": 9,
    "hostname": "staging.example.com"
  }
}
DELETE
/admin/applications/:applicationId/environments/:environmentId/hosts/:hostId
Remove hostname

Removes one hostname from an environment.

Request

X-Tenant-ID: tenant-uuid
Authorization: Bearer <admin-jwt>

Response

204 No Content