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. |
type | string | super or standard |
curl -X POST "https://onfleet.com/api/v2/admins" \
-u "cd3b3de84cc1ee040bf06512d233719c:" \
-d '{"name":"Chelsea M","email":"[email protected]","type": "super"}'
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": [],
"isAccountOwner": false,
"teams": []
}
{
"id": "0lQJt3~Nxodo1a~LdjA29WL4",
"timeCreated": 1659471263000,
"timeLastModified": 1659471263973,
"organization": "1MWYTEQf6jioThhHhH4~KmVI",
"email": "[email protected]",
"type": "super",
"name": "John Doe",
"isActive": false,
"metadata": [],
"isReadOnly": false,
"isAccountOwner": false,
"teams": []
}
{
"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
). Currently you cannot update an admin's role fromsuper
tostandard
or vice versa, you must delete the admin and recreate it if you wish to do so.
Account Owner
Account Owner is denoted by the
isAccountOwner
field in the response. Designates the account owner admin of the account - account owners have all of the abilities of ansuper
type admin but can also modify Onfleet plan type and billing.