> 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/mend.io.md).

# Mend.io

Mend.io is an application security platform. OctoXLabs reads the users of one Mend organization and adds them to the user inventory.

## Use cases

* List the Mend users in the inventory.

```
Adapters = mend-io
```

* Find Mend users whose email matches your corporate domain.

```
Adapters = mend-io AND Email ~ example.com
```

## Before you begin

### Network

| Source              | Destination                                                                                                                   | Port | Protocol |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ---- | -------- |
| OctoXLabs connector | Mend API host: `api-app.mend.io`, `api-app-eu.whitesourcesoftware.com`, `api-saas.mend.io` (default) or `api-saas-eu.mend.io` | 443  | HTTPS    |

### Required permissions

| Scope or role       | Permission              | Needed for |
| ------------------- | ----------------------- | ---------- |
| Organization member | List organization users | Users      |

Use a service user instead of a personal account. The account must belong to the organization identified by the Org UUID and be allowed to list its users (Mend API 3.0 organization users endpoint).

## Create credentials in Mend.io

{% stepper %}
{% step %}

### Find the email

In the Mend Platform, open My Profile > General and copy the account email.
{% endstep %}

{% step %}

### Create a user key

Open My Profile > User Keys and copy the user key. It works like a personal access token.
{% endstep %}

{% step %}

### Find the Org UUID

Open Administration > General Configuration and copy the organization UUID.
{% endstep %}

{% step %}

### Pick the API host

Use the host that serves your instance (see the network table).
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter             | Required | Type    | Default          | Description                                                            |
| --------------------- | -------- | ------- | ---------------- | ---------------------------------------------------------------------- |
| Domain (`domain`)     | No       | String  | api-saas.mend.io | Mend API host for your instance.                                       |
| Email (`email`)       | Yes      | String  |                  | Email of the Mend account.                                             |
| User Key (`user_key`) | Yes      | String  |                  | User key of that account.                                              |
| Org UUID (`org_uuid`) | Yes      | String  |                  | UUID of the organization to read users from.                           |
| Proxy (`proxy`)       | No       | String  |                  | Proxy host and port. The connector sends it as an `http://` proxy URL. |
| Timeout (`timeout`)   | No       | Integer | 30               | Seconds to wait for API responses.                                     |

## Troubleshooting

| Error message                                              | Cause                                               | Fix                                                               |
| ---------------------------------------------------------- | --------------------------------------------------- | ----------------------------------------------------------------- |
| Mend login did not return a refresh token.                 | The login call returned no `response.refreshToken`. | Check the email and user key.                                     |
| Mend did not return an access token for this organization. | The token call returned no `response.jwtToken`.     | Check that the Org UUID is correct and the account belongs to it. |
| Max retries exceeded for                                   | The API kept returning 401 after re-authentication. | Check that the user key is still valid.                           |

## Change history

{% hint style="info" %}
Available starting from version 6.7.2.
{% endhint %}
