---
title: "Create a user"
method: POST
path: "/v1/users"
tags: ["Users"]
---

# Create a user

`POST /v1/users`

## Request

- Base URL: `https://api.capacity.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.capacity.com/v1/users`
- Auth: one of:
  - API key in header `x-capacity-id`
  - HTTP bearer

Create a user and add them to the specified groups.

## Request body

- UserPostSchema
  - `email` string, required
  - `groups` string[], required: Ids of groups of which the user will be a member
  - `first_name` string, required
  - `last_name` string, required
  - `custom1` string, nullable: Field for storing custom user data
  - `custom2` string, nullable: Field for storing custom user data

## Response `201`

The newly created user

- object
  - `body` object: Json body data in the request
  - `parameters` object: Query parameters in the request
  - `result` UserGetSchema
    - `id` string
    - `first_name` string
    - `last_name` string
    - `email` string
    - `is_deleted` unknown
    - `custom1` string, nullable
    - `custom2` string, nullable
    - `groups` GroupGetSchema[]
      - `id` string: ID of a group record
      - `name` string: The group's name
    - `attributes` UserAttributeGetSchema[]
      - `key` string: Attribute key
      - `value` string: Attribute value

---

[API](https://skmtc.dev/capacity/apis/capacity-api-docs.md) - [All operations](https://skmtc.dev/capacity/apis/capacity-api-docs/llms.txt) - [OpenAPI document](https://skmtc.dev/capacity/apis/capacity-api-docs/revisions/74c85bb61004?raw)
