Skip to main content
POST
/
projects
/
{projectId}
/
environments
/
{environmentId}
/
initialize
Initialize a new environment
curl --request POST \
  --url {schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/initialize \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "profile": "<string>",
  "repository": "<string>",
  "config": "<string>",
  "files": [
    {
      "path": "<string>",
      "mode": 123,
      "contents": "<string>"
    }
  ],
  "resources": {
    "init": "default"
  }
}
'
{
  "status": "<string>",
  "code": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

projectId
string
required
environmentId
string
required

Body

application/json
profile
string
required

Name of the profile to show in the UI

repository
string
required

Repository to clone from

config
string | null

Repository to clone the configuration files from

files
Files · object[]

A list of files to add to the repository during initialization

resources
Resources · object

Response

default - application/json
status
string
required

The status text of the response

code
integer
required

The status code of the response

Last modified on March 25, 2026