Sendbird · Arazzo Workflow

Sendbird Ban a User from a Channel

Version 1.0.0

Confirm a user and channel exist, then ban the user from the channel.

1 workflow 1 source API 1 provider
View Spec View on GitHub ArazzoWorkflows

Provider

sendbird

Workflows

ban-user-from-channel
Validate the target then ban a user from a channel.
Confirms the user and channel exist and then issues a ban with a duration and reason.
3 steps inputs: apiToken, channelUrl, description, seconds, userId outputs: bannedUserId, channelUrl
1
confirmUser
getUser
Confirm the target user exists before moderating.
2
confirmChannel
getGroupChannel
Confirm the channel exists before issuing the ban.
3
banUser
banUser
Ban the confirmed user from the confirmed channel.

Source API Descriptions

Arazzo Workflow Specification

sendbird-ban-user-from-channel-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Sendbird Ban a User from a Channel
  summary: Confirm a user and channel exist, then ban the user from the channel.
  description: >-
    A moderation flow that verifies the target user and channel are real before
    issuing a ban. It looks up the user, confirms the channel, and then bans the
    user from that channel for a supplied duration with a documented reason.
    Validating first avoids issuing bans against typo'd IDs. Every step spells
    out its request inline so the flow can be read and executed without opening
    the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: sendbirdApi
  url: ../openapi/sendbird-platform-openapi.yml
  type: openapi
workflows:
- workflowId: ban-user-from-channel
  summary: Validate the target then ban a user from a channel.
  description: >-
    Confirms the user and channel exist and then issues a ban with a duration
    and reason.
  inputs:
    type: object
    required:
    - apiToken
    - userId
    - channelUrl
    properties:
      apiToken:
        type: string
        description: Sendbird Api-Token from the dashboard.
      userId:
        type: string
        description: User ID to ban.
      channelUrl:
        type: string
        description: URL of the channel to ban the user from.
      seconds:
        type: integer
        description: Ban duration in seconds. -1 for a permanent ban.
        default: -1
      description:
        type: string
        description: Reason recorded for the ban.
        default: Violation of community guidelines.
  steps:
  - stepId: confirmUser
    description: Confirm the target user exists before moderating.
    operationId: getUser
    parameters:
    - name: Api-Token
      in: header
      value: $inputs.apiToken
    - name: user_id
      in: path
      value: $inputs.userId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      confirmedUserId: $response.body#/user_id
  - stepId: confirmChannel
    description: Confirm the channel exists before issuing the ban.
    operationId: getGroupChannel
    parameters:
    - name: Api-Token
      in: header
      value: $inputs.apiToken
    - name: channel_url
      in: path
      value: $inputs.channelUrl
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      confirmedChannelUrl: $response.body#/channel_url
  - stepId: banUser
    description: Ban the confirmed user from the confirmed channel.
    operationId: banUser
    parameters:
    - name: Api-Token
      in: header
      value: $inputs.apiToken
    - name: user_id
      in: path
      value: $steps.confirmUser.outputs.confirmedUserId
    requestBody:
      contentType: application/json
      payload:
        channel_url: $steps.confirmChannel.outputs.confirmedChannelUrl
        seconds: $inputs.seconds
        description: $inputs.description
    successCriteria:
    - condition: $statusCode == 200
  outputs:
    bannedUserId: $steps.confirmUser.outputs.confirmedUserId
    channelUrl: $steps.confirmChannel.outputs.confirmedChannelUrl