Open a business as one of its people
POST
/console/businesses/{id}/view-as
const url = 'https://example.com/console/businesses/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/view-as';const options = { method: 'POST', headers: { cookie: 'bottle.session_token=<bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"userId":"example","reason":"example","override":true}'};
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://example.com/console/businesses/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/view-as \ --header 'Content-Type: application/json' \ --cookie bottle.session_token=<bottle.session_token> \ --data '{ "userId": "example", "reason": "example", "override": true }'A real session for that person, marked with who is behind it, good for an hour at most. Refused unless the business has let support in: view allows only reading, act allows changes. With override, a console owner opens it without a grant, with the right to change things, giving a reason; the reason and who gave it go into the record for internal review, and the business is not told. The browser is signed in as that person by the cookie in the answer; an assistant sends the token as a bearer. Everything done in the session is recorded.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
UUID v7
string format: uuid
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fUUID v7
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
userId
required
string
reason
string
override
boolean
Examplegenerated
{ "userId": "example", "reason": "example", "override": true}Responses
Section titled “Responses”Opened
Media typeapplication/json
object
token
required
string
expiresAt
required
string format: date-time
level
required
string
userId
required
string
userName
required
string
tenantId
required
UUID v7
string format: uuid
Example
{ "level": "view", "tenantId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f"}Not signed in
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Not Bottle staff, no two-step sign-in, or a console role too low for this
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Not found
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
Media typeapplication/json
object
error
required
string
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}