Skip to main content
PATCH
Requires version 2.0.1 or later of the Archetype platform.

Overview

This endpoint changes the session settings of a serving deployment and returns the deployment. Only a ready serving deployment takes a change. Each field of sessions you send replaces the deployment’s current value. Each one you leave out, or send as null, keeps it. Leaving out sessions, or sending null or {}, changes nothing and returns the deployment as it is.

Request

string
required
Deployment dpl_ id.
object
New limits for the deployment’s sessions. A field this object does not have is refused with 400.
integer
The most sessions the deployment holds open at once, per running copy of the deployment. Minimum 1, maximum 1000. Lowering it closes no open session; it only refuses new ones.
integer
Seconds a session can sit unused, counted from its last use, before the deployment closes it. Maximum 86400. 0 means never, which is refused with 400 where the platform stops idle deployments.

Response

Returns 200 OK with the deployment, with the same fields as Get Deployment returns. Its sessions gives the stored settings.

Important Notes

  • A 400 means the body does not parse, names a field this endpoint does not have, or gives a value that is not a whole number (invalid_request_body); a value is outside its limits (out_of_range); or the deployment is not serving, or idle_timeout_secs is 0 where idle deployments are stopped (bad_request). A value the deployment already has is kept as it is, not checked again.
  • A 403 means you can see the deployment’s project but cannot modify it.
  • A 404 means the deployment does not exist, belongs to another organization, or is in a project you cannot see.
  • A 409 with the code conflict means the deployment is not ready. The message says whether to wait for it or that it has ended. Nothing is stored.
  • A 409 with the code deployment_sessions_unsupported means the deployment cannot take session settings. Deploy the package again to get one that can. Nothing is stored.
  • A 503 with the code unavailable means the settings could not be stored. The same request is safe to retry.