---
title: "Generate a Flight Hub service account"
method: POST
path: "/orgmng/fh-service-accounts"
tags: ["Flight Hub Service Accounts"]
---

# Generate a Flight Hub service account

`POST /orgmng/fh-service-accounts`

## Request

- Base URL: `http://localhost:8486`
- URL: `http://localhost:8486/orgmng/fh-service-accounts`
- Auth: API key in header `x-auth-token`

Generates a new service account with an auto-generated username and password. The password is only returned once.

## Request body

- GenerateFlightHubServiceAccountRequestDTO: Service account generation request
  - `organizationId` integer: Organization ID. Required when generating for any organization, ignored for self-org.

## Response `201`

Service account generated successfully

- FlightHubServiceAccountCreatedDTO
  - `id` integer: Service account ID
  - `username` string: Auto-generated username (fh_sa_<id>)
  - `password` string: Generated password. This is the only time the password is returned.
  - `createdAt` string, date-time: Timestamp when the service account was created
  - `organizationId` integer: Organization ID the service account belongs to

## Other responses

- `404`: Organization not found
- `422`: Validation failed
- `500`: Internal server error

---

[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)
