# Creating service accounts

## Overview

We will here create a new a new Service Account using either the web application or our REST API.

## Prerequisites

In order to create the initial service account, the logged in user needs to have a role of Admin.

## Create using app

The first service account needs to be created using our App. Whereas subsequent accounts may be created using the REST API.

1. Navigate to [Service account settings](https://app.neowit.io/settings/serviceAccounts)
2. Click Add
3. Give the account a meaningful name and decide whether you want to enable [Basic Auth](/rest-api/authentication/basic-auth.md)
4. Click Save
5. Add 1 or more service account keys that may be used for [Authentication](/rest-api/authentication.md)
6. Copy the details.

{% hint style="info" %}
The shown secret will not be shown again.
{% endhint %}

{% hint style="danger" %}
Make sure the secret is safely stored. Delete the key if you think it has been compromised in any way.
{% endhint %}

<figure><img src="/files/zUuTfqK1Qyy6jDsPrF3A" alt=""><figcaption><p>Dialog showing the created key information</p></figcaption></figure>

## Create using REST API

Service accounts may be created, and keys may be rotated deleted using the REST API shown below. See our [API reference](/rest-api/api-reference.md) for more operations

{% openapi src="<https://app.neowit.io/api/swagger/doc.json>" path="/service-account/v1/service-account" method="post" %}
<https://app.neowit.io/api/swagger/doc.json>
{% endopenapi %}

{% openapi src="<https://app.neowit.io/api/swagger/doc.json>" path="/service-account/v1/service-account/{id}" method="delete" %}
<https://app.neowit.io/api/swagger/doc.json>
{% endopenapi %}

{% openapi src="<https://app.neowit.io/api/swagger/doc.json>" path="/service-account/v1/service-account/{id}/key" method="post" %}
<https://app.neowit.io/api/swagger/doc.json>
{% endopenapi %}

{% openapi src="<https://app.neowit.io/api/swagger/doc.json>" path="/service-account/v1/service-account/{id}/key/{key-id}" method="delete" %}
<https://app.neowit.io/api/swagger/doc.json>
{% endopenapi %}


---

# 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/service-accounts/creating-service-accounts.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.
