---
descriptions:
  remove_role_by_criteria:
    organization_membership_id: The ID of the organization membership.
    role_slug: The slug of the role to remove.
    resource_id: >-
      The ID of the resource. Use either this or resource_external_id +
      resource_type_slug.
    resource_external_id: The external ID of the resource. Requires resource_type_slug.
    resource_type_slug: The resource type slug. Required with resource_external_id.
reference:
  curl:
    - key: remove_role_by_criteria
      id: remove_role_by_criteria
      url: /reference/fga/role-assignment/delete
      title: >-
        /authorization/organization_memberships/:organization_membership_id/role_assignments
      type: DELETE
      parameters:
        - key: organization_membership_id
          type: string
          description: (remove_role_by_criteria.organization_membership_id)
        - key: role_slug
          type: string
          description: (remove_role_by_criteria.role_slug)
        - key: resource_id
          type: string
          optional: true
          description: (remove_role_by_criteria.resource_id)
        - key: resource_external_id
          type: string
          optional: true
          description: (remove_role_by_criteria.resource_external_id)
        - key: resource_type_slug
          type: string
          optional: true
          description: (remove_role_by_criteria.resource_type_slug)
      returns:
        - key: empty
          type: empty
          description: Returns an empty response on success.
  js:
    - key: removeRole
      id: remove_role_by_criteria
      url: /reference/fga/role-assignment/delete
      title: authorization.removeRole()
      parameters:
        - key: options
          type: object
          unwrap: true
          properties:
            - key: organizationMembershipId
              type: string
              description: (remove_role_by_criteria.organization_membership_id)
            - key: roleSlug
              type: string
              description: (remove_role_by_criteria.role_slug)
            - key: resourceId
              type: string
              optional: true
              description: (remove_role_by_criteria.resource_id)
            - key: resourceExternalId
              type: string
              optional: true
              description: (remove_role_by_criteria.resource_external_id)
            - key: resourceTypeSlug
              type: string
              optional: true
              description: (remove_role_by_criteria.resource_type_slug)
      returns:
        - key: void
          description: Returns nothing on success.
originalPath: >-
  .tmp-workos-clone/packages/docs/content/reference/fga/role-assignment/delete.mdx
---

## Remove a role assignment

Remove a role assignment by specifying the role slug and resource. Access is revoked immediately. Removing an assignment also removes any permissions that were inherited by child resources through that assignment.

You must provide either `resource_id` or both `resource_external_id` and `resource_type_slug` to identify the resource.

<Callout type="warning">
  This removes the specific role assignment, but direct assignments on child
  resources remain intact.
</Callout>

<CodeBlock referenceId="remove_role_by_criteria">
  <CodeBlockTab title="Request" file="remove-role-by-criteria-request" />
</CodeBlock>
