Skip to content
  • There are no suggestions because the search field is empty.

Sleep user in company API Route

This route is used to sleep up to 100 users at a time via the Phin API. Users who do not exist or are already slept will not be updated. 

Body Reference

Field Type Required
userEmails array[String] Yes
 

Body Sample

{ "userEmails":
[
"userEmail1@example.com",
"userEmail2@example.com",
...,
"userEmailN@example.com"

]
}

Response Reference

Field Type Description
error string If any users failed to be slept, this field is returned with a message of why the users were not slept.
failedUserEmails array[string] If any users failed to be slept, this field is returned and provides a list of all users that failed to be slept.
message string If all users are successfully slept (or do not exist), this field is returned.

Error Response Sample

{ 
"error": "Failed to sleep 1 users. Ensure that provided emails are valid and that the users exist in the provided company",
"failedUserEmails": ["userEmail1@example.com"]
}

Error Reference

Code Message Explanation
400 Bad request The request was missing required fields.
404 Company does not exist The provided companyId either does not exist, or maps to a company that has been deleted.
500 Failed to sleep users Some or all users could not be slept. Review the provided error message and array of failed users. If all looks correct and this persists, contact Phin support.