Phin Security

Sleep user in company API Route

The "Sleep user in company" API route allows sleeping up to 100 users at once by submitting an array of user emails, skipping non-existent or already slept users, and returns success or detailed error information including which active users failed to update.

  1. 1.Help Center
  2. 2.API / Technical Questions
  3. 3.Phin API Documentation

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

FieldTypeRequired
userEmailsarray[String]Yes

Body Sample

{ "userEmails":
  [\
    "[email protected]",\
    "[email protected]",\
    ...,\
    "[email protected]"\
\
  ]
}

Response Reference

FieldTypeDescription
errorstringReturned only when one or more users who were found and active could not be updated
failedUserEmailsarray[string]Lists only users who were found, were active, and whose update failed. Unmatched and already-slept emails never appear here.
messagestringReturned with status 200 when no update failed: "Successfully slept users". Emails that don’t match a user, and users who are already slept, are skipped and don’t count as failures.

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": ["[email protected]"]
}

Error Reference

CodeMessageExplanation
400Bad requestThe request was missing required fields.
404Company does not existThe provided companyId either does not exist, or maps to a company that has been deleted.
500Failed to sleep usersSome users were found and active but could not be slept. Check failedUserEmails for the affected users and retry. If this persists, contact Phin Support. Emails that don’t match a user don’t cause this error.

Was this article helpful?

YesNo

Related articles