API ReferenceapiidentityPOST /v1/admin/users/{user_id}/ban

POST /v1/admin/users/\{user_id\}/ban

Service: identity · operationId: (none)

Permanently ban a user

Required scopes

(no scope declared — review service config)

Path parameters

  • user_id (string) required

Request body

{
  "type": "object",
  "properties": {
    "reason": {
      "type": "string",
      "enum": [
        "spam",
        "harassment",
        "medical_misinfo",
        "tos_violation",
        "other"
      ],
      "description": "Ban reason category"
    },
    "reason_detail": {
      "type": "string",
      "description": "Free-text detail (required for 'other')"
    }
  },
  "required": [
    "reason"
  ]
}

Responses

200 User banned

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "user_id": {
      "type": "string"
    },
    "action": {
      "type": "string"
    },
    "reason": {
      "type": "string"
    },
    "reason_detail": {
      "type": [
        "string",
        "null"
      ]
    },
    "suspended_until": {
      "type": [
        "string",
        "null"
      ]
    },
    "banned_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "user_id",
    "action",
    "reason",
    "reason_detail",
    "suspended_until",
    "banned_at",
    "created_at"
  ]
}

400 Validation error

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

500 Internal error

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://identity.platform.loop.health/v1/admin/users/{user_id}/ban \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'