RepEdit(
object Rep,
bool InviteUser,
bool WebhookEvaluate
)
Edit a rep user’s information.
Available since RPM29
Request
Request Data:
- (object) Rep (required) – the rep’s data
- (int) RepID (required) – identify the rep to edit by its ID
- (string) Username (optional) – change the rep’s username
- (string) Company (optional) – the rep’s company name
- (bool) Enabled (optional, default false) – if the rep’s user can sign in
- (bool) CommissionsHidden (optional, default false) – if the reps is allowed to see sales commission
- (enum) Relationship (optional, default Employee) – whether the rep is an Employee or a SubAgent
- (object) Contact (required) – The rep’s contact information
- (string) Salutation (optional)
- (string) FirstName (optional)
- (string) LastName (optional)
- (string) Title (optional)
- (string) Email (optional) – Must be valid if InviteUser is true
- (array) PhoneNumbers (optional) – a list of up to 4 phone numbers, each using the following structure
- (string) Number (optional) – the phone number
- (enum) Type (optional) – number indicating the type of phone number it is (there cannot be repeated types): 1-Business, 2-Home, 3-Fax, 4-Other
- (array) Fields (optional) – a list of basic fields to fill in, each using the following structure:
- (string) Field (optional) – the field name
- (string) Value (optional) – the field value
- (array) AssignmentCodes (optional) – a list of existing assignment codes to give the rep
- (int) SupplierID (optional) – the supplier
- (string) AssignmentCode (optional) – the assignment code
- (bool) InviteUser (optional, default: false) – whether to send an email to the new user so they can finish setting up their account
- (bool) WebhookEvaluate (optional, default: false) – whether RPM should issue webhook requests
{
"Rep": {
"Company": <string>,
"Username": <string>,
"Enabled": <bool>,
"CommissionsHidden": <bool>,
"Relationship": <enum 0=Employee, 1=SubAgent>,
"Contact": {
"Salutation": <string>,
"FirstName": <string>,
"LastName": <string>,
"Title": <string>,
"Email": <string>,
"PhoneNumbers": [
{
"PhoneNumberID": <int>,
"Type": <enum 1=Business, 2=Home, 3=Fax, 6=Other>,
"Number": <string>
}, // ... 1 per Type
]
},
"Fields": [ // optional
{
"Field": <string>,
"Value": <string>
},
// ... more fields
],
"AssignmentCodes": [
{
"SupplierID": <int>,
"AssignmentCode": <string>
},
// ... more assignment codes
]
},
"InviteUser": <bool>, // default: false
"WebhookEvaluate": <bool>, // default: false
}
Response
Same structure as the Rep endpoint.
Notes
- Enabling users will affect costs starting in the current billing cycle.
- Disabling users will take effect on the next billing cycle.
Errors
- “Rep not found” – the provided rep ID does not exist
- “Invite requires a valid email address” – RPM will use the email sent in the request if provided, otherwise it uses the rep’s current email address.
- “Empty value was found: “Contact.FirstName” cannot be empty” – If the first name is provided but is empty
- “Empty value was found: “Contact.LastName” cannot be empty” – If the last name is provided but is empty
- “Unrecognized type for phone number: <int>” – when a phone number type is not a valid one from the enum