# CreateUser

## Parameters

The following URL, Headers and Parameters are required for requests to this API endpoint. Where a parameter is optional, it will be indicated. Otherwise treat all parameters as mandatory.

### Headers

```
POST /api/ss/user HTTP/1.1
Host: demo.attackforge.com
X-SSAPI-KEY: APIKey
Content-Type: application/json
Connection: close
```

### Query

**first\_name (string)**

First name of the user.

Example:

```
{
   "first_name": "..."
}
```

**last\_name (string)**

Last name of the user.

Example:

```
{
   "last_name": "..."
}
```

**username (string)**

Username of the user. If SSO is enabled, should be username in external identity provider. If SSO is disabled, should be email address.

Example:

```
{
   "username": "..."
}
```

**email (string)**

Email address of the user.

Example:

```
{
   "email": "..."
}
```

**password (string)**

Password. Should be minimum 15 characters in length.

Example:

```
{
   "password": "..."
}
```

**role (string)**

Role of the user. Must be one of the following: admin, librarymod, client, consultant, projectoperator.

Example:

```
{
   "role": "..."
}
```

**mfa (string)**

Whether MFA is enabled or disabled for the user. Must be one of the following: Yes, No.

Example:

```
{
   "mfa": "..."
}
```

## Example

The following example is a cURL request to create a new user.

### Request

Include API Token instead of stars in 'X-SSAPI-KEY: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*' parameter.

```
curl -X POST 'https://demo.attackforge.com/api/ss/user' -H 'Host: demo.attackforge.com' -H 'X-SSAPI-KEY: ***************************************' -H 'Content-Type: application/json' -H 'Connection: close' -d '{
  "first_name": "John",
  "last_name": "Citizen",
  "username": "john.citizen@attackforge.com",
  "email": "john.citizen@attackforge.com",
  "password": "ThisIsASuperLongPassword",
  "role": "client",
  "mfa": "Yes"
}'
```

### Response

Response contains a user object.

```
{
   "user": {
      "id": "...",
      "first_name": "...",
      "last_name": "...",
      "email": "...",
      "username": "...",
      "status": "...",
      "role": "...",
      "mfa": "..."
   }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.attackforge.com/attackforge-enterprise/modules/self-service-restful-api/createuser.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
