---
title: "Create user or service account"
method: POST
path: "/users"
tags: ["Users"]
---

# Create user or service account

`POST /users`

Create a user account (type=user, email required; returns user + password for login) or a service account (type=service_account, roles required) for API/automation access.

## Request body

- CreateUserRequest
  - `email` string — Required when type is "user"
  - `name` string — Display name; optional for service accounts
  - `roles` string[] — Required when type is "service_account"
  - `type` 'user' | 'service_account', required

## Response `201`

Created

- CreateUserResponse
  - `email` string — Empty for service accounts
  - `id` string
  - `metadata` object
  - `name` string
  - `password` string
  - `roles` string[]
  - `tenant` TenantResponse
    - `billing_details` TenantBillingDetails
      - `address` Address
        - `address_city` string
        - `address_country` string
        - `address_line1` string
        - `address_line2` string
        - `address_postal_code` string
        - `address_state` string
      - `email` string
      - `help_email` string
      - `phone` string
    - `created_at` string, date-time
    - `id` string
    - `metadata` TypesMetadata
    - `name` string
    - `status` string
    - `updated_at` string, date-time
  - `type` 'user' | 'service_account'

## Other responses

- `400` — Invalid request
- `500` — Server error

## Changes

> 108 revisions in range; 4 could not be searched.

- **2026-07-15** `f8ecf435d25d` — 2 warning
  - added the new `not_implemented` enum value to the `code` response property for the response status `400`
  - added the new `not_implemented` enum value to the `code` response property for the response status `500`
- **2026-07-09** `7d57386313c7` — 4 breaking, 2 warning, 2 info
  - request property `type` was restricted to a list of enum values
  - the `type` request property type/format changed from ``/`` to `string`/``
  - the `tenant/metadata` response's property type/format changed from ``/`` to `object`/`` for status `201`
  - the `type` response's property type/format changed from ``/`` to `string`/`` for status `201`
  - …4 more
- **2026-07-09** `4b1a811c4179` — 7 breaking, 2 info
  - removed the enum value `service_account` of the request property `type`
  - removed the enum value `user` of the request property `type`
  - the `type` request property type/format changed from `string`/`` to ``/``
  - the `tenant/created_at` response's property type/format changed from `string`/`date-time` to `string`/`` for status `201`
  - …5 more
- **2026-06-16** `257509e66883` — 2 info
  - added the new optional request property `name`
  - added the optional property `name` to the response with the `201` status
- **2026-06-03** `7adf4f33ea1a` — 1 info
  - added the optional property `metadata` to the response with the `201` status

[Full history](https://skmtc.dev/flexprice/apis/flexprice-api/changes/users/post.md)

---

[API](https://skmtc.dev/flexprice/apis/flexprice-api.md) · [All operations](https://skmtc.dev/flexprice/apis/flexprice-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/flexprice/flexprice-api/revisions/9cd0dab91f5c/schema)
