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

# Users API

API endpoints for managing System Access User objects.

**Base path:** `/users/`

***

## List Users

Queries users registered on the Autosky platform and linked to Clients.

```http
GET /users/
```

### Query parameters (optional)

| Parameter  | Type   | Description                           |
| ---------- | ------ | ------------------------------------- |
| `cli_uuid` | string | Client UUID to filter specific users. |

### Response

**Status:** `200 OK`

```json
[
    {
        "nome": "João",
        "sobrenome": "Souza",
        "email": "joao.souza@dominio.com",
        "ativo": true,
        "username": "joao.souza",
        "usr_uuid": "3bc705ab-5536-4193-bd5c-2d3e8ffd2e5b",
        "external_ad": false
    }
]
```

***

## Get User Data

Retrieves data for a specific user by their UUID. In addition to the fields from the user listing, the `clients` field is also included.

```http
GET /users/{usr_uuid}
```

### Path parameters

| Parameter  | Required | Description |
| ---------- | -------- | ----------- |
| `usr_uuid` | Yes      | User UUID   |

### Response

**Status:** `200 OK`

```json
{
    "nome": "João",
    "sobrenome": "Souza",
    "email": "joao.souza@dominio.com",
    "ativo": true,
    "username": "joao.souza",
    "usr_uuid": "3bc705ab-5536-4193-bd5c-2d3e8ffd2e5b",
    "clients": [
        {
            "cli_uuid": "79ea8324-4889-4729-8bf0-bc1c40b38273",
            "nome": "MeuCliente001",
            "grupo_seguranca": "Cliente001",
            "email_admin": "email-adm@dominio.com",
            "has_license_limit": false,
            "license_limit": 0,
            "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b"
        }
    ],
    "external_ad": false
}
```

***

## Create User

Performs the registration procedure for a new User on the platform.&#x20;

* If the User already exists, this procedure will only link them to the client passed as a parameter.
* Store the returned UUID from the user registration for future modifications if necessary.&#x20;
* If you have a specific Active Directory for your environment, use the `external_ad=true` property to set the password during registration.

```http
POST /users/
```

### Request Body

| Field                   | Type    | Required | Description                                                       |
| ----------------------- | ------- | -------- | ----------------------------------------------------------------- |
| `nome`                  | string  | Yes      | User's first name                                                 |
| `sobrenome`             | string  | No       | User's last name                                                  |
| `email`                 | string  | Yes      | User's logon email                                                |
| `ativo`                 | boolean | No       | If the user is active                                             |
| `username`              | string  | No       | User's name in AD.                                                |
| `password`              | string  | No       | User's password.                                                  |
| `cli_uuid`              | string  | Yes      | Client UUID where the user is being registered                    |
| `description`           | string  | No       | Additional user information                                       |
| `fullname`              | string  | No       | User's full name, must contain at least two separated words       |
| `external_ad`           | boolean | No       | Set to true if you have your own environment Active Directory.    |
| `send_activation_email` | boolean | No       | Indicates whether an activation email should be sent to the user. |

### Sample request

```json
{
    "nome": "Joao",
    "sobrenome": "Souza",
    "email": "joao.souza@dominio.com",
    "ativo": true,
    "username": "joao.souza",
    "password": "senha123",
    "cli_uuid": "769a0f4e-16a8-422a-99ab-d8c416137d4c",
    "description": "Informações do Usuário XXXX",
    "fullname": "Joao Souza Martins",
    "external_ad": false,
    "send_activation_email": false
}
```

### Response

**Status:** `200 OK`

```json
{
    "nome": "Joao",
    "sobrenome": "Souza",
    "email": "joao.souza@dominio.com",
    "ativo": true,
    "username": "joao.souza",
    "usr_uuid": "3bc705ab-5536-4193-bd5c-2d3e8ffd2e5b",
    "clients": [],
    "external_ad": true
}
```

***

## Edit User

Allows you to edit user information. Only certain information can be modified.

```http
PUT /users/{usr_uuid}
```

### Path parameters

| Parameter  | Required | Description |
| ---------- | -------- | ----------- |
| `usr_uuid` | Yes      | User UUID   |

### Request Body

| Field         | Type    | Description            |
| ------------- | ------- | ---------------------- |
| `nome`        | string  | User's first name      |
| `sobrenome`   | string  | User's last name       |
| `ativo`       | boolean | If the user is active  |
| `password`    | string  | User's password.       |
| `description` | string  | Additional Information |

### Sample request

```json
{
    "nome": "Joao",
    "sobrenome": "Souza",
    "ativo": true,
    "password": "senha123"
}
```

### Response

**Status:** `200 OK`

Returns the full updated user object, including the `clients` array.

***

## Enable / Disable User

Enable / Disable User

```http
PATCH /users/{usr_uuid}
```

### Path parameters

| Parameter  | Required | Description |
| ---------- | -------- | ----------- |
| `usr_uuid` | Yes      | User UUID   |

### Request Body

| Field                   | Type    | Required | Description                                     |
| ----------------------- | ------- | -------- | ----------------------------------------------- |
| `ativo`                 | boolean | Yes      | `true` to enable, `false` to disable            |
| `send_activation_email` | boolean | No       | Whether to send activation email                |
| `cli_uuid`              | string  | No       | Customer UUID associated with sending the email |

### Sample request

```json
{
    "ativo": true,
    "send_activation_email": false,
    "cli_uuid": "769a0f4e-16a8-422a-99ab-d8c416137d4c"
}
```

### Response

**Status:** `200 OK`

```json
{
    "nome": "João",
    "sobrenome": "Souza",
    "email": "joao.souza@dominio.com",
    "ativo": true,
    "username": "joao.souza",
    "cli_uuid": "769a0f4e-16a8-422a-99ab-d8c416137d4c"
}
```

***

## Change user password

Modifies a user's access password.

{% hint style="info" %}
**Note:** Password information is not stored in the Autosky platform database. It is stored directly in the authentication AD defined on the platform.
{% endhint %}

```http
PATCH /users/{usr_uuid}
```

### Path parameters

| Parameter  | Required | Description |
| ---------- | -------- | ----------- |
| `usr_uuid` | Yes      | User UUID   |

### Request Body

| Field      | Type   | Required | Description       |
| ---------- | ------ | -------- | ----------------- |
| `password` | string | Yes      | New user password |

### Sample request

```json
{
    "password": "NovaSenhaSegura@2024!"
}
```

### Response

**Status:** `200 OK`

```json
{
    "status": "success"
}
```

***

## Remove User

Deletes a user from the platform.

```http
DELETE /users/{usr_uuid}
```

### Path parameters

| Parameter  | Required | Description |
| ---------- | -------- | ----------- |
| `usr_uuid` | Yes      | User UUID   |

### Success Response

**Status:** `200 OK`

```json
{
    "status": "success"
}
```

### Error Response

**Status:** `404 Not Found`

```json
{
    "status": "error",
    "detail": "Não encontrado"
}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.skyone.cloud/english/api-skyone-autosky/users-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
