Skip to content

Commit 1afc854

Browse files
author
Ives van Hoorne
committed
Update define API documentation
1 parent 21bdfd5 commit 1afc854

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/homepage/content/docs/2-importing.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ $ codesandbox ./
5858

5959
We offer an API that allows you to programatically create a sandbox. This is most often useful in documentation: code examples can generate a sandbox on the fly. You can call the endpoint `https://codesandbox.io/api/v1/sandboxes/define` both with a a `GET` and with a `POST` request.
6060

61+
### Supported Parameters
62+
63+
We currently support three extra parameters
64+
65+
| Query Parameter | Description | Example Input |
66+
| --------------- | ------------------------------------------------------------------------------------ | --------------------------- |
67+
| `parameters` | Parameters used to define how the sandbox should be created. | Example below |
68+
| `query` | The query that will be used in the redirect url. | `view=preview&runonclick=1` |
69+
| `embed` | Whether we should redirect to the embed instead of the editor. | `1` |
70+
| `json` | Instead of redirecting we will send a JSON reponse with `{"sandbox_id": sandboxId}`. | `1` |
71+
6172
### How it works
6273

6374
The API only needs one argument: `files`. This argument contains the files that will be in the sandbox, an example body would be:

0 commit comments

Comments
 (0)