API documentation  POST /users/new | POST /users/{id}

Create a new user in the system by providing detailed offer information through a POST request.

POST https://demo.trafficmanager.com/api/v1/users/new | https://demo.trafficmanager.com/api/v1/users/{id} 

This endpoint allows the creation or updating of a user in the system. The request must include a JSON object with the user details to be created or updated.

Authentication:

The request must be authenticated with the following HTTP headers:
  • x-api-key: Your API key, found in the Security page
  • x-user-id: Your User ID, found in the Security page
If the HTTP headers are not passed, but you are logged in to the TrafficManager panel, the current user is used instead (so you can easily preview or download the data using your browser)

POST Body Parameters:

The request body must be a JSON object with the following structure, including detailed specifications of the user to be created:

{
    "id": 123, // Optional. It can be set to create a new user with a specific ID. It cannot be used on update.
    "username": "johndoe_9232", // Required for new user
    "email": "john.doe.da2v@example.com", // Required for new user
    "password": "securepassword123", // Required for new user
    "isPasswordHashed": "0", // Optional, default is 0, meaning the password is in plain text. Set it to 1 if the password is already hashed. Supported algorithms: bcrypt, argon2i, argon2id
    "status": 1, // Optional, default can be active or pending approval, depending on the network referrer policy. Allowed statuses are: -1 (pending approval), 1 (active), 3 (inactive), 0 (banned), -2 (unapproved), -3 (inactive and banned), -4 (pending deletion)
    "profile": {
        "firstName": "John",
        "lastName": "Doe",
        "birthDate": "1992-05-14",
        "address": "123 Main St, Springfield",
        "zip": "62704",
        "country": "US",
        "SSN": "123-45-6789",
        "passportNo": "X12345678",
        "phone": "+1-555-123-4567",
        "skype": "live:john.doe92",
        "partnerCode": "ABC123",
        // Additional custom fields as needed
    },
    "paymentMethods": {
       "Wire transfer": [
        {
          "id" : 17, // optional, required for editing if not provided will create a new payment account
          "IBAN": "US12345678901234567890",
          "Account holder name": "John Does Not",
          "Account holder address": "123 Main St, Springfield",
          "SWIFT/BIC": "ABCDEF12",
          "Bank name": "Bank of Springfield",
          "Bank address": "456 Elm St, Springfield",
          "Intermediary Bank": "Global Bank",
          "Intermediary bank SWIFT": "GB123456",
          "Intermediary bank address": "789 Oak St, Metropolis"
        },
        {
          "IBAN": "US12345678901234567891",
          "Account holder name": "John Does",
          "Account holder address": "123 Main St, Springfield",
          "SWIFT/BIC": "ABCDEF12",
          "Bank name": "Bank of Springfield",
          "Bank address": "456 Elm St, Springfield",
          "Intermediary Bank": "Global Bank",
          "Intermediary bank SWIFT": "GB123456",
          "Intermediary bank address": "789 Oak St, Metropolis"
        }
      ],
      "PayPal": [
        {
          "Paypal email": "john@doe.com"
        }
      ]
    }
}

Note: This JSON structure is a simplified example. Replace placeholder text with actual data for the user being created/updated.

Success Response:

{
        "message": "User created successfully with ID 123" or "User edited successfully",
}

This response indicates that the user was successfully created or updated in the system.

Error Response:

{
    "status": [error code],
    "message": [error message]
}

Explains why the request failed, such as missing required fields, authentication issues, or invalid parameters.