# Workspace / Organizations

Shipped comes with support for Workspace / Organizations.

They are collections of users that you can use to let the users organize their teams.

For instance, if they are all part of the same company, i.e. "Acme Inc.", you can allow them to create an organization and invite other users to it, with specific roles (Owner, Admin, Member, Guest).

## Create a workspace / organization

Use the component `<CreateWorkspaceModal />`.

It is a modal with an input field.

The route POST `/api/workspace` handles the workspace creation.

<figure><img src="/files/beWKpmo6p8P3dJkapdUG" alt=""><figcaption><p>Create workspace modal</p></figcaption></figure>

## Add a workspace / organization member

Use the component `<AddWorkspaceMember />`.

It is a modal with email and role.

<figure><img src="/files/jG0O7mxzOpM9f02MU33N" alt=""><figcaption><p>Add member to workspace / organization</p></figcaption></figure>

The route POST `/api/workspace/invite` handles the workspace invitation.

It sends an email to the target email.

If the user doesn't have an account (never signed up) it is added to the table WorkspacePendingInvitation, otherwise to the table WorkspaceUsers.\
\
If a user is pending an invitation, when he or she signs up, the user is automatically moved from the WorkspacePendingInvitation table to the WorkspaceUsers one.

## Additional routes

`GET /api/workspace/[id]/invitations` — Get invitations to a workspace\
`DELETE /api/workspace/[id]/invitations` — Delete invitation to a workspace\
`GET /api/workspace/[id]/members` — Get members of a workspace\
`DELETE /api/workspace/[id]/members` — Delete member of a workspace\
`PUT /api/user/role` — Update the role of a member

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.shipped.club/features/workspace-organizations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
