---
updatedAt: 2026-06-08T03:35:06.000Z
agentTools:
  projectIndex: https://developer.moloco.cloud/llms.txt
---

# Expel the user

Expel the user from an API callers’ workplace.
Only API callers who have the WORKPLACE_OWNER role can expel users.
Expelled users will no longer have any roles under the workplace.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Moloco Ads Campaign Management API",
    "description": "Moloco Ads Campaign Management API provides functionalities for Moloco Ads Campaigns.",
    "version": "1.10",
    "contact": {
      "name": "Moloco Inc.",
      "url": "https://www.moloco.com"
    }
  },
  "paths": {
    "/cm/v1/auth/users/expel": {
      "post": {
        "summary": "Expel the user",
        "description": "Expel the user from an API callers’ workplace.\nOnly API callers who have the WORKPLACE_OWNER role can expel users.\nExpelled users will no longer have any roles under the workplace.",
        "operationId": "DspApi_ExpelUser",
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/messagesExpelUserResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error. Detailed cause can be found in the `details` field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/messagesExpelUserError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/messagesExpelUserRequest"
              }
            }
          },
          "required": true
        },
        "tags": [
          "User"
        ]
      }
    }
  },
  "security": [
    {
      "Bearer": []
    }
  ],
  "servers": [
    {
      "url": "https://api.moloco.cloud"
    }
  ],
  "components": {
    "securitySchemes": {
      "Bearer": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    },
    "schemas": {
      "messagesExpelUserError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "array",
            "items": {
              "type": "object",
              "$ref": "#/components/schemas/messagesExpelUserErrorAPIErrorInfo"
            }
          }
        }
      },
      "messagesExpelUserErrorAPIErrorInfo": {
        "type": "object",
        "properties": {
          "reason": {
            "$ref": "#/components/schemas/messagesExpelUserErrorAPIErrorInfoErrorReason"
          },
          "error_log_id": {
            "type": "string"
          },
          "context": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "messagesExpelUserErrorAPIErrorInfoErrorReason": {
        "type": "string",
        "enum": [
          "ERROR_REASON_UNKNOWN",
          "USER_DOES_NOT_HAVE_REQUIRED_ROLE",
          "USER_NOT_REGISTERED_TO_WORKPLACE"
        ],
        "default": "ERROR_REASON_UNKNOWN",
        "description": " - USER_DOES_NOT_HAVE_REQUIRED_ROLE: The user doesn't have role to invite other user.\n - USER_NOT_REGISTERED_TO_WORKPLACE: The user is not registered to workplace."
      },
      "messagesExpelUserRequest": {
        "type": "object",
        "properties": {
          "user_id": {
            "type": "string",
            "description": "The user ID."
          }
        },
        "required": [
          "user_id"
        ]
      },
      "messagesExpelUserResponse": {
        "type": "object"
      }
    }
  }
}
```