Create administrator
Creates a new administrator in your organization. An email will be sent for this administrator to confirm and configure their account.
To establish which teams an administrator can manage, see Teams.
Body parameters
Name | Type | Description |
---|---|---|
name | string | The administrator’s complete name. |
string | The administrator’s email address. | |
phone | string | Optional. The administrator's phone number. |
isReadOnly | boolean | Optional. Whether this administrator can perform write operations. |
curl -X POST "https://onfleet.com/api/v2/admins" \
-u "cd3b3de84cc1ee040bf06512d233719c:" \
-d '{"name":"Chelsea M","email":"[email protected]"}'
onfleet.administrators.create(body={"name":"Chelsea M","email":"[email protected]"})
onfleet.administrators.create({"name":"Chelsea M","email":"[email protected]"});
$onfleet->administrator->create(["name"=>"Chelsea M","email"=>"[email protected]"])
{
"id": "8AxaiKwMd~np7I*YP2NfukBE",
"timeCreated": 1455156651000,
"timeLastModified": 1455156651779,
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"email": "[email protected]",
"type": "standard",
"name": "Chelsea M",
"isActive": false,
"metadata": []
}
{
"code": "InvalidContent",
"message": {
"error": 1004,
"message": "The values of one or more parameters break a uniqueness constraint.",
"cause": {
"type": "duplicateKey",
"key": "unknown",
"value": "unknown"
},
"request": "fbf5580f-d4bd-458b-950d-f7dd057afcc8"
}
}
When a duplicate email is used in creating an administrator, it will break the uniqueness constraint of the database and throw a duplicateKey
error.
Request and Response
isActive
denotes whether the administrator has completed their account registration, whereastype
indicates if this administrator is the organization's creator (super
) or a dispatcher (standard
).