---
updatedAt: 2025-09-22T23:14:24.000Z
agentTools:
  projectIndex: https://docs.budibase.com/llms.txt
---

# Delete a user

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Budibase API",
    "description": "The public API for Budibase apps and its services.",
    "version": "3.3.0"
  },
  "servers": [
    {
      "url": "https://budibase.app/api/public/v1",
      "description": "Budibase Cloud API",
      "variables": {
        "apiKey": {
          "default": "<user API key>",
          "description": "The API key of the user to assume for API call."
        },
        "appId": {
          "default": "<App ID>",
          "description": "The ID of the app the calls will be executed within the context of, this should start with app_ (production) or app_dev (development)."
        }
      }
    }
  ],
  "components": {
    "parameters": {
      "userId": {
        "in": "path",
        "name": "userId",
        "required": true,
        "description": "The ID of the user which this request is targeting.",
        "schema": {
          "type": "string"
        }
      }
    },
    "examples": {
      "user": {
        "value": {
          "data": {
            "_id": "us_693a73206518477283a8d5ae31103252",
            "email": "test@example.com",
            "roles": {
              "app_957b12f943d348faa61db7e18e088d0f": "BASIC"
            },
            "builder": {
              "global": false
            },
            "admin": {
              "global": true
            },
            "tenantId": "default",
            "status": "active",
            "budibaseAccess": true,
            "csrfToken": "9c70291d-7137-48f9-9166-99ab5473a3d4",
            "userId": "us_693a73206518477283a8d5ae31103252",
            "roleId": "ADMIN",
            "role": {
              "_id": "ADMIN",
              "name": "Admin",
              "permissionId": "admin",
              "inherits": "POWER"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-budibase-api-key",
        "description": "Your individual API key, this will provide access based on the configured RBAC settings of your user."
      }
    },
    "schemas": {
      "userOutput": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "email": {
                "description": "The email address of the user, this must be unique.",
                "type": "string"
              },
              "password": {
                "description": "The password of the user if using password based login - this will never be returned. This can be left out of subsequent requests (updates) and will be enriched back into the user structure.",
                "type": "string"
              },
              "status": {
                "description": "The status of the user, if they are active.",
                "type": "string",
                "enum": [
                  "active"
                ]
              },
              "firstName": {
                "description": "The first name of the user",
                "type": "string"
              },
              "lastName": {
                "description": "The last name of the user",
                "type": "string"
              },
              "forceResetPassword": {
                "description": "If set to true forces the user to reset their password on first login.",
                "type": "boolean"
              },
              "builder": {
                "description": "Describes if the user is a builder user or not. This field can only be set on a business or enterprise license.",
                "type": "object",
                "properties": {
                  "global": {
                    "description": "If set to true the user will be able to build any app in the system.",
                    "type": "boolean"
                  }
                }
              },
              "admin": {
                "description": "Describes if the user is an admin user or not. This field can only be set on a business or enterprise license.",
                "type": "object",
                "properties": {
                  "global": {
                    "description": "If set to true the user will be able to administrate the system.",
                    "type": "boolean"
                  }
                }
              },
              "roles": {
                "description": "Contains the roles of the user per app (assuming they are not a builder user). This field can only be set on a business or enterprise license.",
                "type": "object",
                "additionalProperties": {
                  "type": "string",
                  "description": "A map of app ID (production app ID, minus the _dev component) to a role ID, e.g. ADMIN."
                }
              },
              "_id": {
                "description": "The ID of the user.",
                "type": "string"
              }
            },
            "required": [
              "email",
              "_id"
            ]
          }
        },
        "required": [
          "data"
        ]
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/users/{userId}": {
      "delete": {
        "operationId": "userDestroy",
        "summary": "Delete a user",
        "tags": [
          "users"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/userId"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the deleted user.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/userOutput"
                },
                "examples": {
                  "user": {
                    "$ref": "#/components/examples/user"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
```