---
title: "Generate a service account"
method: POST
path: "/nis/rid-sensors/{sensorId}/service-accounts"
tags: ["RID Sensor Service Accounts"]
---

# Generate a service account

`POST /nis/rid-sensors/{sensorId}/service-accounts`

## Request

- Base URL: `http://localhost:8486`
- URL: `http://localhost:8486/nis/rid-sensors/{sensorId}/service-accounts`
- Auth: API key in header `x-auth-token`

Creates username/password and returns plaintext password once (for HTTP Basic / Scout URL userinfo).

## Path parameters

- `sensorId` integer, required

## Response `201`

Generated

- RidSensorServiceAccountCreatedDTO: Newly generated RID Sensor service account. Password (and apiKeyHeaderValue = Base64(login:password) for Basic) are returned only once.
  - `id` integer
  - `ridSensorId` integer
  - `username` string
  - `password` string
  - `apiKeyHeaderValue` string: Base64(login:password) payload used with Authorization: Basic
  - `createdAt` string, date-time

## Other responses

- `404`: Sensor not found
- `422`: Limit reached

---

[API](https://skmtc.dev/airdodge/apis/api-core.md) - [All operations](https://skmtc.dev/airdodge/apis/api-core/llms.txt) - [OpenAPI document](https://skmtc.dev/airdodge/apis/api-core/revisions/fb3c5a1055cc?raw)
