> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.tangerine365.com/llms.txt.
> For full documentation content, see https://docs.tangerine365.com/llms-full.txt.

# Suspend User(s)

POST https://localhost:8090//api/user/suspenduser
Content-Type: application/x-www-form-urlencoded

Suspends one or more users by user ID or username. Both `useridst` and `usernames` accept comma-separated values. Organization ID is required for tenant users.

### Notes

- You may suspend users by providing either `useridst`, `usernames`, or both, as comma-separated values.
    
- `orgid` is required for tenant users; omit or set to `null` for non-tenant users if your backend allows.
    
- Ensure the `auth` token is valid and has the necessary permissions.

Reference: https://docs.tangerine365.com/tangerine-365-enterprise/suspend-user-s

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Tangerine365 Enterprise
  version: 1.0.0
paths:
  //api/user/suspenduser:
    post:
      operationId: suspend-user-s
      summary: Suspend User(s)
      description: "Suspends one or more users by user ID or username. Both\_`useridst`\_and\_`usernames`\_accept comma-separated values. Organization ID is required for tenant users.\n\n### Notes\n\n- You may suspend users by providing either\_`useridst`,\_`usernames`, or both, as comma-separated values.\n    \n- `orgid`\_is required for tenant users; omit or set to\_`null`\_for non-tenant users if your backend allows.\n    \n- Ensure the\_`auth`\_token is valid and has the necessary permissions."
      tags:
        - ''
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Suspend User(s)_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                auth:
                  type: string
                useridst:
                  type: string
                  description: comma separated userids
                usernames:
                  type: string
                  description: comma separated usernames
              required:
                - auth
                - useridst
                - usernames
servers:
  - url: https://localhost:8090
components:
  schemas:
    Suspend User(s)_Response_200:
      type: object
      properties:
        message:
          type: string
        success:
          type: boolean
      required:
        - message
        - success
      title: Suspend User(s)_Response_200

```

## SDK Code Examples

```python Suspend User(s)_example
import requests

url = "https://localhost:8090//api/user/suspenduser"

payload = ""
headers = {"Content-Type": "application/x-www-form-urlencoded"}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript Suspend User(s)_example
const url = 'https://localhost:8090//api/user/suspenduser';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  body: new URLSearchParams('')
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Suspend User(s)_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://localhost:8090//api/user/suspenduser"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Suspend User(s)_example
require 'uri'
require 'net/http'

url = URI("https://localhost:8090//api/user/suspenduser")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'

response = http.request(request)
puts response.read_body
```

```java Suspend User(s)_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://localhost:8090//api/user/suspenduser")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .asString();
```

```php Suspend User(s)_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://localhost:8090//api/user/suspenduser', [
  'form_params' => null,
  'headers' => [
    'Content-Type' => 'application/x-www-form-urlencoded',
  ],
]);

echo $response->getBody();
```

```csharp Suspend User(s)_example
using RestSharp;

var client = new RestClient("https://localhost:8090//api/user/suspenduser");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
IRestResponse response = client.Execute(request);
```

```swift Suspend User(s)_example
import Foundation

let headers = ["Content-Type": "application/x-www-form-urlencoded"]

let request = NSMutableURLRequest(url: NSURL(string: "https://localhost:8090//api/user/suspenduser")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```