Endpoint: /sites/{siteId}/users

NOTE: Available as of EFT 8.1.0

Returns a list of users for specific site, create user(s) for a specific site.

  • GET

  • POST

Method & URL

GET https://[server URL]:[port]/admin/v2/sites/{siteId}/users

GET Body Sample

Copy
### GET SITE USERS ###
GET https://{{host}}/admin/v2/sites/{{Siteid}}/users HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
###

GET Response Body Sample

Copy
{ "data": [ { "attributes": { "accountEnabled": "inherit", "agreementToTermsOfService": "unknown", 
"as2": { "inbound": { "enabled": "inherit" }, "outbound": { "enabled": "inherit" } }, 
"changePassword": { "enabled": "inherit", "value": { "changeAdminProvidedPasswordUponFirstUse": 
"inherit", "mustChangePassword": false, "passwordExpiration": { "enabled": true, "value": { 
"maxAgeDays": 90, "emailUpon": true,

GET PowerShell Sample

Copy
# get sites
Write-Output "Site"
Write-Output "----"
$siteList = Invoke-RestMethod -Uri "$baseURL/v2/sites" -Method 'GET' -Headers $authHeader
Write-Output $siteList | ConvertTo-Json
foreach ($site in $siteList.data)
{
    Write-Output ("Site  $($site.id): $($site.attributes.name)")
}

$siteID = $siteList.data[0].id

# get users
Write-Output "Users"
Write-Output "-----"
$userList = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/users" -Method 'GET' -Headers $authHeader
Write-Output $userList | ConvertTo-Json
foreach ($user in $userList.data)
{
    Write-Output ("User $($user.id): $($user.attributes.loginName)")
}

Method & URL

POST https://[server URL]:[port]/admin/v2/ sites/{siteId}/users

POST Body Sample

Copy
### ADD SITE USER ###
POST https://{{host}}/admin/v2/sites/{{Siteid}}/users HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}

{
  "data": {
    "type": "user",
    "attributes": {
      "loginName": "TestUser1",
      "password": {
        "type": "Disabled",
        "value": "Alaska12#"
      },
      "accountEnabled": "inherit",
      "expiration": {
        "enabled": false,
        "value": {
          "date": {}
        }
      },
      "personal": {
        "name": "Test User",
        "description": null,
        "email": null,
        "DUNS": null,
        "phone": null,
        "mobile": null,
        "pager": null,
        "fax": null,
        "company": null,
        "partnerId": null,
        "custom1": null,
        "custom2": null,
        "custom3": null,
        "comments": null
      },
      "isEuDataSubject": "unknown",
      "consentToPrivacyPolicy": "unknown",
      "agreementToTermsOfService": "unknown",
      "homeFolder": {
        "enabled": "yes",
        "value": {
          "path": null
        }
      },
      "hasHomeFolderAsRoot": "inherit",
      "externalAuthentication": "inherit",
      "ftp": {
        "enabled": "inherit",
        "value": {
          "enableFxp": "inherit",
          "enableNoop": "inherit",
          "enableComb": "inherit",
          "enableXcrc": "inherit",
          "enableZlib": "inherit",
          "banner": {
            "message": "",
            "usage": "useDefault"
          }
        }
      },
      "ftps": {
        "enabled": "inherit"
      },
      "sftp": {
        "enabled": "inherit",
        "value": {
          "authenticationType": "inherit"
        }
      },
      "http": {
        "enableHttp": "inherit",
        "enableHttps": "inherit",
        "enableWtc": "inherit",
        "enableShareFolder": "inherit",
        "enableSendMessage": "inherit"
      },
      "ssl": {
        "authenticationType": "inherit"
      },
      "as2": {
        "inbound": {
          "enabled": "inherit"
        },
        "outbound": {
          "enabled": "inherit"
        }
      },
      "transferSpeedLimit": {
        "enabled": "inherit",
        "value": {
          "maxKbps": 0
        }
      },
      "connectionTimeout": {
        "enabled": "inherit",
        "value": {
          "maxSec": 0
        }
      },
      "totalConnectionsLimit": {
        "enabled": "inherit",
        "value": {
          "maxNumber": 0
        }
      },
      "connectionsFromSameIpLimit": {
        "enabled": "inherit",
        "value": {
          "maxNumber": 0
        }
      },
      "uploadsPerSessionLimit": {
        "enabled": "inherit",
        "value": {
          "maxNumber": 0
        }
      },
      "downloadsPerSessionLimit": {
        "enabled": "inherit",
        "value": {
          "maxNumber": 0
        }
      },
      "uploadSizeLimit": {
        "enabled": "inherit",
        "value": {
          "maxKBytes": 0
        }
      },
      "downloadSizeLimit": {
        "enabled": "inherit",
        "value": {
          "maxKBytes": 0
        }
      },
      "ipAccessLimit": {
        "enabled": "inherit",
        "value": {
          "rules": [],
          "defaultRule": "allowAccess"
        }
      },
      "invalidLoginLimit": {
        "enabled": "inherit",
        "value": {
          "maxCount": 90,
          "periodMin": 5,
          "action": "lock",
          "actionDurationMin": 30
        }
      },
      "passwordComplexity": {
        "enabled": "inherit",
        "value": {
          "minLength": 8,
          "characterCategories": {
            "enabled": true,
            "value": {
              "characterCount": 4,
              "upperCaseRequired": true,
              "lowerCaseRequired": true,
              "numericRequired": true,
              "nonAlphaNumericRequired": true,
              "non7bitAsciiRequired": true
            }
          },
          "usernameCharLimit": {
            "enabled": true,
            "value": {
              "minDisallowed": 3
            }
          },
          "repeatingCharLimit": {
            "enabled": true,
            "value": {
              "minDisallowed": 3
            }
          },
          "forbiddenDictionary": {
            "enabled": true,
            "value": {
              "dictionaryFilePath": "Dictionary.txt",
              "noBackwardsWord": false
            }
          }
        }
      },
      "changePassword": {
        "enabled": "inherit",
        "value": {
          "changeAdminProvidedPasswordUponFirstUse": "inherit",
          "mustChangePassword": false,
          "passwordExpiration": {
            "enabled": true,
            "value": {
              "maxAgeDays": 90,
              "emailUpon": true,
              "remindPrior": {
                "enabled": false,
                "value": {
                  "daysBefore": 5,
                  "emailUser": true
                }
              }
            }
          }
        }
      },
      "passwordHistory": {
        "enabled": "inherit",
        "value": {
          "historyDepth": 4
        }
      },
      "inactivityLimit": {
        "enabled": "inherit",
        "value": {
          "days": 90,
          "action": "remove"
        }
      }
    },
    "relationships": {
      "userTemplate": {
        "data": {
          "type": "userTemplate",
          "id": "65189354-3ab5-42b3-9281-37939abd8389"
        }
      },
      "permissionGroups": {
        "data": [
          {
            "type": "permissionGroup",
            "id": "a0db9377-92a3-4a38-8c0f-09f268d78ff1"
          }
        ]
      },
      "sslCertificate": {
        "data": null
      },
      "sshKeys": {
        "data": []
      }
    }
  }
}

POST Response Body Sample

Copy
"data": { "attributes": { "accountEnabled": "inherit", "agreementToTermsOfService": "unknown", "as2": 
{ "inbound": { "enabled": "inherit" }, "outbound": { "enabled": "inherit" } }, "changePassword": 
{ "enabled": "inherit", "value": { "changeAdminProvidedPasswordUponFirstUse": "inherit", 
"mustChangePassword": false, "passwordExpiration": { "enabled": true, "value": { "maxAgeDays": 90, 
"emailUpon": true, "remindPrior": { "enabled": false, "value": { "daysBefore": 5, "emailUser": true } 
} } } } }, "connectionTimeout": { "enabled": "inherit", "value": { "maxSec": 0 } },

POST PowerShell Sample

Copy
Write-Output "Add User POST"
Write-Output "-----"
$update = 
'{
  "data": {
    "type": "user",
    "attributes": {
      "loginName": "TestUser2",
      "password": {
        "type": "Disabled",
        "value": "Alaska12#"
      },
      "accountEnabled": "inherit",
      "expiration": {
        "enabled": false,
        "value": {
          "date": {}
        }
      },
      "personal": {
        "name": "Test User",
        "description": null,
        "email": null,
        "DUNS": null,
        "phone": null,
        "mobile": null,
        "pager": null,
        "fax": null,
        "company": null,
        "partnerId": null,
        "custom1": null,
        "custom2": null,
        "custom3": null,
        "comments": null
      },
      "isEuDataSubject": "unknown",
      "consentToPrivacyPolicy": "unknown",
      "agreementToTermsOfService": "unknown",
      "homeFolder": {
        "enabled": "yes",
        "value": {
          "path": null
        }
      },
      "hasHomeFolderAsRoot": "inherit",
      "externalAuthentication": "inherit",
      "ftp": {
        "enabled": "inherit",
        "value": {
          "enableFxp": "inherit",
          "enableNoop": "inherit",
          "enableComb": "inherit",
          "enableXcrc": "inherit",
          "enableZlib": "inherit",
          "banner": {
            "message": "",
            "usage": "useDefault"
          }
        }
      },
      "ftps": {
        "enabled": "inherit"
      },
      "sftp": {
        "enabled": "inherit",
        "value": {
          "authenticationType": "inherit"
        }
      },
      "http": {
        "enableHttp": "inherit",
        "enableHttps": "inherit",
        "enableWtc": "inherit",
        "enableShareFolder": "inherit",
        "enableSendMessage": "inherit"
      },
      "ssl": {
        "authenticationType": "inherit"
      },
      "as2": {
        "inbound": {
          "enabled": "inherit"
        },
        "outbound": {
          "enabled": "inherit"
        }
      },
      "transferSpeedLimit": {
        "enabled": "inherit",
        "value": {
          "maxKbps": 0
        }
      },
      "connectionTimeout": {
        "enabled": "inherit",
        "value": {
          "maxSec": 0
        }
      },
      "totalConnectionsLimit": {
        "enabled": "inherit",
        "value": {
          "maxNumber": 0
        }
      },
      "connectionsFromSameIpLimit": {
        "enabled": "inherit",
        "value": {
          "maxNumber": 0
        }
      },
      "uploadsPerSessionLimit": {
        "enabled": "inherit",
        "value": {
          "maxNumber": 0
        }
      },
      "downloadsPerSessionLimit": {
        "enabled": "inherit",
        "value": {
          "maxNumber": 0
        }
      },
      "uploadSizeLimit": {
        "enabled": "inherit",
        "value": {
          "maxKBytes": 0
        }
      },
      "downloadSizeLimit": {
        "enabled": "inherit",
        "value": {
          "maxKBytes": 0
        }
      },
      "ipAccessLimit": {
        "enabled": "inherit",
        "value": {
          "rules": [],
          "defaultRule": "allowAccess"
        }
      },
      "invalidLoginLimit": {
        "enabled": "inherit",
        "value": {
          "maxCount": 90,
          "periodMin": 5,
          "action": "lock",
          "actionDurationMin": 30
        }
      },
      "passwordComplexity": {
        "enabled": "inherit",
        "value": {
          "minLength": 8,
          "characterCategories": {
            "enabled": true,
            "value": {
              "characterCount": 4,
              "upperCaseRequired": true,
              "lowerCaseRequired": true,
              "numericRequired": true,
              "nonAlphaNumericRequired": true,
              "non7bitAsciiRequired": true
            }
          },
          "usernameCharLimit": {
            "enabled": true,
            "value": {
              "minDisallowed": 3
            }
          },
          "repeatingCharLimit": {
            "enabled": true,
            "value": {
              "minDisallowed": 3
            }
          },
          "forbiddenDictionary": {
            "enabled": true,
            "value": {
              "dictionaryFilePath": "Dictionary.txt",
              "noBackwardsWord": false
            }
          }
        }
      },
      "changePassword": {
        "enabled": "inherit",
        "value": {
          "changeAdminProvidedPasswordUponFirstUse": "inherit",
          "mustChangePassword": false,
          "passwordExpiration": {
            "enabled": true,
            "value": {
              "maxAgeDays": 90,
              "emailUpon": true,
              "remindPrior": {
                "enabled": false,
                "value": {
                  "daysBefore": 5,
                  "emailUser": true
                }
              }
            }
          }
        }
      },
      "passwordHistory": {
        "enabled": "inherit",
        "value": {
          "historyDepth": 4
        }
      },
      "inactivityLimit": {
        "enabled": "inherit",
        "value": {
          "days": 90,
          "action": "remove"
        }
      }
    },
    "relationships": {
      "userTemplate": {
        "data": {
          "type": "userTemplate",
          "id": "65189354-3ab5-42b3-9281-37939abd8389"
        }
      },
      "permissionGroups": {
        "data": [
          {
            "type": "permissionGroup",
            "id": "a0db9377-92a3-4a38-8c0f-09f268d78ff1"
          }
        ]
      },
      "sslCertificate": {
        "data": null
      },
      "sshKeys": {
        "data": []
      }
    }
  }
}'
$update = $update | ConvertFrom-Json
$update = $update | ConvertTo-Json -Depth 10
$PostReturn = Invoke-RestMethod -Uri 
"$baseURL/v2/sites/$siteID/users" 
-Method 'POST' -Headers $authHeader -Body $update