> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/it/config/management-api.md).

# API di gestione

È possibile gestire PowerShell Universal utilizzando la Management API integrata. Consente di eseguire tutte le azioni della console di amministrazione in modo automatizzato. È possibile visualizzare e testare l'API visitando la documentazione Swagger dell'API nella sua posizione predefinita sulla macchina `http://localhost:5000/swagger/index.html` .

{% hint style="info" %}
La Management API è integrata e non richiede una licenza per Universal API.
{% endhint %}

## Modulo PowerShell

Forniamo un modulo PowerShell che chiama l'API per suo conto, così non dovrà scrivere lei stesso le richieste HTTP. Può scaricare questo modulo dalla PowerShell Gallery.

```powershell
Install-Module Universal
```

Il modulo PowerShell richiede un app token e il nome del computer per chiamare il server Universal. È possibile fornire questi elementi a ogni chiamata.

```powershell
Invoke-PSUScript -Script $Script -ComputerName http://localhost:5000 -AppToken $AppToken
```

Inoltre, è possibile connettersi al server Universal utilizzando `Connect-UAServer`.

```powershell
Connect-PSUServer -ComputerName http://localhost:5000 -AppToken $AppToken
```

## API REST

È possibile accedere alla Management API di PowerShell Universal tramite chiamate REST. È possibile visualizzare le chiamate disponibili utilizzando la documentazione Swagger dell'API integrata. Sarà necessario un App Token per effettuare chiamate all'API REST.

## App Token

Gli [App Token](/powershell-universal/it/sicurezza/app-tokens.md) sono richiesti dalla Management API. Dovrà utilizzare un App Token sia con i cmdlet PowerShell sia per chiamare direttamente la Management API tramite REST.

È possibile utilizzare un App Token con `Invoke-RestMethod` specificando l'intestazione di autorizzazione.

```powershell
Invoke-RestMethod http://localhost:5000/api/v1/script -Headers @{ Authorization = "Bearer appToken" }
```


---

# 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.devolutions.net/powershell-universal/it/config/management-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.
