> 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/clients-api.md).

# Clients API

FORMAT: 1A HOST: <https://meudominio.skyinone.net/v2/api/>

## API Autosky Platform

Communication and integration API for Skyone's Autosky platform. All rights reserved to Skyone ©

<https://skyone.solutions/>

## Group API

### About

This documentation presents the information required to integrate systems and platforms with the Autosky API. Through this API, it will be possible to perform integration procedures with the following objects:

* **Clients (User Groups)**
* **Users**
* **Applications**
* **User Sessions**
* **User Authentication**
* **User Logon**

### Version

V2.3 - (07/19/2024)

### Prerequisites

To use the APIs, you must have access to the authentication information provided by the Skyone integration team.

For Example:

* Authentication Token: **23a1e4e6f90546e498a8f66cf21e3fb3**
* Environment UUID: **6a6c7a07-bef1-4e42-942e-87277a8c2a84**
* Staging URL: **piloto.skyinone.net**
* Production URL: **meudominio.skyinone.net**

### API Call Authentication

Once you obtain your authentication token for the Autosky platform API calls, this token must be used in all API requests. There are two ways to use the authentication token:

#### Token via URL

In this method, the token must be sent as a query parameter in the API calls, for example:

<http://meudominio.skyinone.net/v2/api/clients/**?token=xxxxx>\*\*

#### Token via Header

When sending the token via header, it must be passed as a header in the API calls. The header must follow this format:

* **Authorization:xxxxxx**

In this example using HTTPie: http <http://meudominio.skyinone.net/v2/api/clients/> **Authorization:xxxx**

### Clients API \[/clients/]

API calls to operate Client objects (User Groups)

#### List Clients \[GET /clients/{?updated\_at\_after,updated\_at\_before,cli\_uuid,external\_client\_code}]

Retrieves clients registered on the Autosky platform.

* Parameters
  * updated\_at\_after (optional, string) - Filters clients updated on or after this date and time (inclusive). ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
  * updated\_at\_before (optional, string) - Filters clients updated on or before this date and time (inclusive). ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
  * cli\_uuid (optional, string or array) - Filters by the unique client identifier(s). Can be used as:
    * a single value: ?cli\_uuid=uuid1
    * multiple values: ?cli\_uuid=uuid1,uuid2
  * external\_client\_code (optional, string or array) - Filters by the external code(s) associated with the client. Can be used as:
    * a single value: ?external\_client\_code=code1
    * multiple values: ?external\_client\_code=code1,code2
* Response 200 (application/json)
  * Body

    ```
      [
              {
                  "cli_uuid": "0e92037b-ed77-4a38-ab35-909637bea146",
                  "nome": "Client Name",
                  "external_client_code": "External Client Code 1",
                  "grupo_seguranca": "Partner.Client-AD-Group-Name.9125b66",
                  "email_admin": "admin@email.com",
                  "has_license_limit": false,
                  "license_limit": 0,
                  "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
                  "in_maintenance": false,
                  "maintenance_msg": "",
                  "schedule_maintenance": false,
                  "schedule_maintenance_start": null,
                  "schedule_maintenance_end": null,
                  "schedule_maintenance_msg": "",
                  "terminate_sessions": false,
                  "schedule_warning": false,
                  "schedule_warning_start": null,
                  "schedule_warning_end": null,
                  "schedule_warning_msg": "",
                  "display_warning_to_logged_users": false,
                  "user_latest_login_at": null,
                  "created_at": "2025-03-13T11:47:45.445637-03:00",
                  "updated_at": "2025-03-13T11:47:45.445637-03:00",
                  "migrated_at": null,
                  "observations": ""
                  "active_sessions_count": 0,
              },
              {
                  "cli_uuid": "9125b661-952a-42c9-966b-6826775c5a9c",
                  "nome": "Client 2",
                  "external_client_code": "External Client Code 2",
                  "grupo_seguranca": "Partner.Client-AD-Group-Name.1125b56",
                  "email_admin": "admin@email.com",
                  "has_license_limit": false,
                  "license_limit": 0,
                  "amb_uuid": "dd2f7c4e-8dee-4ecc-8033-f21207945d55",
                  "in_maintenance": false,
                  "maintenance_msg": "",
                  "schedule_maintenance": false,
                  "schedule_maintenance_start": null,
                  "schedule_maintenance_end": null,
                  "schedule_maintenance_msg": "",
                  "terminate_sessions": false,
                  "schedule_warning": false,
                  "schedule_warning_start": null,
                  "schedule_warning_end": null,
                  "schedule_warning_msg": "",
                  "display_warning_to_logged_users": false,
                  "user_latest_login_at": null,
                  "created_at": "2025-03-13T11:47:45.445637-03:00",
                  "updated_at": "2025-03-13T11:47:45.445637-03:00",
                  "migrated_at": "2025-03-13T11:49:06.616983-03:00",
                  "observations": "",
                  "active_sessions_count": 0,
              }
      ]
    ```

#### Get Client Data \[GET /clients/{cli\_uuid}]

Retrieves data for a specific client by their UUID. In addition to the fields from the client listing, the "users" field is also included.

* Parameters
  * cli\_uuid (required) - Client UUID
* Response 200 (application/json)
  * Body

    ```
      {
          "cli_uuid": "0e92037b-ed77-4a38-ab35-909637bea146",
          "nome": "Client Name",
          "external_client_code": "External Client Code 1",
          "grupo_seguranca": "Partner.Client-AD-Group-Name.9125b66",
          "email_admin": "admin@email.com",
          "has_license_limit": false,
          "license_limit": 0,
          "users": [
              {
                  "nome": "User 1",
                  "sobrenome": "One",
                  "email": "name@example.com",
                  "ativo": true,
                  "username": "e8d3a5bc-32c0-4d57",
                  "usr_uuid": "e8d3a5bc-32c0-4d57-8127-d5453b568652",
                  "external_ad": false
              },
              {
                  "nome": "User 2",
                  "sobrenome": "Two",
                  "email": "two@example.com",
                  "ativo": true,
                  "username": "e8d3a5bc-32c0-4d57",
                  "usr_uuid": "e8d3a5bc-32c0-4d57-8127-d5453b568652",
                  "external_ad": false
              }
          ],
          "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
          "in_maintenance": false,
          "maintenance_msg": "",
          "schedule_maintenance": false,
          "schedule_maintenance_start": null,
          "schedule_maintenance_end": null,
          "schedule_maintenance_msg": "",
          "terminate_sessions": false,
          "schedule_warning": false,
          "schedule_warning_start": null,
          "schedule_warning_end": null,
          "schedule_warning_msg": "",
          "display_warning_to_logged_users": false,
          "user_latest_login_at": null,
          "created_at": "2025-03-13T11:47:45.445637-03:00",
          "updated_at": "2025-03-13T11:47:45.445637-03:00",
          "migrated_at": null,
          "observations": "",
          "active_sessions_count": 0,
      }
    ```

#### Get Clients from an Environment \[GET /clients/ambientes/{ambiente\_uuid}]

Retrieves all clients from a specific environment by its UUID.

* Parameters
  * ambiente\_uuid (required) - Environment UUID
* Response 200 (application/json)
  * Body

    ```
      [
              {
                  "cli_uuid": "0e92037b-ed77-4a38-ab35-909637bea146",
                  "nome": "Client Name",
                  "external_client_code": "External Client Code 1",
                  "grupo_seguranca": "Partner.Client-AD-Group-Name.9125b66",
                  "email_admin": "admin@email.com",
                  "has_license_limit": false,
                  "license_limit": 0,
                  "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
                  "in_maintenance": false,
                  "maintenance_msg": "",
                  "schedule_maintenance": false,
                  "schedule_maintenance_start": null,
                  "schedule_maintenance_end": null,
                  "schedule_maintenance_msg": "",
                  "terminate_sessions": false,
                  "schedule_warning": false,
                  "schedule_warning_start": null,
                  "schedule_warning_end": null,
                  "schedule_warning_msg": "",
                  "display_warning_to_logged_users": false,
                  "user_latest_login_at": null,
                  "created_at": "2025-03-13T11:47:45.445637-03:00",
                  "updated_at": "2025-03-13T11:47:45.445637-03:00",
                  "migrated_at": null,
                  "observations": "",
                  "active_sessions_count": 0,
              },
              {
                  "cli_uuid": "9125b661-952a-42c9-966b-6826775c5a9c",
                  "nome": "Client 2",
                  "external_client_code": "External Client Code 2",
                  "grupo_seguranca": "Partner.Client-AD-Group-Name.1125b56",
                  "email_admin": "admin@email.com",
                  "has_license_limit": false,
                  "license_limit": 0,
                  "amb_uuid": "dd2f7c4e-8dee-4ecc-8033-f21207945d55",
                  "in_maintenance": false,
                  "maintenance_msg": "",
                  "schedule_maintenance": false,
                  "schedule_maintenance_start": null,
                  "schedule_maintenance_end": null,
                  "schedule_maintenance_msg": "",
                  "terminate_sessions": false,
                  "schedule_warning": false,
                  "schedule_warning_start": null,
                  "schedule_warning_end": null,
                  "schedule_warning_msg": "",
                  "display_warning_to_logged_users": false,
                  "user_latest_login_at": null,
                  "created_at": "2025-03-13T11:47:45.445637-03:00",
                  "updated_at": "2025-03-13T11:47:45.445637-03:00",
                  "migrated_at": null,
                  "observations": "",
                  "active_sessions_count": 0,
              }
      ]
    ```

#### Create Client \[POST]

Registers a new client on the platform.

* Request (application/json)
  * Attributes
    * nome: MeuCliente001 (string, required) - Client name on the platform.
    * external\_client\_code: External Client Code 1 (string) - Custom client code.
    * email\_admin: `email-adm@dominio.com` (string, required) - Environment Administrator email.
    * amb\_uuid: `715088c9-9f21-424e-bcd5-5eacc0ce165b` (string, required) - Environment ID to which the client will be linked.
    * description: `Informações Adicionais do usuário` (string) - Additional client information (Optional).
    * grupo\_seguranca: Cliente001 (string) - AD Security Group to be created (Optional).
    * block\_multiple\_session: false (boolean) - Enables or disables blocking multiple sessions for the same user.
    * has\_license\_limit: false (boolean) - Whether the client has an access license limit (Optional).
    * license\_limit: 10 (number) - Number of access licenses (Optional).
    * ad\_add\_aditional\_group: Version001 (string) - AD Security Group to which this client's group should be linked (Optional).
    * in\_maintenance: false (boolean) - Enables or disables immediate maintenance on the Client (Optional).
    * maintenance\_msg: Mensagem de Manutenção Imediata (string) - Immediate maintenance message to be displayed to the user (Optional).
    * schedule\_maintenance: true (boolean, required) - Enables or disables scheduled maintenance based on defined start and end times.
    * schedule\_maintenance\_start: `2021-12-01T23:10:00.000-03:00` (string) - Defines the start date and time of the scheduled maintenance. Required when schedule\_maintenance is true.
    * schedule\_maintenance\_end: `2021-12-31T22:30:00.000-03:00` (string) - Defines the end date and time of the scheduled maintenance. Required when schedule\_maintenance is true.
    * schedule\_maintenance\_msg: Mensagem de Manutenção Programada (string) - Scheduled maintenance message to be displayed to users. Required when schedule\_maintenance is true.
    * terminate\_sessions: true (boolean) - When enabling scheduled maintenance, terminates active sessions and disconnects active users.
    * schedule\_warning: true (boolean, required) - Enables or disables the scheduled display of warnings to users based on defined start and end times.
    * schedule\_warning\_start: `2021-12-01T23:10:00.000-03:00` (string) - Defines the start date and time of the scheduled display of warnings. Required when schedule\_warning is true.
    * schedule\_warning\_end: `2021-12-31T22:30:00.000-03:00` (string) - Defines the end date and time of the scheduled display of warnings. Required when schedule\_warning is true.
    * schedule\_warning\_msg: Mensagem de Aviso aos Usuários (string) - Warning message to be displayed to users. Required when schedule\_warning is true.
    * display\_warning\_to\_logged\_users: true (boolean) - When enabled, ensures that already logged-in users also see the scheduled warning, in addition to new logins. Required when schedule\_warning is true.
    * observations: Observações adicionais (string) - Additional information about the Client (Optional).
  * Body

    ```
      {
          "nome": "Teste Cliente",
          "external_client_code": "External Client Code 1",
          "email_admin": "email-admin@email.com",
          "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
          "description": "",
          "grupo_seguranca": "Grupo de segurança",
          "block_multiple_session": false,
          "has_license_limit": false,
          "license_limit": 0,
          "in_maintenance": false,
          "maintenance_msg": "",
          "ad_add_aditional_group": "VersionProd",
      }
    ```
* Response 200 (application/json)
  * Body

    ```
      {
          "cli_uuid": "79ea8324-4889-4729-8bf0-bc1c40b38273",
          "nome": "MeuCliente001",
          "external_client_code": "External Client Code 1",
          "grupo_seguranca": "Cliente001",
          "email_admin": "email-adm@dominio.com",
          "block_multiple_session": false,
          "has_license_limit": false,
          "license_limit": 0,
          "users": [],
          "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
          "in_maintenance": false,
          "maintenance_msg": "",
          "schedule_maintenance": false,
          "schedule_maintenance_start": null,
          "schedule_maintenance_end": null,
          "schedule_maintenance_msg": "",
          "terminate_sessions": false,
          "schedule_warning": false,
          "schedule_warning_start": null,
          "schedule_warning_end": null,
          "schedule_warning_msg": "",
          "display_warning_to_logged_users": false,
          'user_latest_login_at': null,
          'created_at': '2025-03-13T11:53:05.504255-03:00',
          'updated_at': '2025-03-13T11:53:05.554461-03:00',
          'migrated_at': null,
          "observations": "",
          "active_sessions_count": 0,
      }
    ```

#### Update Client \[PATCH /clients/{cli\_uuid}]

Procedure used to update a Client's information.

* Parameters
  * cli\_uuid (required) - Client UUID
* Request (application/json)
  * Attributes
    * nome: MeuCliente001 (string) - Client name on the platform.
    * external\_client\_code: External Client Code 1 (string) - Custom client code.
    * email\_admin: `email-adm@dominio.com` (string) - Environment Administrator email.
    * amb\_uuid: `715088c9-9f21-424e-bcd5-5eacc0ce165b` (string) - Environment ID to which the client will be linked.
    * description: `Informações Adicionais do usuário` (string) - Additional client information.
    * block\_multiple\_session: false (boolean) - Enables or disables blocking multiple sessions for the same user.
    * grupo\_seguranca: Cliente001 (string) - AD Security Group to be created.
    * has\_license\_limit: false (boolean) - Whether the client has an access license limit.
    * license\_limit: 10 (number) - Number of access licenses.
    * ad\_add\_aditional\_group: Version002 (string) - AD Security Group to which this client's group should be linked.
    * ad\_remove\_aditional\_group: Version001 (string) - AD Security Group from which this client's group should be unlinked.
    * observations: Observações adicionais (string) - Additional information about the Client (Optional).
  * Body

    ```
      {
          "nome": "Teste Cliente",
          "external_client_code": "External Client Code 1",
          "email_admin": "email.admin@email.com",
          "amb_uuid": "6a6c7a07-bef1-4e42-942e-87277a8c2a84",
          "grupo_seguranca": "Grupo de segurança",
          "block_multiple_session": false,
          "has_license_limit": false,
          "license_limit": 0,
          "ad_add_aditional_group": "VersionProd",
          "in_maintenance": false,
          "maintenance_msg": ""
      }
    ```
* Response 200 (application/json)
  * Body

    ```
      {
          "cli_uuid": "79ea8324-4889-4729-8bf0-bc1c40b38273",
          "nome": "MeuCliente001",
          "external_client_code": "External Client Code 1",
          "grupo_seguranca": "Cliente001",
          "email_admin": "email-adm@dominio.com",
          "block_multiple_session": false,
          "has_license_limit": false,
          "license_limit": 0,
          "users": [],
          "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
          "in_maintenance": false,
          "maintenance_msg": "",
          "schedule_maintenance": false,
          "schedule_maintenance_start": null,
          "schedule_maintenance_end": null,
          "schedule_maintenance_msg": "",
          "terminate_sessions": false,
          "schedule_warning": false,
          "schedule_warning_start": null,
          "schedule_warning_end": null,
          "schedule_warning_msg": "",
          "display_warning_to_logged_users": false,
          'user_latest_login_at': null,
          'created_at': '2025-03-13T11:53:05.504255-03:00',
          'updated_at': '2025-03-13T11:53:05.554461-03:00',
          'migrated_at': null,
          "observations": "",
          "active_sessions_count": 0,
      }
    ```

#### Update Clients in a Specific Environment \[PATCH /clients/?amb\_uuid={ambiente\_uuid}]

Procedure used to update the information of all clients within an environment.

* Parameters
  * ambiente\_uuid (required) - Environment UUID
* Request (application/json)
  * Attributes
    * email\_admin: `email-adm@dominio.com` (string) - Environment Administrator email.
    * amb\_uuid: `715088c9-9f21-424e-bcd5-5eacc0ce165b` (string) - Environment ID to which the client will be linked.
    * description: `Informações Adicionais do usuário` (string) - Additional client information.
    * block\_multiple\_session: false (boolean) - Enables or disables blocking multiple sessions for the same user.
    * grupo\_seguranca: Cliente001 (string) - AD Security Group to be created.
    * has\_license\_limit: false (boolean) - Whether the client has an access license limit.
    * license\_limit: 10 (number) - Number of access licenses.
    * ad\_add\_aditional\_group: Version002 (string) - AD Security Group to which this client's group should be linked.
    * ad\_remove\_aditional\_group: Version001 (string) - AD Security Group from which this client's group should be unlinked.
  * Body

    ```
      {
          "email_admin": "email.admin@email.com",
          "amb_uuid": "6a6c7a07-bef1-4e42-942e-87277a8c2a84",
          "grupo_seguranca": "Grupo de segurança",
          "block_multiple_session": false,
          "has_license_limit": false,
          "license_limit": 0,
          "ad_add_aditional_group": "VersionProd",
          "in_maintenance": false,
          "maintenance_msg": ""
      }
    ```
* Response 200 (application/json)
  * Body

    ```
      {
          "detail": "Clients updated successfully"
      }
    ```

#### Delete Client \[DELETE /clients/{cli\_uuid}]

Deletes a client from the platform.

* Parameters
  * cli\_uuid (required) - Client UUID
* Response 200 (application/json)
  * Body

    ```
      {
          "status": "success"
      }
    ```
* Response 400 (application/json)
  * Body

    ```
      {
          "status": "error",
          "code": 'CLI001,
          "message": "The client in question has linked users. Please delete the users first before deleting this client."
      }
    ```

#### Block / Unblock Client \[PATCH /clients/{cli\_uuid}]

Performs the immediate blocking or unblocking of a client on the platform.

* Parameters
  * cli\_uuid (required) - Client UUID
* Request (application/json)
  * Attributes
    * in\_maintenance: true (boolean, required) - True or False to set maintenance state.
    * maintenance\_msg: Ambiente em Atualização (string) - Message that will be presented to users during their next login.
* Response 200 (application/json)
  * Body

    ```
      {
          "cli_uuid": "79ea8324-4889-4729-8bf0-bc1c40b38273",
          "nome": "Teste Cliente",
          "grupo_seguranca": "Grupo.Teste Cliente.79ea832",
          "email_admin": "admin@email.com",
          "has_license_limit": false,
          "license_limit": 0,
          "users": [],
          "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
          "in_maintenance": true,
          "maintenance_msg": "Ambiente em Atualização",
          "schedule_maintenance": false,
          "schedule_maintenance_start": null,
          "schedule_maintenance_end": null,
          "schedule_maintenance_msg": "",
          "terminate_sessions": false,
          "schedule_warning": false,
          "schedule_warning_start": null,
          "schedule_warning_end": null,
          "schedule_warning_msg": "",
          "display_warning_to_logged_users": false,
          'user_latest_login_at': null,
          'created_at': '2025-03-13T11:53:05.504255-03:00',
          'updated_at': '2025-03-13T11:53:05.554461-03:00',
          'migrated_at': null,
          "observations": "",
          "active_sessions_count": 0,
      }
    ```

#### Enable / Disable Scheduled Maintenance \[PATCH /clients/{cli\_uuid}]

Performs the scheduled blocking or unblocking of a client on the platform. All fields below are required when schedule\_maintenance is true.

* Parameters
  * cli\_uuid (required) - Client UUID
* Request (application/json)
  * Attributes
    * schedule\_maintenance: true (boolean, required) - Enables or disables scheduled maintenance based on defined start and end times.
    * schedule\_maintenance\_start: `2021-12-01T23:10:00.000-03:00` (string) - Defines the start date and time of the scheduled maintenance.
    * schedule\_maintenance\_end: `2021-12-31T22:30:00.000-03:00` (string) - Defines the end date and time of the scheduled maintenance.
    * schedule\_maintenance\_msg: Mensagem de Manutenção Programada (string) - Scheduled maintenance message to be displayed to users.
    * terminate\_sessions: true (boolean) - When enabling scheduled maintenance, terminates active sessions and disconnects active users.
* Response 200 (application/json)
  * Body

    ```
      {
          "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,
          "users": [],
          "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
          "in_maintenance": false,
          "maintenance_msg": "",
          "schedule_maintenance": true,
          "schedule_maintenance_start": "2021-12-01T23:10:00.000-03:00",
          "schedule_maintenance_end": "2021-12-31T22:30:00.000-03:00",
          "schedule_maintenance_msg": "Mensagem de Manutenção Programada",
          "terminate_sessions": true,
          "schedule_warning": false,
          "schedule_warning_start": null,
          "schedule_warning_end": null,
          "schedule_warning_msg": "",
          "display_warning_to_logged_users": false,
          'user_latest_login_at': null,
          'created_at': '2025-03-13T11:53:05.504255-03:00',
          'updated_at': '2025-03-13T11:53:05.554461-03:00',
          'migrated_at': null,
          "observations": "",
          "active_sessions_count": 0,
      }
    ```

#### Enable / Disable Batch Scheduled Maintenance \[PATCH /clients/batch-scheduled-actions/]

Performs the scheduled blocking or unblocking of clients in batch on the platform. All fields within `scheduled_data` are required when `schedule_maintenance` is `true`.

* Request (application/json)
  * Attributes
    * cli\_uuids: `79ea8324-4889-4729-8bf0-bc1c40b38273` (array, required) - List of client UUIDs to be scheduled.
    * scheduled\_data (object) - The same fields considered when this action is performed for a single client.
    * schedule\_maintenance: true (boolean, required) - Enables or disables scheduled maintenance based on defined start and end times.
    * schedule\_maintenance\_start: `2021-12-01T23:10:00.000-03:00` (string) - Defines the start date and time of the scheduled maintenance.
    * schedule\_maintenance\_end: `2021-12-31T22:30:00.000-03:00` (string) - Defines the end date and time of the scheduled maintenance.
    * schedule\_maintenance\_msg: Mensagem de Manutenção Programada (string) - Scheduled maintenance message to be displayed to users.
    * terminate\_sessions: true (boolean) - When enabling scheduled maintenance, terminates active sessions and disconnects active users.
* Response 200 (application/json)
  * Body

    \[ { "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, "users": \[], "amb\_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b", "in\_maintenance": false, "maintenance\_msg": "", "schedule\_maintenance": true, "schedule\_maintenance\_start": "2021-12-01T23:10:00.000-03:00", "schedule\_maintenance\_end": "2021-12-31T22:30:00.000-03:00", "schedule\_maintenance\_msg": "Mensagem de Manutenção Programada", "terminate\_sessions": true, "schedule\_warning": false, "schedule\_warning\_start": null, "schedule\_warning\_end": null, "schedule\_warning\_msg": "", "display\_warning\_to\_logged\_users": false, 'user\_latest\_login\_at': null, 'created\_at': '2025-03-13T11:53:05.504255-03:00', 'updated\_at': '2025-03-13T11:53:05.554461-03:00', 'migrated\_at': null, "observations": "", "active\_sessions\_count": 0, } ]

#### Enable / Disable Scheduled Warning Display \[PATCH /clients/{cli\_uuid}]

Enables or disables the scheduled display of warnings for a client on the platform. All fields below are required when schedule\_warning is true.

* Parameters
  * cli\_uuid (required) - Client UUID
* Request (application/json)
  * Attributes
    * schedule\_warning: true (boolean, required) - Enables or disables the scheduled display of warnings to users based on defined start and end times.
    * schedule\_warning\_start: `2021-12-01T23:10:00.000-03:00` (string) - Defines the start date and time of the scheduled display of warnings.
    * schedule\_warning\_end: `2021-12-31T22:30:00.000-03:00` (string) - Defines the end date and time of the scheduled display of warnings.
    * schedule\_warning\_msg: Mensagem de Aviso aos Usuários (string) - Warning message to be displayed to users.
    * display\_warning\_to\_logged\_users: true (boolean) - When enabled, ensures that already logged-in users also see the scheduled warning, in addition to new logins.
* Response 200 (application/json)
  * Body

    ```
      {
          "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,
          "users": [],
          "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
          "in_maintenance": false,
          "maintenance_msg": "",
          "schedule_maintenance": false,
          "schedule_maintenance_start": null,
          "schedule_maintenance_end": null,
          "schedule_maintenance_msg": "",
          "terminate_sessions": false,
          "schedule_warning": true,
          "schedule_warning_start": "2021-12-01T23:10:00.000-03:00",
          "schedule_warning_end": "2021-12-31T22:30:00.000-03:00",
          "schedule_warning_msg": "Mensagem de Aviso aos Usuários",
          "display_warning_to_logged_users": true,
          'user_latest_login_at': null,
          'created_at': '2025-03-13T11:53:05.504255-03:00',
          'updated_at': '2025-03-13T11:53:05.554461-03:00',
          'migrated_at': null,
          "observations": "",
          "active_sessions_count": 0,
      }
    ```

#### Enable / Disable Batch Scheduled Warning Display \[PATCH /clients/batch-scheduled-actions/]

Enables or disables the scheduled display of warnings for clients in batch on the platform. All fields within `scheduled_data` are required when `schedule_warning` is `true`.

* Request (application/json)
  * Attributes
    * cli\_uuids: `79ea8324-4889-4729-8bf0-bc1c40b38273` (array, required) - List of client UUIDs to be scheduled.
    * scheduled\_data (object) - The same fields considered when this action is performed for a single client.
    * schedule\_warning: true (boolean, required) - Enables or disables the scheduled display of warnings to users based on defined start and end times.
    * schedule\_warning\_start: `2021-12-01T23:10:00.000-03:00` (string) - Defines the start date and time of the scheduled display of warnings.
    * schedule\_warning\_end: `2021-12-31T22:30:00.000-03:00` (string) - Defines the end date and time of the scheduled display of warnings.
    * schedule\_warning\_msg: Mensagem de Aviso aos Usuários (string) - Warning message to be displayed to users.
    * display\_warning\_to\_logged\_users: true (boolean) - When enabled, ensures that already logged-in users also see the scheduled warning, in addition to new logins.
* Response 200 (application/json)
  * Body

    ```
      {
          "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,
          "users": [],
          "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
          "in_maintenance": false,
          "maintenance_msg": "",
          "schedule_maintenance": false,
          "schedule_maintenance_start": null,
          "schedule_maintenance_end": null,
          "schedule_maintenance_msg": "",
          "terminate_sessions": false,
          "schedule_warning": true,
          "schedule_warning_start": "2021-12-01T23:10:00.000-03:00",
          "schedule_warning_end": "2021-12-31T22:30:00.000-03:00",
          "schedule_warning_msg": "Mensagem de Aviso aos Usuários",
          "display_warning_to_logged_users": true,
          'user_latest_login_at': null,
          'created_at': '2025-03-13T11:53:05.504255-03:00',
          'updated_at': '2025-03-13T11:53:05.554461-03:00',
          'migrated_at': null,
          "observations": "",
          "active_sessions_count": 0,
      }
    ```

### Preparation Server API \[/environments/{amb\_uuid}/servers/template/]

API calls to execute actions on an environment's preparation server

#### Get Preparation Server Data \[GET]

Retrieves the data of the environment's preparation server.

* Parameters
  * amb\_uuid (required) - Environment UUID
* Attributes
  * force\_refresh: false (boolean, optional) - Forces the refresh of the preparation server information with the provider.
* Response 200 (application/json)
  * Body

    ```
      {
        "instance_id": "ocid1.instance.oc1.sa-saopaulo-1.antxxptoftpxptocmgr2i3t37ruxpto2kof5nh6k5xkrfuupjkyoqbkwxpto",
        "name": "TEMPLATE_SERVER_NAME",
        "instance_state": "RUNNING",  
        # "RUNNING"/"STOPPED"/"STOPPING"/"PENDING"/"TERMINATED"/"WARNING"
        "public_ip": "1.2.3.4",
        "private_ip": "4.3.2.1",
        "stop_time": "2021/03/15 19:42:25"  # "N/A"
      }
    ```

#### Start Preparation Server \[POST /environments/{amb\_uuid}/servers/template/start]

Starts the environment's preparation server.

* Parameters
  * amb\_uuid (required) - Environment UUID
* Response 204 (application/json)

#### Stop Preparation Server \[POST /environments/{amb\_uuid}/servers/template/stop]

Stops the environment's preparation server.

* Parameters
  * amb\_uuid (required) - Environment UUID
* Response 204 (application/json)

#### Publish a Default Image \[POST /environments/{amb\_uuid}/servers/template/publish/]

Starts the default publication process for the environment's preparation instance.

* Parameters
  * amb\_uuid (required) - Environment UUID
* Response 202 (application/json)
  * Body

    ```
      {
          "status": 202,
          "message": "Publicacao iniciada com sucesso.",
          "request_id" "149cbd70-5241-4e62-88a7-c87bcdf2eecc"
      }
    ```

#### Image Publication Status \[GET /environments/{amb\_uuid}/servers/template/publish/{request\_id}]

Retrieves the image publication status of the environment for the specified request.

* Parameters
  * amb\_uuid (required) - Environment UUID
  * request\_id (required) - Publication request UUID
* Response 200 (application/json)
  * Body

    ```
      {
          "status": 200,
          "image_publication_status": "PUBLISHING", # "PUBLISHING"/"PUBLISHED"/"ERROR"
          "message" "Publicação em andamento."
      }
    ```

### Optimized Preparation Server API \[/environments/{amb\_uuid}/servers/template/optimized-publish/]

API calls to publish and verify the publication status of environment preparation servers

#### Publish an Image in an Optimized Way - Default \[POST /environments/{amb\_uuid}/servers/template/optimized-publish/]

Starts the publication process of the environment's preparation instance using the default mode. The default publication model sends `block_instances` as `false` in the request body.

* Parameters
  * amb\_uuid (required) - Environment UUID
* Request (application/json)
  * Attributes
    * stop\_server: false (boolean) - This option allows defining whether the preparation server needs to be stopped when creating the image. If set to false, the server will remain available during creation.
    * notify\_list: `email-01@dominio.com`, `email-02@dominio.com` (array) - List of emails to be notified when the publication finishes.
    * replace\_instances: (object) - Details of the publication configurations.
      * block\_instances: false (boolean) - After publication, instances with the updated version will be started, and instances with previous versions will not be blocked.
  * Body

    { "stop\_server": false, "notify\_list": \[ "<email-01@dominio.com>", "<email-02@dominio.com>" ], "replace\_instances": { "block\_instances": false } }
* Response 202 (application/json)
  * Body

    ```
      {
          "status": 202,
          "message": "Publicacao iniciada com sucesso.",
          "request_id" "149cbd70-5241-4e62-88a7-c87bcdf2eecc"
      }
    ```

#### Publish an Image in an Optimized Way - Block Old Instances \[POST /environments/{amb\_uuid}/servers/template/optimized-publish/]

Starts the publication process while blocking instances running the previous image version. The body sends `block_instances` as `true`. The `blocked_ttl_minutes` field is optional: allowed values are **5**, **15**, **30**, or **60**; if omitted (or `null`), **30** is used. The value is stored in the blocked instances and defines the timeframe until termination after blocking. The `notify_users` field is optional and defaults to `true` when omitted: if `true`, connected users are notified **immediately** upon blocking that the instance will be terminated after `blocked_ttl_minutes` minutes. The optional `instance_block_user_message` field defines the text of this notification; if omitted or empty, the default system message is used.

* Parameters
  * amb\_uuid (required) - Environment UUID
* Request (application/json)
  * Attributes
    * stop\_server: false (boolean) - This option allows defining whether the preparation server needs to be stopped when creating the image. If set to false, the server will remain available during creation.
    * notify\_list: `email-01@dominio.com`, `email-02@dominio.com` (array) - List of emails to be notified when the publication finishes.
    * replace\_instances: (object) - Details of the publication configurations.
      * block\_instances: true (boolean) - After publication, instances with the updated version will be started, and instances with previous versions will be blocked.
    * blocked\_ttl\_minutes: 30 (number, optional) - Minutes after blocking until the instance is terminated. Only **5**, **15**, **30**, or **60**; defaults to **30** if omitted.
    * notify\_users: true (boolean, optional) - If `true` (default), immediately notifies connected users that the instance will be terminated after `blocked_ttl_minutes` minutes. Only applicable when `block_instances` is `true`.
      * instance\_block\_user\_message: \`\` (string, optional) - Message displayed to the user in the notification sent at the moment of blocking (when `notify_users` is `true`).
  * Body

    { "stop\_server": false, "notify\_list": \[ "<email-01@dominio.com>", "<email-02@dominio.com>" ], "replace\_instances": { "block\_instances": true, "instance\_block\_user\_message": "Maintenance: save your work." } }
* Response 202 (application/json)
  * Body

    ```
      {
          "status": 202,
          "message": "Publicacao iniciada com sucesso.",
          "request_id" "149cbd70-5241-4e62-88a7-c87bcdf2eecc"
      }
    ```

#### Publish an Image in an Optimized Way - Stop Preparation Server on Image Creation \[POST /environments/{amb\_uuid}/servers/template/optimized-publish/]

Starts the publication process of the environment's preparation instance, leaving the server unavailable during the creation of the publication. All routes listed above accept the `stop_server` option in the request body set to `true` or `false`, and this option manages whether the preparation server should be stopped or not.

* Parameters
  * amb\_uuid (required) - Environment UUID
* Request (application/json)
  * Attributes
    * stop\_server: true (boolean) - This option allows defining whether the preparation server needs to be stopped when creating the image. If set to false, the server will remain available during creation.
    * notify\_list: `email-01@dominio.com`, `email-02@dominio.com` (array) - List of emails to be notified when the publication finishes.
    * replace\_instances: (object) - Details of the publication configurations.
      * block\_instances: false (boolean) - After publication, instances with the updated version will be started, and instances with previous versions will not be blocked.
  * Body

    { "stop\_server": true, "notify\_list": \[ "<email-01@dominio.com>", "<email-02@dominio.com>" ], "replace\_instances": { "block\_instances": false } }
* Response 202 (application/json)
  * Body

    ```
      {
          "status": 202,
          "message": "Publicacao iniciada com sucesso.",
          "request_id" "149cbd70-5241-4e62-88a7-c87bcdf2eecc"
      }
    ```

#### Verify Image Publication Status \[GET /environments/{amb\_uuid}/servers/template/optimized-publish/{request\_id}/]

Verifies the image publication status of the environment for the specified request.

* Parameters
  * amb\_uuid (required) - Environment UUID
  * request\_id (required) - Publication request UUID
* Response 200 (application/json)
  * Body

    ```
      {
          "status": 200,
          "image_publication_status": "PUBLISHING", # "PUBLISHING"/"PUBLISHED"/"ERROR"
          "message": "Publicação em andamento."
      }
    ```

### Environment Clients API \[/clients/ambientes/{amb\_uuid}]

API calls to list all clients belonging to a specific environment

#### List Clients in the Environment \[GET]

Endpoint to query clients registered in the desired environment.

* Parameters
  * amb\_uuid (required)
* Response 200 (application/json)
  * Body

    ```
      [
              {
                  "cli_uuid": "0e92037b-ed77-4a38-ab35-909637bea146",
                  "nome": "Client Name",
                  "grupo_seguranca": "Partner.Client-AD-Group-Name.9125b66",
                  "email_admin": "admin@email.com",
                  "has_license_limit": false,
                  "license_limit": 0,
                  "users": [
                      {
                          "nome": "User 1",
                          "sobrenome": "One",
                          "email": "name@example.com",
                          "ativo": true,
                          "username": "e8d3a5bc-32c0-4d57",
                          "usr_uuid": "e8d3a5bc-32c0-4d57-8127-d5453b568652",
                          "external_ad": false
                      },
                      {
                          "nome": "User 2",
                          "sobrenome": "Two",
                          "email": "two@example.com",
                          "ativo": true,
                          "username": "e8d3a5bc-32c0-4d57",
                          "usr_uuid": "e8d3a5bc-32c0-4d57-8127-d5453b568652",
                          "external_ad": false
                      }
                  ],
                  "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
                  "in_maintenance": false,
                  "maintenance_msg": "",
                  "schedule_maintenance": false,
                  "schedule_maintenance_start": null,
                  "schedule_maintenance_end": null,
                  "schedule_maintenance_msg": "",
                  "terminate_sessions": false,
                  "schedule_warning": false,
                  "schedule_warning_start": null,
                  "schedule_warning_end": null,
                  "schedule_warning_msg": "",
                  "display_warning_to_logged_users": false,
              }
      ]
    ```

### Environments API \[/environments/]

API calls for Environment operations

#### List Environments \[GET]

List of all environments.

* Response 200 (application/json)
  * Body

    ```
      [
          {
              "amb_uuid": "dd2f7c4e-8dee-4ecc-8033-f21207945d55",
              "nome": "Ambiente 1",
              "in_maintenance": false,
              "maintenance_msg": "Em manutenção",
              "schedule_maintenance": false,
              "schedule_maintenance_start": "2020-12-11T03:10:14-03:00",
              "schedule_maintenance_end": "2020-12-12T07:35:15-03:00",
              "schedule_maintenance_msg": "Em manutenção",
              "terminate_sessions": false,
              "terminate_instances": false,
              "schedule_warning": false,
              "schedule_warning_start": "2020-12-24T00:00:00-03:00",
              "schedule_warning_end": "2020-12-25T00:00:00-03:00",
              "schedule_warning_msg": "Feliz Natal!",
              "display_warning_to_logged_users": false,
              "environment_state": "available",
              "preparation_server": {
                  "instance_id": "ocid1.instance.oc1.sa-saopaulo-1.antxxptoftpxptocmgr2i3t37ruxpto2kof5nh6k5xkrfuupjkyoqbkwxpto",
                  "name": "TEMPLATE_SERVER_NAME",
                  "public_ip": "1.2.3.4",
                  "private_ip": "4.3.2.1",
                  "instance_state": "RUNNING",  # "RUNNING"/"STOPPED"/"STOPPING"/"PENDING"/"TERMINATED"/"WARNING"
                  "stop_time": "2021/03/15 19:42:25"  # "N/A"
              }
          },
          {
              "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
              "nome": "Ambiente 2",
              "in_maintenance": false,
              "maintenance_msg": "",
              "schedule_maintenance": false,
              "schedule_maintenance_start": null,
              "schedule_maintenance_end": null,
              "schedule_maintenance_msg": "",
              "terminate_sessions": false,
              "terminate_instances": false,
              "schedule_warning": false,
              "schedule_warning_start": null,
              "schedule_warning_end": null,
              "schedule_warning_msg": "",
              "display_warning_to_logged_users": false,
              "environment_state": "available",
              "preparation_server": null
          }
      ]
    ```

#### Get Environment Data \[GET /environments/{amb\_uuid}]

Retrieves data for a specific environment by its UUID.

* Parameters
  * amb\_uuid (required) - Environment UUID
* Response 200 (application/json)
  * Body

    ```
      [
          {
              "amb_uuid": "dd2f7c4e-8dee-4ecc-8033-f21207945d55",
              "nome": "Ambiente 1",
              "in_maintenance": false,
              "maintenance_msg": "Em manutenção",
              "schedule_maintenance": false,
              "schedule_maintenance_start": "2020-12-11T03:10:14-03:00",
              "schedule_maintenance_end": "2020-12-12T07:35:15-03:00",
              "schedule_maintenance_msg": "Em manutenção",
              "terminate_sessions": false,
              "terminate_instances": false,
              "schedule_warning": false,
              "schedule_warning_start": "2020-12-24T00:00:00-03:00",
              "schedule_warning_end": "2020-12-25T00:00:00-03:00",
              "schedule_warning_msg": "Feliz Natal!",
              "display_warning_to_logged_users": false,
              "environment_state": "available",
              "preparation_server": {
                  "instance_id": "ocid1.instance.oc1.sa-saopaulo-1.antxxptoftpxptocmgr2i3t37ruxpto2kof5nh6k5xkrfuupjkyoqbkwxpto",
                  "name": "TEMPLATE_SERVER_NAME",
                  "public_ip": "1.2.3.4",
                  "private_ip": "4.3.2.1",
                  "instance_state": "RUNNING",  # "RUNNING"/"STOPPED"/"STOPPING"/"PENDING"/"TERMINATED"/"WARNING"
                  "stop_time": "2021/03/15 19:42:25"  # "N/A"
              }
           }
      ]
    ```

#### Enable / Disable Immediate Maintenance \[PATCH /environments/{amb\_uuid}]

Enable or disable immediate maintenance across an entire environment.

* Parameters
  * amb\_uuid (required) - Environment UUID
* Request (application/json)
  * Attributes
    * in\_maintenance: true (boolean, required) - True or False to set maintenance state.
    * maintenance\_msg: Ambiente em Atualização (string) - Message that will be presented to users during their next login.
* Response 200 (application/json)
  * Body

    ```
      {
          "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
          "nome": "Ambiente 2",
          "in_maintenance": true,
          "maintenance_msg": "Em manutenção",
          "schedule_maintenance": false,
          "schedule_maintenance_start": null,
          "schedule_maintenance_end": null,
          "schedule_maintenance_msg": "",
          "terminate_sessions": false,
          "terminate_instances": false,
          "schedule_warning": false,
          "schedule_warning_start": null,
          "schedule_warning_end": null,
          "schedule_warning_msg": "",
          "display_warning_to_logged_users": false
      }
    ```

#### Enable / Disable Scheduled Maintenance \[PATCH /environments/{amb\_uuid}]

Enable or disable scheduled maintenance across an entire environment.

All fields below are required when schedule\_maintenance is true.

* Parameters
  * amb\_uuid (required) - Environment UUID
* Request (application/json)
  * Attributes
    * schedule\_maintenance: true (boolean, required) - Enables or disables scheduled maintenance based on defined start and end times.
    * schedule\_maintenance\_start: `2021-12-01T23:10:00.000-03:00` (string) - Defines the start date and time of the scheduled maintenance.
    * schedule\_maintenance\_end: `2021-12-31T22:30:00.000-03:00` (string) - Defines the end date and time of the scheduled maintenance.
    * schedule\_maintenance\_msg: Mensagem de Manutenção Programada (string) - Scheduled maintenance message to be displayed to users.
    * terminate\_sessions: true (boolean) - When enabling scheduled maintenance, terminates active sessions and disconnects active users.
    * terminate\_instances: true (boolean) - When enabling scheduled maintenance, terminates active instances, disconnecting logged-in users.
* Response 200 (application/json)
  * Body

    ```
      {
          "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
          "nome": "Ambiente 2",
          "in_maintenance": true,
          "maintenance_msg": "Em manutenção",
          "schedule_maintenance": true,
          "schedule_maintenance_start": "2020-12-11T03:10:14-03:00",
          "schedule_maintenance_end": "2020-12-12T07:35:15-03:00",
          "schedule_maintenance_msg": "Em manutenção",
          "terminate_sessions": false,
          "terminate_instances": false,
          "schedule_warning": false,
          "schedule_warning_start": null,
          "schedule_warning_end": null,
          "schedule_warning_msg": "",
          "display_warning_to_logged_users": false
      }
    ```

#### Enable / Disable Scheduled Warning Display \[PATCH /environments/{amb\_uuid}]

Enable or disable the scheduled display of warnings across an entire environment. All fields below are required when schedule\_warning is true.

* Parameters
  * amb\_uuid (required) - Environment UUID
* Request (application/json)
  * Attributes
    * schedule\_warning: true (boolean, required) - Enables or disables the scheduled display of warnings to users based on defined start and end times.
    * schedule\_warning\_start: `2021-12-01T23:10:00.000-03:00` (string) - Defines the start date and time of the scheduled display of warnings.
    * schedule\_warning\_end: `2021-12-31T22:30:00.000-03:00` (string) - Defines the end date and time of the scheduled display of warnings.
    * schedule\_warning\_msg: Mensagem de Aviso aos Usuários (string) - Warning message to be displayed to users.
    * display\_warning\_to\_logged\_users: true (boolean) - When enabled, ensures that already logged-in users also see the scheduled warning, in addition to new logins.
* Response 200 (application/json)
  * Body

    ```
      {
          "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
          "nome": "Ambiente 2",
          "in_maintenance": false,
          "maintenance_msg": "",
          "schedule_maintenance": false,
          "schedule_maintenance_start": null,
          "schedule_maintenance_end": null,
          "schedule_maintenance_msg": "",
          "terminate_sessions": false,
          "terminate_instances": false,
          "schedule_warning": true,
          "schedule_warning_start": "2020-12-24T00:00:00-03:00",
          "schedule_warning_end": "2020-12-25T00:00:00-03:00",
          "schedule_warning_msg": "Feliz Natal!",
          "display_warning_to_logged_users": false
      }
    ```

### Client Migration API \[/migrate/clients/]

API calls for migrations of Client objects (User Groups).

#### Migrate Clients \[POST]

Performs the procedure to migrate clients to an environment on the platform.

* Request (application/json)
  * Attributes
    * cli\_list: `239e44ea-b696-4471-b21e-d7bcbddedb1d`, `0670c6e2-511c-49e6-95b8-919522408868` (array) - List of IDs of the clients to be migrated.
    * amb\_uuid: `6a6c7a07-bef1-4e42-942e-87277a8c2a84` (string, required) - Environment ID to which the client will be linked.
* Response 200 (application/json)
  * Body

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

### Users API \[/users/{?cli\_uuid}]

API calls for operating User objects (System Access Users).

#### List Users \[GET]

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

* Parameters
  * cli\_uuid (optional) - List users from a specific client.
* Response 200 (application/json)
  * Body

    ```
      [
          {
              "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 \[GET /users/{usr\_uuid}]

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

* Parameters
  * usr\_uuid (required) - User UUID
* Response 200 (application/json)
  * Body

    ```
      [
          {
              "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,
                      "users": [],
                      "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
                      "in_maintenance": false,
                      "maintenance_msg": "",
                      "schedule_maintenance": false,
                      "schedule_maintenance_start": null,
                      "schedule_maintenance_end": null,
                      "schedule_maintenance_msg": "",
                      "terminate_sessions": false,
                      "schedule_warning": true,
                      "schedule_warning_start": "2021-12-01T23:10:00.000-03:00",
                      "schedule_warning_end": "2021-12-31T22:30:00.000-03:00",
                      "schedule_warning_msg": "Mensagem de Aviso aos Usuários",
                      "display_warning_to_logged_users": true
                  }
              ],
              "external_ad": false
          }
      ]
    ```

#### Create User \[POST /users/]

Performs the registration procedure for a new User on the platform. 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. If you have a specific Active Directory for your environment, use the `external_ad=true` property to set the password during registration.

* Request (application/json)
  * Attributes
    * nome: João (string, required) - User's first name.
    * sobrenome: Souza (string) - User's last name.
    * email: <joao.souza@dominio.com> (string, required) - User's logon email.
    * ativo: true (boolean) - True / False.
    * username: joao.souza (string) - User's name in AD.
    * password: senha123 (string) - User's password.
    * cli\_uuid: 769a0f4e-16a8-422a-99ab-d8c416137d4c (string, required) - Client UUID where the user is being registered.
    * description: Informações Complementares do Usuário (string) - Additional User Information.
    * fullname (string): User's full name, must contain at least two separated words.
    * external\_ad: false (boolean) - Set to true if you have your own environment Active Directory.
    * send\_activation\_email: false (boolean, optional) - Indicates whether an activation email should be sent to the user.
  * Body

    ```
      {
          "nome": "Joao",
          "sobrenome": "Souza",
          "email": "joao.souza@dominio.com",
          "ativo": true,
          "username": "joao.souza",
          "password": "senha123",
          "cli_uuid": "769a0f4e-16a8-422a-99ab-d8c416137d4c",
          "description": "User Information XXXX",
          "fullname": "Joao Souza Matrins",
          "external_ad": false,
          "send_activation_email": false
      }
    ```
* Response 200 (application/json)
  * Body

    ```
      {
          "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
      }
    ```

#### Update User \[PUT /users/{usr\_uuid}]

Performs the procedure to edit User information. In the update procedure, only certain user information can be modified.

* Parameters
  * usr\_uuid (required) - User UUID
* Request (application/json)
  * Attributes
    * nome: Joao (string) - User's first name.
    * sobrenome: Souza (string) - User's last name.
    * ativo: true (boolean) - True / False.
    * password: senha123 (string) - User's password.
    * description: Informações Complementares do Usuário (string) - Additional User Information.
  * Body

    ```
      {
          "nome": "Joao",
          "sobrenome": "Souza",
          "ativo": true,
          "password": "senha123"
      }
    ```
* Response 200 (application/json)
  * Body

    ```
      {
          "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,
                  "users": [],
                  "amb_uuid": "715088c9-9f21-424e-bcd5-5eacc0ce165b",
                  "in_maintenance": false,
                  "maintenance_msg": "",
                  "schedule_maintenance": false,
                  "schedule_maintenance_start": null,
                  "schedule_maintenance_end": null,
                  "schedule_maintenance_msg": "",
                  "terminate_sessions": false,
                  "schedule_warning": true,
                  "schedule_warning_start": "2021-12-01T23:10:00.000-03:00",
                  "schedule_warning_end": "2021-12-31T22:30:00.000-03:00",
                  "schedule_warning_msg": "Mensagem de Aviso aos Usuários",
                  "display_warning_to_logged_users": true
              }
          ],
          "external_ad": false
      }
    ```

#### Enable / Disable User \[PATCH /users/{usr\_uuid}]

Procedure used to enable or disable a User.

* Parameters
  * usr\_uuid (required) - User UUID
* Request (application/json)
  * Attributes
    * ativo: true (boolean) - Defines whether the user should be enabled (true) or disabled (false).
    * send\_activation\_email: false (boolean, optional) - Indicates whether an activation email should be sent to the user.
    * cli\_uuid: 769a0f4e-16a8-422a-99ab-d8c416137d4c (string, optional) - Client UUID associated with sending the email.
  * Body

    ```
      {
          "ativo": true,
          "send_activation_email": false,
          "cli_uuid": "769a0f4e-16a8-422a-99ab-d8c416137d4c"
      }
    ```
* Response 200 (application/json)
  * Body

    ```
      {
          "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 \[PATCH /users/{usr\_uuid}]

Procedure to change a User's access password. Password information is not stored in the Autosky platform database. This information is stored directly in the authentication AD defined on the platform.

* Parameters
  * usr\_uuid (required) - User UUID
* Request (application/json)
  * Attributes
    * password: senhausuario (string) - User's password.
  * Body

    ```
      {
          "password": "NibiruIsComming@2023!"
      }
    ```
* Response 200 (aplication/json)
  * Body

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

#### Delete User \[DELETE /users/{usr\_uuid}]

Deletes a user from the platform.

* Parameters
  * usr\_uuid (required) - User UUID
* Response 200 (application/json)
  * Body

    ```
      {
          "status": "success"
      }
    ```
* Response 404 (application/json)
  * Body

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

### Applications API \[/apps/{?cli\_uuid}]

API calls to operate Application objects (Applications Available to Users). You can use this API call in scenarios where the control of available applications to users is fragmented per client. If you manage application controls through permissions within the template instances, this API does not need to be used. When registered, an Application is by default set to INACTIVE. Use the activation call to enable the Application after registration.

#### List Applications \[GET]

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

* Parameters
  * cli\_uuid (optional) - Client UUID for filtering.
* Response 200 (application/json)
  * Body

    ```
      [
          {
              "app_uuid": "90476973-4729-4f2b-acee-3621cebd70e8"
              "nome": "Notepad",
              "estado": "INATIVO",
              "endereco_app": "",
              "parametro_app": "",
              "nome_exibicao": ""
          },
          {
              "app_uuid": "84104ec2-6914-4ed7-a359-04ff14316e74"
              "nome": "Calculadora",
              "estado": "ATIVO",
              "endereco_app": "",
              "parametro_app": "",
              "nome_exibicao": ""
          }
      ]
    ```

#### Get Application Data \[GET /apps/{app\_uuid}]

Retrieves data for a specific application by its UUID. In addition to the fields from the application listing, the "cliente" field is also included.

* Parameters
  * app\_uuid (required) - Application UUID.
* Response 200 (application/json)
  * Body

    ```
      [
          {
              "app_uuid": "84104ec2-6914-4ed7-a359-04ff14316e74"
              "nome": "Calculadora",
              "estado": "ATIVO",
              "endereco_app": "",
              "parametro_app": "",
              "cliente": {
                  "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",
                  "in_maintenance": false,
                  "maintenance_msg": "",
                  "schedule_maintenance": false,
                  "schedule_maintenance_start": null,
                  "schedule_maintenance_end": null,
                  "schedule_maintenance_msg": "",
                  "terminate_sessions": false,
                  "schedule_warning": false,
                  "schedule_warning_start": null,
                  "schedule_warning_end": null,
                  "schedule_warning_msg": "",
                  "display_warning_to_logged_users": false
              },
              "nome_exibicao": ""
          }
      ]
    ```

#### Create Application \[POST /apps/]

Performs the registration procedure for a new application on the platform.

* Request (application/json)
  * Attributes
    * nome: Teste API (string, required) - Application name.
    * cli\_uuid: 09228c2a-a9a6-4cab-8c57-81620f20bc2f (string, required) - Client UUID.
    * estado: ATIVO or INATIVO (string, required) - Application state.
    * endereco\_app: C:\\\Program Files\MeuDir\App.exe (string, optional) - Application path.
    * parametro\_app: MeuToken (string, optional) - Initialization parameter to be registered in the application.
  * Body

    ```
      {
          "nome": "Teste API",
          "cli_uuid": "54368a47-8040-4cc7-b20b-8b9cc2e86124",
          "estado": "ATIVO"
      }
    ```
* Response 200 (application/json)
  * Body

    ```
      {
          "nome": "teste",
          "estado": "ATIVO",
          "endereco_app": "C:\\\\Program Files\\MeuDir\\App.exe",
          "parametro_app": "CLI:1220",
          "cliente": {
              "cli_uuid": "123-123-123-123",
              "name": "Client name",
              "group_name": "Client group-name",
              "email_admin": "admin@email.com",
              "has_license_limit": false,
              "license_limit": 0,
              "in_maintenance": false,
              "maintenance_msg": ""
          },
          "nome_exibicao": ""
      }
    ```

#### Update Application \[PUT /apps/{app\_uuid}]

Performs the update procedure for the application on the platform.

* Parameters
  * app\_uuid (required) - Application UUID.
* Request (application/json)
  * Attributes
    * nome: Teste API (string, required) - Application name.
    * cli\_uuid: 09228c2a-a9a6-4cab-8c57-81620f20bc2f (string, required) - Client UUID.
    * estado: ATIVO or INATIVO (string, optional) - Application state.
    * endereco\_app: C:\\\Program Files\MeuDir\App.exe (string, required) - Application path.
    * parametro\_app: MeuToken (string, optional) - Initialization parameter to be registered in the application.
  * Body

    ```
      {
          "nome": "teste",
          "cli_uuid": "09228c2a-a9a6-4cab-8c57-81620f20bc2f",
          "endereco_app": "C:\\\\Program Files\\MeuDir\\App.exe"
      }
    ```
* Response 200 (application/json)
  * Body

    ```
      {
          "nome": "teste",
          "estado": "ATIVO",
          "endereco_app": "C:\\\\Program Files\\MeuDir\\App.exe",
          "parametro_app": "CLI:1220",
          "cliente": {
              "cli_uuid": "123-123-123-123",
              "name": "Client name",
              "group_name": "Client group-name",
              "email_admin": "admin@email.com",
              "has_license_limit": false,
              "license_limit": 0,
              "in_maintenance": false,
              "maintenance_msg": ""
          },
          "nome_exibicao": ""
      }
    ```

#### Delete Application \[DELETE /apps/{app\_uuid}]

Performs the deletion procedure for an application on the platform.

* Parameters
  * app\_uuid (required) - Application UUID.
* Response 200 (application/json)
  * Body

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

### Sessions API \[/sessions/{?cli\_uuid}]

API calls for user session operations. This call can be used to manage user sessions. You can list active sessions, disconnect users, and/or send messages to be displayed to users.

#### List Sessions \[GET]

Queries active sessions on the Autosky platform.

* Parameters
  * cli\_uuid - Client UUID for filtering (optional)
* Response 200 (application/json)
  * Body

    ```
      [
          {
              "ssid": "9cfb4863",
              "client": {},
              "user": {},
              "instance": {},
              "creation_date": "2017-10-02T18:35:14.470434Z",
              "termination_date": null,
              "termination_reason": "",
              "status": "ativa",
              "my_ip": "99.99.99.99"
          }
      ]
    ```

#### Get Session Data \[GET /sessions/{ssid}]

Retrieves data for a specific session by its identifier.

* Parameters
  * ssid (required) - Unique session identifier
* Response 200 (application/json)
  * Body

    ```
      [
          {
              "ssid": "9cfb4863",
              "client": {},
              "user": {},
              "instance": {},
              "creation_date": "2017-10-02T18:35:14.470434Z",
              "termination_date": null,
              "termination_reason": "",
              "status": "ativa",
              "my_ip": "99.99.99.99"
          }
      ]
    ```

#### Delete Session \[DELETE /sessions/{ssid}]

Procedure to remove a User session. When used, this procedure sends a disconnection message to the user with a shutdown timer. If the user does not close the session voluntarily, the session is terminated within the defined timer (in minutes).

* Parameters
  * ssid (required) - Unique session identifier
* Request (application/json)
  * Attributes
    * time: 10 (number, required) - Time in minutes.
    * message: Manutenção preventiva em 10 minutos (string) - Disconnection message.
* Response 200 (application/json)
  * Body

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

### Authentication API \[/login/]

API calls for user authentication (Credential Validation).

#### Authenticate User \[POST]

Performs the user authentication procedure on the platform to validate credentials. This API is only used for credential validation during redirection. The user logon is performed via the user logon redirect call covered in the next section.

* Request (application/json)
  * Attributes
    * email: <nome@dominio.com.br> (string) - User Authentication Email.
    * password: senhausuario (string) - User Authentication Password.
  * Body

    ```
      {
          "email": "nome@dominio.com.br",
          "password": "minhasenha"
      }
    ```
* Response 200 (application/json)
  * Body

    ```
      {
          "status": "Success",
          "msg": "User auth with success!"
      }
    ```

## Group Platform Logon

### About

The user logon process on the platform is not performed directly through an API call. This procedure is carried out through a direct call via HTTPS (Secure Connection) to the specified domain using the logon parameters. This model allows all controls and interactions with the user during their connection to be handled directly by the Autosky platform. Procedures such as plugin installation and other controls can be suggested and managed directly on the platform through this process.

### URL Call Structure

The URL call is a simple request composed of the Logon URL (sent to you, the partner, along with the authentication token) as well as the user and password information. We use the **AUTH** parameter to send the user and password information. There are also two additional optional parameters that can be sent to be used within the application. Parameter:

* auth=EMAIL:PASSWORD
* param=APPLICATION\_PARAMETERS
* back\_url=RETURN\_URL

Some parameters must be converted to Base64 when sent via the URL.

* auth >> (Base64)
* param >> (Base64)
* back\_url >> (PLAIN TEXT SENDING)

Only the AUTH parameter is required in the call; the others are optional.

* auth >> (REQUIRED)
* param >> (OPTIONAL)
* back\_url >> (OPTIONAL)

Example (Before Base64 Conversion):

* <https://meudominio.skyinone.net/usuario/autentica/**?auth=meuemail@dominio.com:MinhaSenha**&**param=123456789**&**back\\_url=https://www.meu-portal-acesso.com.br>\*\*

Example (After Base64 Conversion):

* <https://meudominio.skyinone.net/usuario/autentica/**?auth=bWV1ZW1haWxAZG9taW5pby5jb206TWluaGFTZW5oYQ==**&**param=MTIzNDU2Nzg5**&**back\\_url=https://www.meu-portal-acesso.com.br>\*\*

## Group Other Information

### Security

To improve security regarding the tokens available for each client and prevent this information from being misused by malicious actors, an IP filtering feature has been established. This filter ensures that any API activity is allowed only for the IPs configured in Autosky. This feature is optional, and to use it, the client must request the configuration through Skyone support, specifying the desired parameters (IPs). The API response message for unauthorized IPs will contain:

* Http: 403 - FORBIDDEN
* Body: { detail: "Invalid token." }

### API Error and Return Codes

At certain times, the API call may return a failure or control message. Below we present the possible error codes and return messages for each API call. Environments:

* ENV001: Error saving changes.
* ENV002: Error registering scheduled maintenance.
* ENV003: Error disabling scheduled maintenance.
* ENV004: Error registering warning display. Clients:
* CLI001: Error saving client to database.
* CLI002: Error creating security group in AD.
* CLI003: Error updating permissions.
* CLI004: Error saving changes.
* CLI005: Error removing client; active users exist.
* CLI006: Error removing security group from AD.
* CLI007: Client name already in use.
* CLI008: Error registering scheduled maintenance.
* CLI009: Error disabling scheduled maintenance.
* CLI010: Error registering warning display. Users:
* USR001: Error changing/configuring user password
* USR002: Client not found
* USR003: Error adding user to group
* USR004: User already added to client
* USR005: AD communication error
* USR006: Please provide a client (cli\_uuid)
* USR007: Error saving user
* USR008: Error removing user from database.
* USR009: Error removing user from AD.
* USR010: Error removing user from client.
* USR011: Error adding external user: Username is required.
* USR012: Error adding external user: Password is not an allowed parameter for external AD.
* USR013: Please provide a user (usr\_uuid)

Applications:

* APP001: Client not found
* APP002: Error saving application to database
* APP003: Application not found
* APP004: Error removing application

Sessions:

* SES001: Error removing session


---

# 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/clients-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.
