Set guest password
const url = 'https://api.deploybase.eu/api/v1/api/v1/projects/example/access/preview/password';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"generate":true,"password":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Project ID
Surface
Request Body
Section titled “ Request Body ”Generate or type a password
object
Generate asks the platform for a four-word passphrase, returned once in the response.
Example
truePassword 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.
Responses
Section titled “ Responses ”OK
object
object
object
object
object
GateEpoch increments whenever every visitor session is invalidated.
HasPassword is true when guests can unlock the surface with a password.
Level is public, team or team_guests.
PasswordSetAt is when the current guest password was set; null without one.
Status is public, protecting (gate set, cache purge not yet confirmed) or protected.
object
WritesEnabled mirrors PREVIEW_ACCESS_ENABLED: false means the write routes answer 404.
Example
{ "data": { "access": { "preview": { "gate_epoch": 3, "level": "team_guests", "status": "protected" }, "production": { "level": "public", "status": "public" } }, "password": "correct-horse-battery-staple" }}Bad Request
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Unauthorized
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Forbidden
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Not Found
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Unprocessable Entity
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Internal Server Error
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Live a8b7eb1d built