---
updatedAt: 2025-04-22T20:06:50.000Z
agentTools:
  projectIndex: https://email.opensrs.guide/llms.txt
---

# logout_user

The **logout_user** method terminates all IMAP and POP sessions that the specified user has active.

## Syntax

```perl
{
    <credentials object>, 
    "user": <mailbox_name>
}
```

## Request fields for logout user

The following fields can be used in the **logout\_user** method:

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Field name
      </th>

      <th>
        ￼ Obligation
      </th>

      <th>
        Definition/Value
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        user
      </td>

      <td>
        Required
      </td>

      <td>
        The user's email address.
      </td>
    </tr>
  </tbody>
</Table>

## Response fields for logout user

The following fields may be returned in response to the **logout\_user** method:

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Field name
      </th>

      <th>
        Obligation
      </th>

      <th>
        Description/Value
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        error
      </td>

      <td>
        Returned if **success = false**
      </td>

      <td>
        A text string that explains the error.
      </td>
    </tr>

    <tr>
      <td>
        error\_number
      </td>

      <td>
        Returned if **success = false**
      </td>

      <td>
        A number that represents the error.
      </td>
    </tr>

    <tr>
      <td>
        success
      </td>

      <td>
        Always returned
      </td>

      <td>
        Indicates whether the request was successful or not. Allowed values are **true** and **false**.
      </td>
    </tr>
  </tbody>
</Table>

## Examples for logout\_user

This example terminate all current IMAP and POP sessions for <joe_user@example.com>.

**Request**

```perl
{
"credentials": {
"user": "domain_admin@example.com",
"password": "pencil75"
},
"user": "joe_user@example.com"
}
```

**Response**

```perl
{
"success": true
}
```