# Authentication

## OAuth2

We **strongly** recommend using the OAuth2 authentication flow when integrating with our REST API. It utilizes the [JWT](https://jwt.io/) as a medium of exchange and a [Service Account](/service-accounts/creating-service-accounts.md) for access control. After the authentication exchange is implemented, the returned access token allows you to perform HTTP requests efficiently.

Read about how to implement [OAuth2](/rest-api/authentication/oauth2.md) to get started.

## Basic Auth

We also support Basic Auth for authenticating with a Service Account. While this is not recommended for production-level integrations, it can be quite useful for quick experimentation and prototyping. It is disabled by default but can be enabled when creating or updating the [Service Account](/service-accounts/creating-service-accounts.md).

Read about how to implement [Basic Auth](/rest-api/authentication/basic-auth.md) to get started.


---

# 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://developers.neowit.io/rest-api/authentication.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.
