> For the complete documentation index, see [llms.txt](https://intuitem.gitbook.io/ciso-assistant/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://intuitem.gitbook.io/ciso-assistant/integration/api-usage.md).

# API usage

### Access the online documentation

{% embed url="<https://ca-api-doc.pages.dev>" %}

### Enable the documentation locally

Enable debug mode

```sh
export DJANGO_DEBUG=True
```

Start the backend server (make sure that dependencies are installed):

```shell
python3 manage.py runserver
```

Access the swagger documentation here:

<http://127.0.0.1:8000/api/schema/swagger/>

Or redoc format here:

{% embed url="<http://127.0.0.1:8000/api/schema/redoc/>" %}

### Interacting with the API

* Start by creating a PAT, instructions here[Generating a PAT](/ciso-assistant/integration/generating-a-pat.md)
* Use this token to form your Authorization header, it needs to be as follows:

`Authorization: Token <your_token>`

Then you can use with any rest client or within your application or script:

<figure><img src="/files/ndlC4LWNHQcQfHUzIfxr" alt="Example with Bruno (Postman alternative)"><figcaption><p>Example with Bruno (Postman alternative)</p></figcaption></figure>

Or with curl:<br>

```sh
curl --request GET \
  --url http://127.0.0.1:8000/api/assets/ \
  --header 'authorization: Token a6a120f....'
```

#### Notes

* make sure to add the trailing slash '/'
* your endpoint is your instance URL. If the proxy settings are the default ones, it will be the same url but with /api/ (in which case you don't need to add it)
* Pro SaaS users need to open a support request to expose the API on their instance. It's disabled by default.


---

# 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://intuitem.gitbook.io/ciso-assistant/integration/api-usage.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.
