CreateUser

This method can be used for the following functionality: Create a new user in AttackForge.

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": "..."
   }
}

Last updated

Check YouTube for more tutorials: https://youtube.com/@attackforge