const url = 'https://platform.fomr.io/v1/workspaces';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","color":"zinc","icon":"home"}'};
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://platform.fomr.io/v1/workspaces \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "color": "zinc", "icon": "home" }'Creates a workspace, placed last in the sidebar, and answers 201 with the workspace resource. The name must differ from every other active workspace without regard to case; color and icon follow the app defaults when left out. Creating needs the workspaces plan feature and room under the max_workspaces plan limit, and is refused with 402 otherwise. Needs workspace_management. Costs 1 API credit.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”object
Workspace name, trimmed. It must differ from the name of every other active workspace, compared without regard to case.
Color key of the workspace icon. Left out, the first color no other workspace uses, as the app suggests, or indigo once every color is taken.
Responses
Section titled “Responses”Default Response
object
The public ID of the workspace. Use it in the other workspace calls and wherever a call takes workspace_public_id.
Workspace name shown in the app sidebar.
Whether this is the Default Workspace, which always exists, always comes first, and cannot be deleted.
Color key of the workspace icon in the app.
Example
{ "color": "zinc", "icon": "home"}Default Response
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Every value the request got wrong.
object
The path into the request, with property names and numeric array indexes.
What is wrong with the value at this path.
The stable code for the issue. Branch on it, and use it with params to write your own text.
Accepted values when a node type or enum value is rejected.
Example
{ "code": "INVALID_INPUT"}Default Response
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Example
{ "code": "INVALID_INPUT"}A Plan Error: either an exhausted plan limit or a field that needs a larger plan. Branch on code.
object
The organization is already at a limit its plan sets.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
The plan whose limit was applied.
Where to review plans and upgrade the organization.
The limit that blocked the call.
object
Which plan limit was reached.
What the plan allows.
What the organization is using right now.
object
The request sets a field the plan does not include.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
The plan whose features were applied.
Where to review plans and upgrade the organization.
The plan feature the blocked field needs, such as meta_tags or partial_response_access.
The path of the blocked field, such as properties/meta_title. On a write it points into the request body; on publish it points into the Draft Document, and it is empty when the blocker is not a document field.
Example
{ "code": "PLAN_LIMIT_REACHED", "plan": "free", "limit": { "key": "max_forms" }}Default Response
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Example
{ "code": "INVALID_INPUT"}A rejected call. The organization budget names the policy it rejected the call under; the request floor that bounds hammering sends the envelope alone.
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
The policy that rejected the call.
The plan whose numbers were applied.
The policy limit in credits.
Credits already spent in the open window.
Credits still available under the policy.
What the rejected call would have cost.
How long the policy window lasts.
When the window that rejected the call ends.
Seconds to wait before retrying. Also sent as the Retry-After response header.
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Example
{ "code": "INVALID_INPUT", "policy": "minute", "plan": "free"}Default Response
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Example
{ "code": "INVALID_INPUT"}Default Response
object
The requested operation has no available capacity. Retry after the Retry-After header says.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Seconds to wait before retrying. Also sent as the Retry-After response header.
Example
{ "code": "SERVICE_UNAVAILABLE"}