---
id: remove-user-from-workspace
title: "Remove User From Workspace"
description: "Remove a user from a workspace."
sidebar_label: "Remove User From Workspace"
hide_title: true
hide_table_of_contents: true
api: eJztVm1v2zYQ/iuEPrWoIztO0A76tKx2UaPtGrjO+iExDEY622wkUiOprp6h/747Um92YqfI2g8DBgSITD733Psdt0ECJtYit0LJIAqmkKmvwDgrDGi21CrD77+UvjM5jyG8kTfykmuegQVtoht5wnK+SRVP2LMrlJiqFJ5HbLaG5jxW0nIhhVwxi8eOFzIuUsZlwpRecSn+5qSeTUYhMTbqFgJpjdUV42TE1NKRdA06YRr+LMBY9mzqPyr4G27sxeWkuVa3XyC2zoUp2EJLb//nmmsKJlfSgJcu8oRbSPZ8n3JhwMu9nc0ux99icJGL2GTZupcoMEwqy9YcY5mDzoQx5KBV9GupdIZgYRiPSTg8SKeBEUoy0Fohb6HrMGrKE09ZrlUMxoRBL1BI7eI4STCRDgALsmdBaVw0jiA0b1IYRNfbQOIPFOnGHUGC6iHndo3fFEOhAYmtLqAXmHiNOQyibWA3OcliltA0RFphUzpowsrQnLLsNVow4x1+TI3ePEnBR73ap3Zl9e+Zx46mLOck7GvCEH44GNC/3Yb5VMSUgGWRsrqAkIqKHqQlOM/zVMQuMf0vhmS2HRswf5g2K7yGWAMV3YLbY/a99ih2YfEwgSUvUsSjecPzk9PTk+GADV5F+Hd2Gr58ef5qePZiMIjQ9rIXVFX9iIKrqva/T8EvZx0FmNkjxJSvXpWtw6jf6b7s7QYaAyk3H5euXncFqQCqE1mkmLh5SzXqUCCjhz2NakbnyNGdWI/UZ4tDuQyyW9dwD6jnWvPNUe0fKumy8SLw82ynwq8D11kuwBVuz+D5Ax3a1G1ZEv35cHi/zP/gqUj8lB7TLHp6jSdgqb3wS1jIzH1AquKd2+9IlkBLVqAxYm14fExbd9+ruM2FWR1L3QdsaL6CbsUcnBVuMPvaeCQ15JdXXeE6uWjD66N72I2RD99DymoIrZJ7hD63OPTXitZDAinOf7cKcMBHQb8Z/qa/7S6Csk8rxCAS/32tN0ahMYPB2trcRP1+nKoiCTFiuOlDLvo8F8Fe+wYX7pa9JqirbAMxrjO7cXy4p9/B5i3wBLMYXc+7gE9USL40dmFt++QCj+vCR10Feqnrkq/2wdpLURSEXConXgWssu03Ht+BpAYiP73Zg/A0HBxyphJgaFbVD7jQibi2w8HwajdcTaDwxq+sKLDAs1/bC7IyV8ZmXHb4qscZPbTYG3qafe7s9L1p2XTn/0+6/+6TrqpvC99sP08x5G6Hazc9feNet6826tFo7w3nexebaY3FROjt9pYbuNJpWdKxfyRRBybC8NuUJtWSpwaO1JPLCQ215+yQiXfYjZ2XHnpVEMiN7J+gqH73tXrm9EMLUvTjvaunjtx0ddbG7GTALaR1Pda2FeQipqLoCN/bn+RAM6tH4/fj2Rhnwj/DUKzf
sidebar_class_name: "delete api-method"
info_path: reference/api/agenta-backend
custom_edit_url: null
---

import ApiTabs from "@theme/ApiTabs";
import DiscriminatorTabs from "@theme/DiscriminatorTabs";
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes";
import MimeTabs from "@theme/MimeTabs";
import ParamsItem from "@theme/ParamsItem";
import ResponseSamples from "@theme/ResponseSamples";
import SchemaItem from "@theme/SchemaItem";
import SchemaTabs from "@theme/SchemaTabs";
import Markdown from "@theme/Markdown";
import Heading from "@theme/Heading";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Remove User From Workspace"}
>
</Heading>

<MethodEndpoint
  method={"delete"}
  path={"/workspaces/{workspace_id}/users"}
>
  
</MethodEndpoint>



Remove a user from a workspace.

Parameters:
- payload (UserRole): The payload containing the user email and organization ID.
- workspace_id (str): The ID of the workspace.
- request (Request): The FastAPI request object.

Returns:
- WorkspaceResponse: The updated workspace.

Raises:
- HTTPException: If the user does not have permission to perform this action.
- HTTPException: If there is an error during the removal process.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<details
  style={{"marginBottom":"1rem"}}
  className={"openapi-markdown__details"}
  data-collapsed={false}
  open={true}
>
  <summary
    style={{}}
  >
    <h3
      className={"openapi-markdown__details-summary-header-params"}
    >
      Path Parameters
    </h3>
  </summary><div>
    <ul>
      <ParamsItem
        className={"paramsItem"}
        param={{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}}
      >
        
      </ParamsItem>
    </ul>
  </div>
</details><details
  style={{"marginBottom":"1rem"}}
  className={"openapi-markdown__details"}
  data-collapsed={false}
  open={true}
>
  <summary
    style={{}}
  >
    <h3
      className={"openapi-markdown__details-summary-header-params"}
    >
      Query Parameters
    </h3>
  </summary><div>
    <ul>
      <ParamsItem
        className={"paramsItem"}
        param={{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}}}
      >
        
      </ParamsItem><ParamsItem
        className={"paramsItem"}
        param={{"name":"email","in":"query","required":true,"schema":{"type":"string","title":"Email"}}}
      >
        
      </ParamsItem>
    </ul>
  </div>
</details><div>
  <div>
    <ApiTabs
      label={undefined}
      id={undefined}
    >
      <TabItem
        label={"200"}
        value={"200"}
      >
        <div>
          
          
          Successful Response
          
          
        </div><div>
          <MimeTabs
            className={"openapi-tabs__mime"}
            schemaType={"response"}
          >
            <TabItem
              label={"application/json"}
              value={"application/json"}
            >
              <SchemaTabs
                className={"openapi-tabs__schema"}
              >
                <TabItem
                  label={"Schema"}
                  value={"Schema"}
                >
                  <details
                    style={{}}
                    className={"openapi-markdown__details response"}
                    data-collapsed={false}
                    open={true}
                  >
                    <summary
                      style={{}}
                      className={"openapi-markdown__details-summary-response"}
                    >
                      <strong>
                        Schema
                      </strong>
                    </summary><div
                      style={{"textAlign":"left","marginLeft":"1rem"}}
                    >
                      
                    </div><ul
                      style={{"marginLeft":"1rem"}}
                    >
                      <SchemaItem
                        collapsible={false}
                        name={"created_at"}
                        required={false}
                        schemaName={"Created At (string)"}
                        qualifierMessage={undefined}
                        schema={{"type":"string","title":"Created At","default":"2024-11-20 07:07:31.664723+00:00"}}
                      >
                        
                      </SchemaItem><SchemaItem
                        collapsible={false}
                        name={"updated_at"}
                        required={false}
                        schemaName={"Updated At (string)"}
                        qualifierMessage={undefined}
                        schema={{"type":"string","title":"Updated At","default":"2024-11-20 07:07:31.664833+00:00"}}
                      >
                        
                      </SchemaItem><SchemaItem
                        collapsible={false}
                        name={"id"}
                        required={true}
                        schemaName={"Id (string)"}
                        qualifierMessage={undefined}
                        schema={{"type":"string","title":"Id"}}
                      >
                        
                      </SchemaItem><SchemaItem
                        collapsible={false}
                        name={"name"}
                        required={true}
                        schemaName={"Name (string)"}
                        qualifierMessage={undefined}
                        schema={{"type":"string","title":"Name"}}
                      >
                        
                      </SchemaItem><SchemaItem
                        collapsible={true}
                        className={"schemaItem"}
                      >
                        <details
                          style={{}}
                          className={"openapi-markdown__details"}
                        >
                          <summary
                            style={{}}
                          >
                            <strong>
                              description
                            </strong><span
                              style={{"opacity":"0.6"}}
                            >
                               object
                            </span>
                          </summary><div
                            style={{"marginLeft":"1rem"}}
                          >
                            
                          </div><div>
                            <span
                              className={"badge badge--info"}
                            >
                              anyOf
                            </span><SchemaTabs>
                              <TabItem
                                label={"MOD1"}
                                value={"0-item-properties"}
                              >
                                <div
                                  style={{"marginTop":".5rem","marginBottom":".5rem"}}
                                >
                                  
                                  
                                  string
                                  
                                  
                                </div>
                              </TabItem>
                            </SchemaTabs>
                          </div>
                        </details>
                      </SchemaItem><SchemaItem
                        collapsible={true}
                        className={"schemaItem"}
                      >
                        <details
                          style={{}}
                          className={"openapi-markdown__details"}
                        >
                          <summary
                            style={{}}
                          >
                            <strong>
                              type
                            </strong><span
                              style={{"opacity":"0.6"}}
                            >
                               object
                            </span><strong
                              style={{"fontSize":"var(--ifm-code-font-size)","color":"var(--openapi-required)"}}
                            >
                               required
                            </strong>
                          </summary><div
                            style={{"marginLeft":"1rem"}}
                          >
                            
                          </div><div>
                            <span
                              className={"badge badge--info"}
                            >
                              anyOf
                            </span><SchemaTabs>
                              <TabItem
                                label={"MOD1"}
                                value={"0-item-properties"}
                              >
                                <div
                                  style={{"marginTop":".5rem","marginBottom":".5rem"}}
                                >
                                  
                                  
                                  string
                                  
                                  
                                </div>
                              </TabItem>
                            </SchemaTabs>
                          </div>
                        </details>
                      </SchemaItem><SchemaItem
                        collapsible={false}
                        name={"organization"}
                        required={true}
                        schemaName={"Organization (string)"}
                        qualifierMessage={undefined}
                        schema={{"type":"string","title":"Organization"}}
                      >
                        
                      </SchemaItem><SchemaItem
                        collapsible={true}
                        className={"schemaItem"}
                      >
                        <details
                          style={{}}
                          className={"openapi-markdown__details"}
                        >
                          <summary
                            style={{}}
                          >
                            <strong>
                              members
                            </strong><span
                              style={{"opacity":"0.6"}}
                            >
                               object
                            </span>
                          </summary><div
                            style={{"marginLeft":"1rem"}}
                          >
                            
                          </div><div>
                            <span
                              className={"badge badge--info"}
                            >
                              anyOf
                            </span><SchemaTabs>
                              <TabItem
                                label={"MOD1"}
                                value={"0-item-properties"}
                              >
                                <li>
                                  <div
                                    style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}
                                  >
                                    Array [
                                  </div>
                                </li><SchemaItem
                                  collapsible={false}
                                  name={"user"}
                                  required={true}
                                  schemaName={"object"}
                                  qualifierMessage={undefined}
                                  schema={{"type":"object","title":"User"}}
                                >
                                  
                                </SchemaItem><SchemaItem
                                  collapsible={true}
                                  className={"schemaItem"}
                                >
                                  <details
                                    style={{}}
                                    className={"openapi-markdown__details"}
                                  >
                                    <summary
                                      style={{}}
                                    >
                                      <span
                                        className={"openapi-schema__container"}
                                      >
                                        <strong
                                          className={"openapi-schema__property"}
                                        >
                                          roles
                                        </strong><span
                                          className={"openapi-schema__name"}
                                        >
                                           object[]
                                        </span><span
                                          className={"openapi-schema__divider"}
                                        >
                                          
                                        </span><span
                                          className={"openapi-schema__required"}
                                        >
                                          required
                                        </span>
                                      </span>
                                    </summary><div
                                      style={{"marginLeft":"1rem"}}
                                    >
                                      <li>
                                        <div
                                          style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}
                                        >
                                          Array [
                                        </div>
                                      </li><SchemaItem
                                        collapsible={false}
                                        name={"role_name"}
                                        required={true}
                                        schemaName={"WorkspaceRole (string)"}
                                        qualifierMessage={"**Possible values:** [`owner`, `viewer`, `editor`, `evaluator`, `workspace_admin`, `deployment_manager`]"}
                                        schema={{"type":"string","enum":["owner","viewer","editor","evaluator","workspace_admin","deployment_manager"],"title":"WorkspaceRole"}}
                                      >
                                        
                                      </SchemaItem><SchemaItem
                                        collapsible={true}
                                        className={"schemaItem"}
                                      >
                                        <details
                                          style={{}}
                                          className={"openapi-markdown__details"}
                                        >
                                          <summary
                                            style={{}}
                                          >
                                            <strong>
                                              role_description
                                            </strong><span
                                              style={{"opacity":"0.6"}}
                                            >
                                               object
                                            </span>
                                          </summary><div
                                            style={{"marginLeft":"1rem"}}
                                          >
                                            
                                          </div><div>
                                            <span
                                              className={"badge badge--info"}
                                            >
                                              anyOf
                                            </span><SchemaTabs>
                                              <TabItem
                                                label={"MOD1"}
                                                value={"0-item-properties"}
                                              >
                                                <div
                                                  style={{"marginTop":".5rem","marginBottom":".5rem"}}
                                                >
                                                  
                                                  
                                                  string
                                                  
                                                  
                                                </div>
                                              </TabItem>
                                            </SchemaTabs>
                                          </div>
                                        </details>
                                      </SchemaItem><SchemaItem
                                        collapsible={true}
                                        className={"schemaItem"}
                                      >
                                        <details
                                          style={{}}
                                          className={"openapi-markdown__details"}
                                        >
                                          <summary
                                            style={{}}
                                          >
                                            <strong>
                                              permissions
                                            </strong><span
                                              style={{"opacity":"0.6"}}
                                            >
                                               object
                                            </span>
                                          </summary><div
                                            style={{"marginLeft":"1rem"}}
                                          >
                                            
                                          </div><div>
                                            <span
                                              className={"badge badge--info"}
                                            >
                                              anyOf
                                            </span><SchemaTabs>
                                              <TabItem
                                                label={"MOD1"}
                                                value={"0-item-properties"}
                                              >
                                                <li>
                                                  <div
                                                    style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}
                                                  >
                                                    Array [
                                                  </div>
                                                </li><div
                                                  style={{"marginTop":".5rem","marginBottom":".5rem"}}
                                                >
                                                  
                                                  
                                                  string
                                                  
                                                  <div
                                                    style={{"paddingTop":"1rem"}}
                                                  >
                                                    
                                                    
                                                    **Possible values:** [`read_system`, `view_application`, `edit_application`, `create_application`, `delete_application`, `create_app_variant`, `delete_app_variant`, `modify_variant_configurations`, `delete_application_variant`, `view_app_environment_deployment`, `edit_app_environment_deployment`, `create_app_environment_deployment`, `view_testset`, `edit_testset`, `create_testset`, `delete_testset`, `view_evaluation`, `run_evaluations`, `edit_evaluation`, `create_evaluation`, `delete_evaluation`, `deploy_application`, `view_workspace`, `edit_workspace`, `create_workspace`, `delete_workspace`, `modify_user_roles`, `add_new_user_to_workspace`, `edit_organization`, `delete_organization`, `add_new_user_to_organization`]
                                                    
                                                    
                                                  </div>
                                                </div><li>
                                                  <div
                                                    style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}
                                                  >
                                                    ]
                                                  </div>
                                                </li>
                                              </TabItem>
                                            </SchemaTabs>
                                          </div>
                                        </details>
                                      </SchemaItem><li>
                                        <div
                                          style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}
                                        >
                                          ]
                                        </div>
                                      </li>
                                    </div>
                                  </details>
                                </SchemaItem><li>
                                  <div
                                    style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}
                                  >
                                    ]
                                  </div>
                                </li>
                              </TabItem>
                            </SchemaTabs>
                          </div>
                        </details>
                      </SchemaItem>
                    </ul>
                  </details>
                </TabItem><TabItem
                  label={"Example (from schema)"}
                  value={"Example (from schema)"}
                >
                  <ResponseSamples
                    responseExample={"{\n  \"created_at\": \"2024-11-20 07:07:31.664723+00:00\",\n  \"updated_at\": \"2024-11-20 07:07:31.664833+00:00\",\n  \"id\": \"string\",\n  \"name\": \"string\",\n  \"description\": \"string\",\n  \"type\": \"string\",\n  \"organization\": \"string\",\n  \"members\": [\n    null\n  ]\n}"}
                    language={"json"}
                  >
                    
                  </ResponseSamples>
                </TabItem>
              </SchemaTabs>
            </TabItem>
          </MimeTabs>
        </div>
      </TabItem><TabItem
        label={"422"}
        value={"422"}
      >
        <div>
          
          
          Validation Error
          
          
        </div><div>
          <MimeTabs
            className={"openapi-tabs__mime"}
            schemaType={"response"}
          >
            <TabItem
              label={"application/json"}
              value={"application/json"}
            >
              <SchemaTabs
                className={"openapi-tabs__schema"}
              >
                <TabItem
                  label={"Schema"}
                  value={"Schema"}
                >
                  <details
                    style={{}}
                    className={"openapi-markdown__details response"}
                    data-collapsed={false}
                    open={true}
                  >
                    <summary
                      style={{}}
                      className={"openapi-markdown__details-summary-response"}
                    >
                      <strong>
                        Schema
                      </strong>
                    </summary><div
                      style={{"textAlign":"left","marginLeft":"1rem"}}
                    >
                      
                    </div><ul
                      style={{"marginLeft":"1rem"}}
                    >
                      <SchemaItem
                        collapsible={true}
                        className={"schemaItem"}
                      >
                        <details
                          style={{}}
                          className={"openapi-markdown__details"}
                        >
                          <summary
                            style={{}}
                          >
                            <span
                              className={"openapi-schema__container"}
                            >
                              <strong
                                className={"openapi-schema__property"}
                              >
                                detail
                              </strong><span
                                className={"openapi-schema__name"}
                              >
                                 object[]
                              </span>
                            </span>
                          </summary><div
                            style={{"marginLeft":"1rem"}}
                          >
                            <li>
                              <div
                                style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}
                              >
                                Array [
                              </div>
                            </li><SchemaItem
                              collapsible={true}
                              className={"schemaItem"}
                            >
                              <details
                                style={{}}
                                className={"openapi-markdown__details"}
                              >
                                <summary
                                  style={{}}
                                >
                                  <span
                                    className={"openapi-schema__container"}
                                  >
                                    <strong
                                      className={"openapi-schema__property"}
                                    >
                                      loc
                                    </strong><span
                                      className={"openapi-schema__name"}
                                    >
                                       object[]
                                    </span><span
                                      className={"openapi-schema__divider"}
                                    >
                                      
                                    </span><span
                                      className={"openapi-schema__required"}
                                    >
                                      required
                                    </span>
                                  </span>
                                </summary><div
                                  style={{"marginLeft":"1rem"}}
                                >
                                  <li>
                                    <div
                                      style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}
                                    >
                                      Array [
                                    </div>
                                  </li><div>
                                    <span
                                      className={"badge badge--info"}
                                    >
                                      anyOf
                                    </span><SchemaTabs>
                                      <TabItem
                                        label={"MOD1"}
                                        value={"0-item-properties"}
                                      >
                                        <div
                                          style={{"marginTop":".5rem","marginBottom":".5rem"}}
                                        >
                                          
                                          
                                          string
                                          
                                          
                                        </div>
                                      </TabItem><TabItem
                                        label={"MOD2"}
                                        value={"1-item-properties"}
                                      >
                                        <div
                                          style={{"marginTop":".5rem","marginBottom":".5rem"}}
                                        >
                                          
                                          
                                          integer
                                          
                                          
                                        </div>
                                      </TabItem>
                                    </SchemaTabs>
                                  </div><li>
                                    <div
                                      style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}
                                    >
                                      ]
                                    </div>
                                  </li>
                                </div>
                              </details>
                            </SchemaItem><SchemaItem
                              collapsible={false}
                              name={"msg"}
                              required={true}
                              schemaName={"Message (string)"}
                              qualifierMessage={undefined}
                              schema={{"type":"string","title":"Message"}}
                            >
                              
                            </SchemaItem><SchemaItem
                              collapsible={false}
                              name={"type"}
                              required={true}
                              schemaName={"Error Type (string)"}
                              qualifierMessage={undefined}
                              schema={{"type":"string","title":"Error Type"}}
                            >
                              
                            </SchemaItem><li>
                              <div
                                style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}
                              >
                                ]
                              </div>
                            </li>
                          </div>
                        </details>
                      </SchemaItem>
                    </ul>
                  </details>
                </TabItem><TabItem
                  label={"Example (from schema)"}
                  value={"Example (from schema)"}
                >
                  <ResponseSamples
                    responseExample={"{\n  \"detail\": [\n    {\n      \"loc\": [\n        \"string\",\n        0\n      ],\n      \"msg\": \"string\",\n      \"type\": \"string\"\n    }\n  ]\n}"}
                    language={"json"}
                  >
                    
                  </ResponseSamples>
                </TabItem>
              </SchemaTabs>
            </TabItem>
          </MimeTabs>
        </div>
      </TabItem>
    </ApiTabs>
  </div>
</div>
      