# Flowg8 · Create a service account

Create an integration identity with an explicit permission ceiling.

Create the account with a user token, then issue API keys with serviceAccountId using Create an API key. Account creation returns metadata, never a credential. Each key may request a subset of the normalized account scopes. flows:write includes flows:read; organization:write includes organization:read. Up to 100 accounts per workspace.

## POST /v1/service-accounts

Authentication: FLOWG8_ACCESS_TOKEN from Flowg8 sign-in
Required tenant header: X-Organization-Id.
Required user permissions: Administrator or Sandbox developer required. The API checks current membership, roles, key scopes and resource permissions on every request. Documentation visibility grants no access.

## Input parameters
- name (string, required): min length 1 · max length 80
- scopes (array, required): min items 1 · max items 7

## Request example (replace example IDs)

```sh
curl -X POST "https://api.flowg8.io/v1/service-accounts" \
  -H "authorization: Bearer $FLOWG8_ACCESS_TOKEN" \
  -H "x-organization-id: 10000000-0000-4000-8000-000000000001" \
  -H "idempotency-key: example-create-service-account-001" \
  -H "content-type: application/json" \
  --data-raw '{
  "name": "ERP onboarding",
  "scopes": [
    "users:invite"
  ]
}'
```

## Response excerpt

```json
{
  "id": "10000000-0000-4000-8000-000000000010",
  "name": "ERP onboarding",
  "scopes": [
    "users:invite"
  ],
  "active": true,
  "revision": 1
}
```

Source: /docs/create-service-account
Full schemas: /docs/openapi.json
