---
title: "Ban an actor or IP address"
method: POST
path: "/ocs/v2.php/apps/spreed/api/{apiVersion}/ban/{token}"
tags: ["ban"]
---

# Ban an actor or IP address

`POST /ocs/v2.php/apps/spreed/api/{apiVersion}/ban/{token}`

Required capability: `ban-v1`

## Path parameters

- `apiVersion` 'v1', required
- `token` string, required

## Headers

- `OCS-APIRequest` boolean, required

## Request body

- object
  - `actorType` 'users' | 'guests' | 'emails' | 'ip', required — Type of actor to ban, or `ip` when banning a clients remote address
  - `actorId` string, required — Actor ID or the IP address or range in case of type `ip`
  - `internalNote` string — Optional internal note (max. 4000 characters)

## Response `200`

Ban successfully

- object
  - `ocs` object, required
    - `meta` OCSMeta, required
      - `status` string, required
      - `statuscode` integer, required
      - `message` string
      - `totalitems` string
      - `itemsperpage` string
    - `data` Ban, required
      - `id` integer, required — Identifier of the ban
      - `moderatorActorType` string, required — Actor type of the moderator that banned the participant
      - `moderatorActorId` string, required — Actor id of the moderator that banned the participant
      - `moderatorDisplayName` string, required — Display name of the moderator that banned the participant
      - `bannedActorType` string, required — Actor type of the banned participant
      - `bannedActorId` string, required — Actor id of the banned participant
      - `bannedDisplayName` string, required — Display name of the banned participant
      - `bannedTime` integer, required — UNIX timestamp when the participant was banned
      - `internalNote` string, required — Internal note for the moderator to remember the reason for the ban

## Other responses

- `400` — Actor information is invalid

---

[API](https://skmtc.dev/nextcloud/apis/spreed-full.md) · [All operations](https://skmtc.dev/nextcloud/apis/spreed-full/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nextcloud/spreed-full/revisions/41d6458d6d6e/schema)
