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

# Users

API Documentation for the BugSplat Users Endpoint

{% hint style="info" %}
This endpoint supports paging and filtering queries. More information paging, filtering, and grouping is available [here](/api-reference/paging-filtering-and-grouping.md).
{% endhint %}

Get a list of users, add a user, or remove a user from a specified database.

## Get Users

<mark style="color:blue;">`GET`</mark> `https://app.bugsplat.com/api/user/users`

Returns a list of users and access rights for the specified database.

#### Query Parameters

| Name     | Type   | Description                        |
| -------- | ------ | ---------------------------------- |
| database | string | BugSplat database containing users |

{% tabs %}
{% tab title="200 " %}

```json
[
  {
    "dbId": 4321,
    "dbName": "Fred",
    "uId": 55411,
    "username": "fred@bugsplat.com",
    "firstName": "Fred",
    "lastName": "Flintstone",
    "lastLogin": "2021-08-25T21:02:56Z",
    "unrestricted": 1,
    "ssoGroups": ""
  }
]
```

{% endtab %}
{% endtabs %}

### Curl Example

```bash
curl --location 'https://app.bugsplat.com/api/user/users?database=fred' \
--header 'Authorization: Bearer ••••••'
```

## Add Users

<mark style="color:green;">`POST`</mark> `https://app.bugsplat.com/api/user/users`

Adds a new user to the specified database. `PUT` is also accepted at this same endpoint and behaves identically, including updating the `rights` of an existing user.

#### Request Body

| Name     | Type   | Description                                                                    |
| -------- | ------ | ------------------------------------------------------------------------------ |
| database | string | BugSplat database to add the user to                                           |
| username | string | Email of user to be added to the database                                      |
| rights   | number | Optional. `1` for unrestricted access, `0` for restricted access (default `0`) |

{% tabs %}
{% tab title="200 " %}

```json
{
    "status": "success",
    "companyId": 1234,
    "database": 4321,
    "uId": 55411
}
```

{% endtab %}
{% endtabs %}

### Curl Example

```bash
curl --location 'https://app.bugsplat.com/api/user/users' \
--header 'xsrf-token: ajKqRF12QJJ3IlLFdCEH0RhMjpuD5scz86mul3zdjTYA' \
--header 'Cookie: user=fred%40bugsplat.com; PHPSESSID=4g3pr9rdtehoddac9ohrt1qrc3cehg54; xsrf-token=ajKqRF12QJJ3IlLFdCEH0RhMjpuD5scz86mul3zdjTYA' \
--form 'database="fred"' \
--form 'username="name@test.com"'
```

## Delete Users

<mark style="color:red;">`DELETE`</mark> `https://app.bugsplat.com/api/user/users`

Removes a user from the specified database. The authenticated user must not be restricted for this call to succeed.

#### Query Parameters

| Name     | Type   | Description                              |
| -------- | ------ | ---------------------------------------- |
| database | string | BugSplat database that contains the user |
| username | string | Email of the user to remove              |

{% tabs %}
{% tab title="200 " %}

```json
{
    "status": "success",
    "uId": 55411,
}
```

{% endtab %}
{% endtabs %}

### Curl Example

```bash
curl --location --request DELETE 'https://app.bugsplat.com/api/user/users?database=fred&username=name%40test.com' \
--header 'xsrf-token: ajKqRF12QJJ3IlLFdCEH0RhMjpuD5scz86mul3zdjTYA' \
--header 'Cookie: user=fred%40bugsplat.com; PHPSESSID=4g3pr9rdtehoddac9ohrt1qrc3cehg54; xsrf-token=ajKqRF12QJJ3IlLFdCEH0RhMjpuD5scz86mul3zdjTYA'
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bugsplat.com/api-reference/api/users.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
