Skip to content

Open another sandbox with its code

POST
/api/demo/sandbox-code
curl --request POST \
--url https://forge.example.com/api/demo/sandbox-code \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "code": "example" }'

Takes a sandbox’s code, with or without its dashes, spaces and the word ANVIL, in either case. Answers a session for that sandbox’s visitor, as signing in does, with the refresh token cookie and the cookie that finds the sandbox again from this browser; the session the caller came with ends, and the sandbox they leave is deleted soon after when it holds no model and no draft and is open in no other browser. A code the demo does not know answers 400 naming code, and the code of the sandbox the caller is in answers 409. Too many tries from one address in a minute, or too many wrong codes, answer 429 with code: demo_rate_limited; a sandbox already open in as many browsers as it may be answers 429 with code: demo_quota. Answers 404 to anyone who is not a demo visitor.

Media typeapplication/json
object
code
null | string

Example generated

{
"code": "example"
}

OK

Media typeapplication/json
object
accessToken
required
string
expiresIn
required
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
user
required
object
id
required
string format: uuid
email
required
string
displayName
required
string
roles
required
Array<string>
organization
required
object
id
required
string format: uuid
name
required
string
slug
required
string
trial
One of:
null
secondStepNeeded
boolean
serviceAccount
boolean
demo
One of:
null

Example

{
"user": {
"secondStepNeeded": false
}
}

A refusal or an error, as a problem document. A model or draft you may not see answers 404, as one that does not exist.

Media typeapplication/problem+json
object
type
string
title
string
status
integer
detail
string
instance
string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}