> ## Documentation Index
> Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt
> Use this file to discover all available pages before exploring further.
# Block Omnichannel Contact
>
Use this endpoint to block an Omnichannel on a specific channel. Permission required: `block-livechat-contact`
## OpenAPI
````json POST /api/v1/omnichannel/contacts.block
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Omnichannel"
},
"servers": [
{
"url": "https://apiexplorer.support.rocket.chat"
}
],
"tags": [
{
"name": "Omnichannel Users"
},
{
"name": "Omnichannel Agents"
},
{
"name": "Omnichannel Monitors"
},
{
"name": "Omnichannel Visitors"
},
{
"name": "Omnichannel Contacts"
},
{
"name": "Omnichannel Rooms"
},
{
"name": "Omnichannel Departments"
},
{
"name": "Omnichannel Custom Fields"
},
{
"name": "Omnichannel Business Hours"
},
{
"name": "Omnichannel Priorities"
},
{
"name": "Omnichannel Tags"
},
{
"name": "Omnichannel Units"
},
{
"name": "SLA Policies"
},
{
"name": "Canned Responses"
},
{
"name": "Omnichannel Transcript"
},
{
"name": "Omnichannel Statistics"
},
{
"name": "Omnichannel Agent Stats"
},
{
"name": "Omnichannel Dashboards"
},
{
"name": "Reports"
},
{
"name": "Omnichannel Inquiries"
},
{
"name": "Omnichannel Webhooks"
},
{
"name": "Livechat"
},
{
"name": "Livechat Appearance"
},
{
"name": "Livechat Triggers"
},
{
"name": "Livechat Messages"
},
{
"name": "Livechat Page Visited"
}
],
"paths": {
"/api/v1/omnichannel/contacts.block": {
"post": {
"summary": "Block Omnichannel Contact",
"tags": [
"Omnichannel Contacts"
],
"responses": {
"200": {
"$ref": "#/components/responses/trueSuccess"
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
},
"errorType": {
"type": "string"
}
}
},
"examples": {
"Example 1": {
"value": {
"success": false,
"error": "must have required property 'visitor' [invalid-params]",
"errorType": "invalid-params"
}
},
"Example 2": {
"value": {
"success": false,
"error": "error-contact-not-found"
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/authorizationError"
}
},
"operationId": "post-api-v1-omnichannel-contacts.block",
"description": "\n\nUse this endpoint to block an Omnichannel on a specific channel. Permission required: `block-livechat-contact`",
"parameters": [
{
"$ref": "#/components/parameters/AuthToken"
},
{
"$ref": "#/components/parameters/UserId"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"visitor"
],
"properties": {
"visitor": {
"type": "object",
"required": [
"visitorId",
"source"
],
"description": "The visitor object contains the details of the contact that you want to block.",
"properties": {
"visitorId": {
"type": "string",
"description": "Enter the visitor ID of the contact that you want to block. To get the visitor ID, you can use the Search Omnichannel Contacts endpoint.",
"example": "68f0d2c201e202fefed83672"
},
"source": {
"type": "object",
"required": [
"type"
],
"description": "The source object contains the channels from which you want to block the contact. To get the room types, you can use the View Omnichannel Room Sources endpoint.",
"properties": {
"type": {
"type": "string",
"description": "Enter the type of channel from which you want to block the contact.",
"example": "widget"
}
}
}
}
}
}
},
"examples": {
"Example 1": {
"value": {
"visitor": {
"visitorId": "68f0d2c201e202fefed83672",
"source": {
"type": "widget"
}
}
}
}
}
}
}
}
}
}
},
"components": {
"responses": {
"trueSuccess": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
},
"examples": {
"Success": {
"value": {
"success": true
}
}
}
}
}
},
"authorizationError": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string"
},
"message": {
"type": "string"
}
}
},
"examples": {
"Authorization Error": {
"value": {
"status": "error",
"message": "You must be logged in to do this."
}
}
}
}
}
}
},
"parameters": {
"AuthToken": {
"name": "X-Auth-Token",
"in": "header",
"description": "The `authToken` of the authenticated user.",
"required": true,
"schema": {
"type": "string"
},
"example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f"
},
"UserId": {
"name": "X-User-Id",
"in": "header",
"description": "The `userId` of the authenticated user.",
"required": true,
"schema": {
"type": "string"
},
"example": "rbAXPnMktTFbNpwtJ"
}
}
}
}
````