Skip to main content

Manage Workspaces

As described in TANGO Workspaces, workspaces are the main organizational unit in TANGO.

Every TANGO Model is assigned to a single workspace, and each workspace has its own set of users and permissions.

If you are a workspace owner or administrator, you can manage the workspace and its users through the TANGO API.

You can see all the possible operations to manage workspaces in the TANGO Auth API documentation.

note

It is suggested to use the TANGO Dashboard hosted at this link to perform these operations, as it provides a user-friendly interface for managing tokens.

Workspace API Operations

Only staff users can perform these operations.

List Available Workspaces

GET /api/auth/workspace/

Retrieves a list of all workspaces that the authenticated user has access to.

  • Requires bearer token authentication (bearerAuth).

Response Format

If successful, it returns an array of WorkspaceItemPayload objects.

NameTypeDescription
idintegerThe unique ID of the workspace.
namestringThe human-readable name of the workspace.
disabledbooleanTrue if the workspace is currently disabled.
created_by_idintegerThe ID of the user who created the workspace.
created_atstringThe timestamp of when the workspace was created.
updated_atstringThe timestamp of when the workspace was last updated.

Example Response

[
{
"id": 1,
"name": "default-workspace",
"disabled": false,
"created_by_id": 1,
"created_at": "2025-01-16T10:09:27.934468Z",
"updated_at": "2025-01-16T10:09:27.934477Z"
}
]

Create a Workspace

POST /api/auth/workspace/

Creates a new workspace.

  • Requires bearer token authentication (bearerAuth).

Request Body

The body must contain the name of the new workspace.

NameTypeRequiredDescription
namestringYesThe name for the new workspace. Must be unique and contain only lowercase letters, numbers, hyphens, and underscores.
disabledbooleanNoSet to true to create the workspace in a disabled state. Defaults to false.

Example Request Body

{
"name": "new-project-workspace",
"disabled": false
}

Response Format

If successful, it returns the newly created WorkspaceItemPayload object.

{
"id": 2,
"name": "new-project-workspace",
"disabled": false,
"created_by_id": 1,
"created_at": "2025-07-15T09:45:00.000000Z",
"updated_at": "2025-07-15T09:45:00.000000Z"
}

Get a Specific Workspace

GET /api/auth/workspace/{workspaceId}

Retrieves the details of a single workspace by its ID.

  • Requires bearer token authentication (bearerAuth).

Path Parameters

NameTypeRequiredDescriptionExample
workspaceIdstringYesThe ID of the workspace to retrieve.1

Response Format

If successful, it returns the requested WorkspaceItemPayload object.

{
"id": 1,
"name": "default-workspace",
"disabled": false,
"created_by_id": 1,
"created_at": "2025-01-16T10:09:27.934468Z",
"updated_at": "2025-01-16T10:09:27.934477Z"
}

Update a Workspace

PUT /api/auth/workspace/{workspaceId}

Updates the properties of an existing workspace. This endpoint is primarily used to disable or re-enable a workspace.

  • Requires bearer token authentication (bearerAuth).

Path Parameters

NameTypeRequiredDescriptionExample
workspaceIdstringYesThe ID of the workspace to update.1

Request Body

The request body must include the disabled status. The name cannot be changed.

NameTypeRequiredDescription
disabledbooleanYesSet to true to disable the workspace, or false to enable it.

Example Request Body

{
"disabled": true
}

Response Format

If successful, returns a 202 Accepted status with the updated WorkspaceItemPayload object.

Delete a Workspace

DELETE /api/auth/workspace/{workspaceId}

Permanently deletes a specific workspace. This action is irreversible.

  • Requires bearer token authentication (bearerAuth).

Path Parameters

NameTypeRequiredDescriptionExample
workspaceIdstringYesThe ID of the workspace to delete.2

Response Format

A successful 204 No Content response will be returned with a confirmation message in the body.

{
"message": "The workspace has been deleted",
"message_code": "ok"
}

These endpoints allow for uploading and retrieving a custom logo for a workspace.

Uploads and sets a new logo for a specific workspace.

  • Requires bearer token authentication (bearerAuth).

Path Parameters

NameTypeRequiredDescriptionExample
workspaceIdstringYesThe ID of the workspace.1

Request Body

The request must be sent with a Content-Type of multipart/form-data and include a file field named logo.

Response Format

A successful 202 Accepted response will be returned with a confirmation message.

{
"message": "File uploaded successfully",
"message_code": "ok"
}

Downloads the logo image file for a specific workspace.

  • Requires bearer token authentication (bearerAuth).

Path Parameters

NameTypeRequiredDescriptionExample
workspaceIdstringYesThe ID of the workspace.1

Response Format

A successful 200 OK response returns the logo file as a binary stream (application/octet-stream).