> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/m/mimecast-v2.md).

# Mimecast V2

Mimecast V2 uses Mimecast API 2.0. OctoXLabs lists the users of your account and adds their group memberships to the user inventory. Aliases are skipped.

## Use cases

* List the users that Mimecast V2 reports.

```
Adapters = mimecast-v2
```

* Find Mimecast users that belong to a given group.

```
Adapters = mimecast-v2 AND MembersOf ~ <group description>
```

## Before you begin

### Network

| Source              | Destination                                                     | Port | Protocol |
| ------------------- | --------------------------------------------------------------- | ---- | -------- |
| OctoXLabs connector | api.services.mimecast.com (or the host in the Domain parameter) | 443  | HTTPS    |

### Required permissions

| Scope or role | Permission | Needed for              |
| ------------- | ---------- | ----------------------- |
| Directories   | Internal   | Read (application role) |
| Directories   | Groups     | Read (application role) |

## Create credentials in Mimecast V2

{% stepper %}
{% step %}

### Open the Integrations Hub

Log in to the Mimecast Administration Console and go to Integrations | Integrations Hub. Accept the API Terms and Conditions if prompted.
{% endstep %}

{% step %}

### Create the application

On the Mimecast API 2.0 tile, select Configure New.
{% endstep %}

{% step %}

### Fill in the details

Under Details, set the Application Name, Products and Application Role. Under Notification Settings, set the technical contact and email.
{% endstep %}

{% step %}

### Save and copy the credentials

Select Save. A popup shows the Client ID and Client Secret. Copy both at once, because the secret is shown only once. Select Close.
{% endstep %}

{% step %}

### Check the role

The Application Role must have Directories | Internal | Read and Directories | Groups | Read.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                       | Required | Type    | Default                   | Description                                                                                            |
| ------------------------------- | -------- | ------- | ------------------------- | ------------------------------------------------------------------------------------------------------ |
| Domain (`domain`)               | No       | String  | api.services.mimecast.com | Mimecast API 2.0 base host. Keep the default.                                                          |
| Client ID (`client_id`)         | Yes      | String  |                           | Client ID of the API 2.0 application.                                                                  |
| Client Secret (`client_secret`) | Yes      | String  |                           | Client Secret of the same application.                                                                 |
| Proxy (`proxy`)                 | No       | String  |                           | Proxy host and port, sent as an `http://` proxy URL.                                                   |
| Thread Count (`thread_count`)   | No       | Integer | 32                        | Parallel threads for API requests (min 1, max 32).                                                     |
| Sleep Time (`sleep_time`)       | No       | Integer |                           | Seconds to wait while threads are created. A higher value lowers resource use and lengthens discovery. |
| Timeout (`timeout`)             | No       | Integer | 30                        | Seconds to wait for API responses.                                                                     |

## Troubleshooting

| Error message                       | Cause                                                                      | Fix                                                    |
| ----------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------ |
| Max retries exceeded for            | The API kept returning 401 or 429 after retries.                           | Check the client credentials and the role permissions. |
| Failed to fetch members for group : | A group members call failed. Logged as a warning and the group is skipped. | Check that the role has Directories                    |

## Change history
