CreateUsers

This method can be used for the following functionality: Create multiple new users 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/users 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 multiple new users.

Request

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

curl -X POST 'https://localhost:3000/api/ss/users' -H 'Host: localhost:3000' -H 'X-SSAPI-KEY: 2BouMnBBGGjRDSPikYw64QlayDrUozLrxdsUktsqANWmLOQMPVouNre2cuWpbhqEvtdkLtWnqeaeannoueLXi9yLQBJcfwB6dQfzX8GXs0QofwDh0JchOf88snrFEmtllhcgZHtaploNoQDsVQ2lPTdspopAMgXWd9ofLRfSKtuHthorElnOTdONivK6pqLsln4HTolnNdfrb1grH3Ybe8Z8hC8y39aF12c0Ds0MmO7FNRJa1Zz0V9mDArO1mzCA' -H 'Content-Type: application/json' -H 'Connection: close' -d '[
  {
    "first_name": "Jane",
    "last_name": "Citizen",
    "username": "jane.citizen@attackforge.com",
    "email": "jane.citizen@attackforge.com",
    "password": "ThisIsASuperLongPassword",
    "role": "consultant",
    "mfa": "Yes"
  },
  {
    "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 an array of user objects.

[
  {
    "status": "...",
    "user": {
      "id": "...",
      "first_name": "...",
      "last_name": "...",
      "email": "...",
      "username": "...",
      "status": "...",
      "role": "...",
      "mfa": "..."
    },
    "error": "..."
  }
]

Last updated

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