> ## Documentation Index
> Fetch the complete documentation index at: https://domoinc-openapi-sync-dataflows.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Users API

This API reference is useful if you are trying to manage Domo Users from anywhere 'outside' of your Domo instance such as:

1. Jupyter scripts
2. Code Engine Functions
3. Custom Java/Node/Python scripts

## Create User

<Card horizontal arrow title="Playground" icon="code" href="/api-reference/users-api-product/create-user" />

**Method**: `POST`\
**Endpoint**: `/api/identity/v1/users`

**Example**:

```json theme={"dark"}
{
  "method": "POST",
  "url": "https://{instance}.domo.com/api/identity/v1/users",
  "headers": {
    "X-DOMO-Developer-Token": "",
    "Content-Type": "application/json"
  },
  "body": {
    "displayName": string,
    "emailAddress": string,
    "roleId": number
  }
}
```

**Response**:

```text theme={"dark"}
HTTP/1.1 200 OK
  Content-Type: application/json;charset=UTF-8
  {
    "attributes": [
      {
        "key": string,
        "values": number|string[]
      },
    ],
    "id": number,
    "displayName": string,
    "userName": string,
    "roleId": number,
    "emailAddress": string
  }
```

***

## Get User By Id

<Card horizontal arrow title="Playground" icon="code" href="/api-reference/users-api-product/get-user-by-id" />

**Method**: `GET`\
**Endpoint**: `/api/identity/v1/users/{id}`\
**Path Parameters**:

* `id`- Id of the user requested.
  * Integer
  * Required

**Optional Query Parameters**:

* `parts`
  * Options
    * MINIMAL
    * SIMPLE
    * DETAILED
    * GROUPS
    * ROLE
  * Example
    * `/api/identity/v1/users/{id}?parts=DETAILED`

**Example**

```json theme={"dark"}
{
  "method": "GET",
  "url": "https://{instance}.domo.com/api/identity/v1/users/{id}",
  "headers": {
    "X-DOMO-Developer-Token": "",
    "Content-Type": "application/json"
  }
}
```

**Response**:

```text theme={"dark"}
HTTP/1.1 200 OK
  Content-Type: application/json;charset=UTF-8
  {
    "users": [
      {
        "attributes": [
          {
            "key": string,
            "values": number|string[]
          },
        ],
        "id": number,
        "displayName": string,
        "userName": string,
        "roleId": number,
        "emailAddress": string
      }
    ]
  }
```

***

## Get All Users

<Card horizontal arrow title="Playground" icon="code" href="/api-reference/users-api-product/get-all-users" />

**Method**: `GET`\
**Endpoint**: `/api/identity/v1/users`\
**Optional Query Parameters**:

* `parts`
  * Options
    * MINIMAL
    * SIMPLE
    * DETAILED
    * GROUPS
    * ROLE
  * Example
    * `/api/identity/v1/users?parts=DETAILED`

**Example**

```json theme={"dark"}
{
  "method": "GET",
  "url": "https://{instance}.domo.com/api/identity/v1/users",
  "headers": {
    "X-DOMO-Developer-Token": "",
    "Content-Type": "application/json"
  }
}
```

**Response**:

```text theme={"dark"}
HTTP/1.1 200 OK
  Content-Type: application/json;charset=UTF-8
  {
    "users": [
      {
        "attributes": [
          {
            "key": string,
            "values": number|string[]
          },
        ],
        "id": number,
        "displayName": string,
        "userName": string,
        "roleId": number,
        "emailAddress": string
      }
    ]
  }
```

***

## Update User

<Card horizontal arrow title="Playground" icon="code" href="/api-reference/users-api-product/update-user" />

**Method**: `PATCH`\
**Endpoint**: `/api/identity/v1/users/{id}`\
**Path Parameters**:

* `id` - Id of the user requested.
  * Integer
  * Required

**Example**:

```json theme={"dark"}
{
  "method": "PATCH",
  "url": "https://{instance}.domo.com/api/identity/v1/users/{id}",
  "headers": {
    "X-DOMO-Developer-Token": "",
    "Content-Type": "application/json",
    "body": {
      "roleId": 5
    }
  }
}
```

**Response**:

```text theme={"dark"}
HTTP/1.1 200 OK
  Content-Type: application/json;charset=UTF-8
  {
    "attributes": [
      {
        "key": string,
        "values": number|string[]
      },
    ],
    "id": number,
    "displayName": string,
    "userName": string,
    "roleId": number,
    "emailAddress": string
  }
```

***

## Delete User

<Card horizontal arrow title="Playground" icon="code" href="/api-reference/users-api-product/delete-user" />

**Method**: `DELETE`\
**Endpoint**: `/api/identity/v1/users/{id}`\
**Path Parameters**:

* `id` - Id of the user requested.
  * Integer
  * Required

**Example**:

```json theme={"dark"}
{
  "method": "DELETE",
  "url": "https://{instance}.domo.com/api/identity/v1/users/{id}",
  "headers": {
    "X-DOMO-Developer-Token": "",
    "Content-Type": "application/json",
    "body": {
      "roleId": 5
    }
  }
}
```

**Response**:

```text theme={"dark"}
HTTP/1.1 200 OK
  Content-Type: application/json;charset=UTF-8
  1
```
