---
title: "Create a user"
method: POST
path: "/admin/users"
tags: ["enterprise-admin"]
---

# Create a user

`POST /admin/users`

If an external authentication mechanism is used, the login name should match the login name in the external system. If you are using LDAP authentication, you should also [update the LDAP mapping](https://docs.github.com/enterprise-server@3.5/rest/reference/enterprise-admin#update-ldap-mapping-for-a-user) for the user.

The login name will be normalized to only contain alphanumeric characters or single hyphens. For example, if you send `"octo_cat"` as the login, a user named `"octo-cat"` will be created.

If the login name or email address is already associated with an account, the server will return a `422` response.

## Request body

- object
  - `login` string, required — The user's username.
  - `email` string — **Required for built-in authentication.** The user's email address. This parameter can be omitted when using CAS, LDAP, or SAML. For more information, see "[About authentication for your enterprise](https://docs.github.com/enterprise-server@3.5/admin/identity-and-access-management/managing-iam-for-your-enterprise/about-authentication-for-your-enterprise)."

## Response `201`

Response

- SimpleUser — A GitHub user.
  - `name` string, nullable
  - `email` string, nullable
  - `login` string, required
  - `id` integer, required
  - `node_id` string, required
  - `avatar_url` string, uri, required
  - `gravatar_id` string, nullable, required
  - `url` string, uri, required
  - `html_url` string, uri, required
  - `followers_url` string, uri, required
  - `following_url` string, required
  - `gists_url` string, required
  - `starred_url` string, required
  - `subscriptions_url` string, uri, required
  - `organizations_url` string, uri, required
  - `repos_url` string, uri, required
  - `events_url` string, required
  - `received_events_url` string, uri, required
  - `type` string, required
  - `site_admin` boolean, required
  - `starred_at` string

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-4.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-4/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-4/versions/ee6c7a46328e/schema)
