> 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/j/json-file-users.md).

# JSON File Users

The JSON File Users adapter imports user accounts from a JSON file that you copy to the connector.

## Use cases

* **Add users from a system without an adapter.** Bring user exports into the user inventory.

```
Adapters = json-file-users
```

* **Review imported users by domain.** List users from one email domain.

```
Adapters = json-file-users AND Domain = <domain>
```

## Before you begin

### Network

| Source              | Destination                      | Port           | Protocol       |
| ------------------- | -------------------------------- | -------------- | -------------- |
| OctoXLabs connector | Local file on the connector host | Not applicable | Not applicable |

The adapter reads a file from disk. It makes no network connection.

### Required permissions

The connector process must be able to read the file. The baseline asks you to check the file permissions after you copy the file.

## Create credentials in JSON file

This adapter needs no credentials. Prepare the file and copy it to the connector instead.

{% stepper %}
{% step %}

### Prepare the JSON file

Create a JSON file that contains either one object or a list of objects. Each object is one record. An empty file is rejected.
{% endstep %}

{% step %}

### Copy the file to the connector

Copy the file to `/opt/octoxlabs/connector/media/json` on the connector host.
{% endstep %}

{% step %}

### Check the file permissions

Make sure the connector process can read the file, then run the connection test.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter   | Required | Type   | Default | Description                                                                                                                                             |
| ----------- | -------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Filename    | Yes      | String | None    | File name or glob pattern inside the JSON folder. Absolute paths and `..` are not allowed. If a pattern matches several files, the newest file is used. |
| Email Field | No       | String | Email   | JSON key that holds the email address. A dotted path such as `profile.email` reaches a nested key. Used only when a record has no `Email` key.          |

## Troubleshooting

| Error message                     | Cause                                                                                      | Fix                                                             |
| --------------------------------- | ------------------------------------------------------------------------------------------ | --------------------------------------------------------------- |
| File not found with this pattern. | No file in the JSON folder matches **Filename**, or the match resolves outside the folder. | Copy the file to the JSON folder and check the name or pattern. |
| {filename} file is empty.         | The JSON file contains no data.                                                            | Add at least one record to the file.                            |

## Change history
