Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Latest commit

 

History

History
73 lines (55 loc) · 1.78 KB

File metadata and controls

73 lines (55 loc) · 1.78 KB
description
Removes a server

Remove federated server

URLRequires AuthHTTP Method
/api/v1/federation/removeServerByUseryesPOST

Payload

Argument Example Required Description
serverName my-server.rocket.chat Required The public server name.

Example payload

{
  "serverName": "my-server.rocket.chat"
}

Example Call

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
     -H "X-User-Id: aobEdbYhXfu5hkeqG" \
     -X POST \
     -H "Content-type:application/json" \
     http://localhost:3000/api/v1/federation/removeServerByUser\
    -d '{"serverName": "my-server.rocket.chat"}'

Example Result

Success

{
  "success": true
}

Error

Any of the following errors can occur on the endpoint.

  • Authorization: Requires an authentication token for the request to be made.
  • Can't remove default server: This occurs when trying to remove a default server.

{% tabs %} {% tab title="Authorization" %}

 {
    "status": "error",
    "message": "You must be logged in to do this."
}

{% endtab %}

{% tab title="Can't remove default server" %}

{
    "success": false,
    "error": "cannot-remove-default-server"
}

{% endtab %} {% endtabs %}

Version
6.0.0Added