---
title: "Create service account"
method: POST
path: "/api/{org_id}/service_accounts"
tags: ["ServiceAccounts"]
---

# Create service account

`POST /api/{org_id}/service_accounts`

## Request

- Base URL: `https://api.openobserve.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.openobserve.ai/api/{org_id}/service_accounts`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/openobserve/apis/openobserve-api-http/docs/api/:org_id/service_accounts/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new service account for automated systems and applications. Service accounts provide a secure way for non-human users to authenticate and access resources programmatically. Each service account is automatically assigned an API token that can be used for authentication in automated workflows and integrations.

## Path parameters

- `org_id` string, required

## Request body

- object
  - `email` string, required
  - `first_name` string
  - `last_name` string

## Response `200`

Success

- ServiceAccountCreateResponse
  - `code` integer, required
  - `message` string, required
  - `token` string, required
  - `user` string, required

---

[API](https://skmtc.dev/openobserve/apis/openobserve-api-http.md) - [All operations](https://skmtc.dev/openobserve/apis/openobserve-api-http/llms.txt) - [OpenAPI document](https://skmtc.dev/openobserve/apis/openobserve-api-http/revisions/0529b8a10252?raw)
