# API

The Universal API can be used to manage the platform from any compatible REST client. You will need a valid App Token to access the API.

## Invoking the API

To invoke the API, you can send an HTTP request with the Bearer token set for authorization.

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

## API Documentation

You can access the API documentation by navigating to Security \ Tokens  and click the API Documentation button.&#x20;

The URL for the API documentation can be found at the following location. You will need to be authenticated before accessing this URL: `http://localhost:5000/swagger/index.html`


---

# Agent Instructions: 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:

```
GET https://docs.powershelluniversal.com/master-1/config/api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
