---
title: "Create a user"
method: POST
path: "/{domain}/Users"
tags: ["SCIM"]
---

# Create a user

`POST /{domain}/Users`

Given a body create the user in TeamOhana and return it to the user. If the password is not provided during creation a randomly generated password will be set for the user. The username should be an email id OR the emails field should contain at least one email with type work. The API will fail to create the user otherwise. By default the user is also provisioned in Auth0; set `create-in-auth0` to `false` in the body when the user already exists in Auth0 (e.g. via SSO) — in that case `externalId` must be set to the Auth0 user_id. The user's role is taken from the `roles` attribute: the `value` of the entry whose `type` is `teamohana` (case-sensitive), is matched against the org's role names. When no such entry is present the user defaults to the `employee` role; when a matching role is supplied but does not exist the request fails with 400 `invalidValue`.

## Path parameters

- `domain` string, required

## Request body

- object
  - `entitlements` object[]
    - `value` string, nullable, required
    - `primary` boolean
    - `display` string, nullable
    - `type` '' | 'home' | 'work' | 'other', nullable
    - `$ref` string, nullable
  - `profileUrl` string, nullable
  - `schemas` unknown, required
  - `nickname` string, nullable
  - `preferredLanguage` string, nullable
  - `ims` object[]
    - `value` string, nullable, required
    - `primary` boolean
    - `display` string, nullable
    - `type` '' | 'home' | 'work' | 'other', nullable
    - `$ref` string, nullable
  - `timezone` string, nullable
  - `displayName` string, nullable
  - `userType` string, nullable
  - `name` object
    - `formatted` string, nullable
    - `familyName` string, nullable
    - `givenName` string, nullable
    - `middleName` string, nullable
    - `honorificPrefix` string, nullable
    - `honorificSuffix` string, nullable
  - `locale` string, nullable
  - `urn:ietf:params:scim:schemas:extension:enterprise:2.0:User` object
  - `userName` string, required
  - `addresses` object[]
    - `primary` boolean
    - `type` '' | 'home' | 'work' | 'other', nullable
    - `formatted` string, nullable
    - `streetAddress` string, nullable
    - `locality` string, nullable
    - `region` string, nullable
    - `postalCode` string, nullable
    - `country` string, nullable
  - `title` string, nullable
  - `create-in-auth0` boolean
  - `password` string, nullable
  - `photos` object[]
    - `value` string, nullable, required
    - `primary` boolean
    - `display` string, nullable
    - `type` '' | 'home' | 'work' | 'other', nullable
    - `$ref` string, nullable
  - `x509Certificates` object[]
    - `value` string, nullable, required
    - `primary` boolean
    - `display` string, nullable
    - `type` '' | 'home' | 'work' | 'other', nullable
    - `$ref` string, nullable
  - `emails` object[]
    - `value` string, nullable, required
    - `primary` boolean
    - `display` string, nullable
    - `type` '' | 'home' | 'work' | 'other', nullable
    - `$ref` string, nullable
  - `active` boolean
  - `phoneNumbers` object[]
    - `value` string, nullable, required
    - `primary` boolean
    - `display` string, nullable
    - `type` '' | 'home' | 'work' | 'other', nullable
    - `$ref` string, nullable
  - `roles` object[]
    - `value` string, nullable
    - `primary` boolean
    - `display` string, nullable
    - `type` '' | 'home' | 'work' | 'other' | 'teamohana', nullable
    - `$ref` string, nullable
  - `groups` object[]
    - `value` string, nullable, required
    - `primary` boolean
    - `display` string, nullable
    - `type` '' | 'home' | 'work' | 'other', nullable
    - `$ref` string, nullable
  - `externalId` string

## Response `201`

- object
  - `entitlements` object[]
    - `value` string, nullable, required
    - `primary` boolean
    - `display` string, nullable
    - `type` '' | 'home' | 'work' | 'other', nullable
    - `$ref` string, nullable
  - `profileUrl` string, nullable
  - `schemas` unknown, required
  - `nickname` string, nullable
  - `preferredLanguage` string, nullable
  - `ims` object[]
    - `value` string, nullable, required
    - `primary` boolean
    - `display` string, nullable
    - `type` '' | 'home' | 'work' | 'other', nullable
    - `$ref` string, nullable
  - `timezone` string, nullable
  - `displayName` string, nullable
  - `id` string, required
  - `userType` string, nullable
  - `name` object
    - `formatted` string, nullable
    - `familyName` string, nullable
    - `givenName` string, nullable
    - `middleName` string, nullable
    - `honorificPrefix` string, nullable
    - `honorificSuffix` string, nullable
  - `locale` string, nullable
  - `urn:ietf:params:scim:schemas:extension:enterprise:2.0:User` object
  - `userName` string, required
  - `addresses` object[]
    - `primary` boolean
    - `type` '' | 'home' | 'work' | 'other', nullable
    - `formatted` string, nullable
    - `streetAddress` string, nullable
    - `locality` string, nullable
    - `region` string, nullable
    - `postalCode` string, nullable
    - `country` string, nullable
  - `title` string, nullable
  - `meta` object, required
    - `resourceType` 'user', required
    - `created` string, date-time, required
    - `lastModified` string, date-time, required
    - `location` string, required
    - `version` string, uuid, required
  - `password` string, nullable
  - `photos` object[]
    - `value` string, nullable, required
    - `primary` boolean
    - `display` string, nullable
    - `type` '' | 'home' | 'work' | 'other', nullable
    - `$ref` string, nullable
  - `x509Certificates` object[]
    - `value` string, nullable, required
    - `primary` boolean
    - `display` string, nullable
    - `type` '' | 'home' | 'work' | 'other', nullable
    - `$ref` string, nullable
  - `emails` object[]
    - `value` string, nullable, required
    - `primary` boolean
    - `display` string, nullable
    - `type` '' | 'home' | 'work' | 'other', nullable
    - `$ref` string, nullable
  - `active` boolean
  - `phoneNumbers` object[]
    - `value` string, nullable, required
    - `primary` boolean
    - `display` string, nullable
    - `type` '' | 'home' | 'work' | 'other', nullable
    - `$ref` string, nullable
  - `roles` object[]
    - `value` string, nullable
    - `primary` boolean
    - `display` string, nullable
    - `type` '' | 'home' | 'work' | 'other' | 'teamohana', nullable
    - `$ref` string, nullable
  - `groups` object[]
    - `value` string, nullable, required
    - `primary` boolean
    - `display` string, nullable
    - `type` '' | 'home' | 'work' | 'other', nullable
    - `$ref` string, nullable
  - `externalId` string

## Other responses

- `400` — Request does not conform to the SCIM standard. Check for typos or missing fields.
- `409` — A resource with the same email already exists in the system.
- `500` — Something went wrong at TeamOhana. Please contact support.

---

[API](https://skmtc.net/teamohana/apis/teamohana-public-api.md) · [All operations](https://skmtc.net/teamohana/apis/teamohana-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/teamohana/teamohana-public-api/versions/55e225ee4219/schema)
