const url = 'https://platform.fomr.io/v1/workspaces/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","color":"zinc","icon":"home","position":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://platform.fomr.io/v1/workspaces/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "color": "zinc", "icon": "home", "position": 1 }'Renames a workspace, changes its color or icon, or moves it in the sidebar with position, and answers the workspace resource. Fields left out keep their value, and a call that changes nothing writes nothing. The Default Workspace can be renamed and restyled but always stays first. Needs workspace_management. Costs 1 API credit.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The public ID of the workspace, as listWorkspaces returns it.
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. Leave the field out to keep the current name.
Color key of the workspace icon. Leave the field out to keep the current color.
Where to place the workspace in the sidebar, counted from 0 among the workspaces after the Default Workspace, as dragging it in the app does. A position past the end places it last. The Default Workspace always stays first and cannot be moved.
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"}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
Returned for a workspace that does not exist, was deleted, or belongs to another organization. The three are not told apart.
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": "NOT_FOUND"}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"}