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