Add a space to the project, empty or wrapped up from another one. Nothing is switched and nobody is moved.
/docs/api/spaces-add.txtPOST https://api.pixydesignapp.com/spaces/add
Add a space, one of the project's branches. Empty, or wrapped up from another: a copy of that space's edits and its board as they stand right now, after which the two go their own way.
The new space is left for the user to open. Nothing switches, and an editor already on the page stays where it is, because a key has no socket to stand anywhere.
Header: X-Pixy-Key carrying the agent key (px_sk_…).
Body:
| field | type | required | description |
|---|---|---|---|
name |
string | yes | What the list shows. Trimmed to 80 characters. |
from |
string | no | A space to wrap up. Its live edits are copied under new ids, its board along. Without it the space starts empty. |
Response:
| field | type | description |
|---|---|---|
id |
string | The new space's id. |
name |
string | Its name, as stored. |
copied |
number | How many records the copy carried. 0 without a from. |
spaces |
array | The project's whole list, oldest first, in the shape /spaces sets out. |
Errors:
| error | when |
|---|---|
invalid_key |
The key is not one of the project's, or was retired. |
invalid_name |
name is empty. |
no_space |
from names nothing this project owns. |
Examples:
curl -X POST https://api.pixydesignapp.com/spaces/add \
-H 'X-Pixy-Key: px_sk_yourkey' \
-H 'Content-Type: application/json' \
-d '{"name": "Pricing, three columns"}'
A copy of a space to try something on:
curl -X POST https://api.pixydesignapp.com/spaces/add \
-H 'X-Pixy-Key: px_sk_yourkey' \
-H 'Content-Type: application/json' \
-d '{
"name": "Pricing, three columns",
"from": "0f6a9c31-5d2b-4a77-9c10-8e4b2f5d1a63"
}'