Update administrator

Update administrator

Update an existing administrator's information. You can modify basic details such as name, phone number, and read-only permissions. Note that you cannot change an administrator's type from super to standard or vice versa - you must delete and recreate the administrator to change their type.

Updateable fields:

namestringDescription
emailstringThe administrator’s email address.
phonestringThe administrator's phone number.
isReadOnlybooleanWhether this administrator can perform write operations.
typestringsuper or standard
curl -X PUT "https://onfleet.com/api/v2/admins/8AxaiKwMd~np7I*YP2NfukBE" \
       -u "<your_api_key>:" \
       -d '{"name":"C Manning"}'
onfleet.administrators.update(id="8AxaiKwMd~np7I*YP2NfukBE", body={"name":"C Manning"})
onfleet.administrators.update("8AxaiKwMd~np7I*YP2NfukBE", {"name":"C Manning"});
$onfleet->administrators->update("8AxaiKwMd~np7I*YP2NfukBE", ["name"=>"C Manning"]);
{
  "id": "8AxaiKwMd~np7I*YP2NfukBE",
  "timeCreated": 1455156651000,
  "timeLastModified": 1455156652494,
  "organization": "yAM*fDkztrT3gUcz9mNDgNOL",
  "email": "[email protected]",
  "type": "standard",
  "name": "C Manning",
  "isActive": false,
  "metadata": []
}
{
  "code": "InvalidContent",
  "message": {
    "error": 1005,
    "message": "The data types of one or more parameters are invalid.",
    "cause": "PuLjIsI8nF1xGU3vRWn2XA~Ta must be of type ObjectId",
    "request": "aa7d0676-5f2d-4baa-aa38-4285c2bdb438"
  }
}
{
  "code": "ResourceNotFound",
  "message": {
    "error": 1402,
    "message": "The requested resource does not exist.",
    "request": "a9212a19-73f9-461a-ae76-cfa1da474d4e"
  }
}

The adminID has to be formatted correctly and exist in your organization, otherwise, errors will be thrown.