---
id: unassign-role-from-user
title: "Unassign Role From User"
description: "Delete a role assignment from a user in a workspace."
sidebar_label: "Unassign Role From User"
hide_title: true
hide_table_of_contents: true
api: eJztVktv1DAQ/iuWL4BU7ZaKU04sdCsqQKCyhUO7qtxkdmOa2MF2CkuU/86M7bworYDSG3tZx575Zuabh93wDGxqZOWkVjzhh1CAAyaY0QX+WSu3qgTl2MboErdrC4ZJhauv2lzZSqQwO1fnamG2NjlXDH/9wYXM2GPrzJOErXJgx4dMb5jD1ViVNKAUshiLho0o7U06zQyU+hr8lneOPIoA2mxvNYZnQsnvggKM4l59JOy/Bws+1M5ypwJfarCOPT4Ji6h5JKxbvD/uj/XlZ0idZ+QEXG1UR8ql1gWqmBqY3AwxjAj+KiyzdZqCtZu6KHYs86nIApiQFjqsV6vV++W3FHzOEnbs8QwCWyYUA2O0T5E30vllBiozDZYp7VguMNgKTCnRC62IAfzaaBOiF+mIst+0WVcZEq22vbVH1gdqZ3yPa0T3aTjOsNJqFYK/oPML4vyCFFCuEkaUGLqxPDlruMIPlB+XFQpJqtZKuBzXFKU0gKgOCd7jNs2xgnjScLerSBdTjU6hpJOuoI1PHRhDX9p2r7fiK6+DR+7M7q/wlx5mDBxK9P7I78z2Z5+JwPsDnxBK265J11ZaYb2R+MH+Pv1Np8SHvk7ZSRRGpFQrh5VM4qKqCpn6ZM8/W9JpBhda/O3xZwcHN4E/ikJmXo0tqab+AJVXhgrMyeB3Bo5SgCvpoLQ3BQqdTk6F2r3b+IKbMkRExx2JnmyxRNs1+h/3hDFiN6LxjQ4Ooh4v7fYuxt8ihWILvAe7o558g63otB1sh2kzyfaZjyuYjnLrAWagN7B7exiHgb5fGetEaCTcAAy5xe7NNTV5mGG+p7FTEz7vu9jOm3FHt3M/JlASZ8B11/q1wQzy3LnKJvN5Wug6myFjyomZkHNRSZSfFtDCn7KXJMqpmC2ktZFu5/FwVL+G3SsQGWYxOVuPBT5QIYXSmIr1WUF7uI0mY98taozSxKula8A8aBELUm20V4+ERd9eiPQKFI0CijO4vT97Otu/LZiowNCt2A84mgm488OL4dGUrp4oPAljLeEORPl8OCAvK21dKdQI7zROZkYjgR3RbXgaJvPEvWZozf/Phv/Phgd7NsTuc/DNzatCSD9afak3caycDY8DmiDJT0+FMFmw1XMsdZJumkth4dQUbUvb4c6k+ZBJKy4LmqMbUVi4o+B9QmnkPmG3uXiFs2J4UFyLoiYZf588gJ3+ffHQhuJrYzCzpg8jyc6/J7EbvWo3ttn5Mkm0v5XzbrY3UWSRUvWNlG88IiiA/sI6XL5ZrpY4GH8AsWB6XA==
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={"Unassign Role From User"}
>
</Heading>

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



Delete a role assignment from a user in a workspace.

Args:
    workspace_id (str): The ID of the workspace.
    email (str): The email of the user to remove the role from.
    org_id (str): The ID of the organization.
    role (str): The role to remove from the user.
    request (Request): The FastAPI request object.

Returns:
    bool: True if the role assignment was successfully deleted.

Raises:
    HTTPException: If there is an error in the request or the user does not have permission to perform the action.
    HTTPException: If there is an error in updating the user's roles.

<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":"email","in":"query","required":true,"schema":{"type":"string","title":"Email"}}}
      >
        
      </ParamsItem><ParamsItem
        className={"paramsItem"}
        param={{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}}}
      >
        
      </ParamsItem><ParamsItem
        className={"paramsItem"}
        param={{"name":"role","in":"query","required":true,"schema":{"type":"string","title":"Role"}}}
      >
        
      </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"}}
                    >
                      any
                    </ul>
                  </details>
                </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>
      