Deployments API

Create, update, and manage your deployments using the Nexlayer API.

POST/startUserDeployment

Start User Deployment

Start a new deployment by uploading a nexlayer.yaml configuration file. This endpoint returns a session token that you'll use for all subsequent API calls.

Parameters

NameTypeRequiredDescription
sessionTokenqueryOptionalOptional existing session token
bodyYAMLRequiredValid nexlayer.yaml configuration

Example Request

curl -X POST "https://app.nexlayer.io/startUserDeployment" \
  -H "Content-Type: text/x-yaml" \
  --data-binary @nexlayer.yaml

Response (200 OK)

{
  "message": "Deployment started successfully",
  "url": "https://jolly-tapir-complete-test-app.alpha.nexlayer.ai",
  "sessionToken": "dCf0NdAQ64j6",
  "applicationName": "Complete-Test-App",
  "environment": "jolly-tapir",
  "status": {
    "state": "deploying",
    "progress": 0
  },
  "extend": {
    "available": true,
    "expiresAt": "2024-01-15T12:00:00Z"
  },
  "claim": {
    "claimed": false
  }
}
POST/updateUserDeployment

Update User Deployment

Update an existing deployment with a new configuration. Requires a valid session token.

Parameters

NameTypeRequiredDescription
sessionTokenqueryRequiredYour session token
bodyYAMLRequiredUpdated nexlayer.yaml configuration

Example Request

curl -X POST "https://app.nexlayer.io/updateUserDeployment?sessionToken=dCf0NdAQ64j6" \
  -H "Content-Type: text/x-yaml" \
  --data-binary @nexlayer.yaml
POST/extendDeployment

Extend Deployment

Extend the lifetime of a deployment. Free deployments have limited extensions available.

Request Body

{
  "applicationName": "Complete-Test-App",
  "sessionToken": "dCf0NdAQ64j6"
}

Example Request

curl -X POST "https://app.nexlayer.io/extendDeployment" \
  -H "Content-Type: application/json" \
  -d '{"applicationName":"Complete-Test-App","sessionToken":"dCf0NdAQ64j6"}'

Response (200 OK)

"Application Complete-Test-App has been extended. Environment will expire in 150 minutes. 0 extension(s) remaining."

Error Response (400)

{
  "error": "Application not found"
}
POST/claimDeployment

Claim Deployment

Claim a deployment to make it permanent. Returns a URL to complete the claim process.

Request Body

{
  "applicationName": "Complete-Test-App",
  "sessionToken": "dCf0NdAQ64j6"
}

Example Request

curl -X POST "https://app.nexlayer.io/claimDeployment" \
  -H "Content-Type: application/json" \
  -d '{"applicationName":"Complete-Test-App","sessionToken":"dCf0NdAQ64j6"}'

Response (200 OK)

{
  "message": "You're almost there! Visit the claim URL to finalize your deployment.",
  "claimUrl": "https://app.nexlayer.io/claim/dCf0NdAQ64j6",
  "claimToken": "dCf0NdAQ64j6"
}
GET/getReservations

Get All Reservations

Get all deployment reservations for a session token.

Parameters

NameTypeRequiredDescription
sessionTokenqueryRequiredYour session token

Example Request

curl -X GET "https://app.nexlayer.io/getReservations?sessionToken=dCf0NdAQ64j6"

Response (200 OK)

{
  "reservedDeployments": [
    {
      "applicationName": "my-app",
      "environment": "jolly-tapir",
      "url": "https://jolly-tapir-my-app.alpha.nexlayer.ai",
      "status": {
        "state": "running"
      },
      "createdAt": "2024-01-15T10:00:00Z",
      "expiresAt": "2024-01-15T12:30:00Z"
    }
  ]
}
POST/addDeploymentReservation

Add Deployment Reservation

Add a deployment reservation. Requires the Scale or Conquer plan.

Request Body

{
  "applicationName": "Complete-Test-App",
  "sessionToken": "dCf0NdAQ64j6"
}

Response (200 OK)

{
  "message": "Application Complete-Test-App reservation has been added."
}

Error Response (500)

{
  "error": "User is not on the Scale or Conquer plan. Please upgrade your plan to add a reservation."
}
POST/removeDeploymentReservation

Remove Deployment Reservation

Remove a specific deployment reservation.

Request Body

{
  "applicationName": "Complete-Test-App",
  "sessionToken": "dCf0NdAQ64j6"
}

Response (200 OK)

{
  "message": "Application Complete-Test-App reservation has been removed. Application site will be removed within the next 10 minutes."
}
POST/removeReservations

Remove All Reservations

Remove all deployment reservations for a session token.

Request Body

{
  "sessionToken": "dCf0NdAQ64j6"
}

Response (200 OK)

"Application reservations have been removed. If deployments have reached their time limits, application sites will be removed within 10 minutes."