Skip to content

Set guest password

POST
/api/v1/projects/{id}/access/{surface}/password
curl --request POST \
--url https://api.deploybase.eu/api/v1/api/v1/projects/example/access/preview/password \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "generate": true, "password": "example" }'

Sets the guest password for the surface. Send exactly one of generate=true (the platform creates a four-word passphrase and returns it in this response, the only time it is ever shown) or password (12 to 128 characters, at most 72 bytes, not one of the 10,000 most common passwords; never returned). A surface that is not team_guests is moved to team_guests, since the password is the guest path. Every guest signed in with an earlier password is signed out.

id
required
string

Project ID

surface
required
string
Allowed values: preview production

Surface

Generate or type a password

Media type application/json
object
generate

Generate asks the platform for a four-word passphrase, returned once in the response.

boolean

Example

true
password

Password is a typed guest password: 12 to 128 characters, at most 72 bytes, and not one of the 10,000 most common passwords. It is never returned.

string

OK

Media type application/json
object
data
meta
object
request_id
string
timestamp
string
trace_id
string
data
object
access
object
preview
object
gate_epoch

GateEpoch increments whenever every visitor session is invalidated.

integer
has_password

HasPassword is true when guests can unlock the surface with a password.

boolean
level

Level is public, team or team_guests.

string
password_set_at

PasswordSetAt is when the current guest password was set; null without one.

string
status

Status is public, protecting (gate set, cache purge not yet confirmed) or protected.

string
production
object
level
string
status
string
writes_enabled

WritesEnabled mirrors PREVIEW_ACCESS_ENABLED: false means the write routes answer 404.

boolean
password
string

Example

{
"data": {
"access": {
"preview": {
"gate_epoch": 3,
"level": "team_guests",
"status": "protected"
},
"production": {
"level": "public",
"status": "public"
}
},
"password": "correct-horse-battery-staple"
}
}

Bad Request

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string

Example generated

{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}

Unauthorized

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string

Example generated

{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}

Forbidden

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string

Example generated

{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}

Not Found

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string

Example generated

{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}

Unprocessable Entity

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string

Example generated

{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}

Internal Server Error

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string

Example generated

{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}

Live a8b7eb1d built