How to Create a Company Admin with the Phin API
Use this route to create a company admin, or to give an existing admin access to another company.
Endpoint:
Body:
first, last, and email are required.
Names are trimmed. Email is stored in lowercase.
New admin
If that email is not already an admin, Phin creates the admin, assigns them to the company, and emails a password setup link.
Existing admin
If that email is already an admin, Phin adds this company to that admin. The response id is the existing admin. Phin does not create a second account and does not send another setup email.
Status codes
Invalid name or email:
Endpoint:
POST /partners/{partnerId}/companies/{companyId}/adminsBody:
first, last, and email are required.
{ "first": "Ada", "last": "Lovelace", "email": "ada@example.com"}Names are trimmed. Email is stored in lowercase.
New admin
If that email is not already an admin, Phin creates the admin, assigns them to the company, and emails a password setup link.
{ "id": "auth0|admin-id", "first": "Ada", "last": "Lovelace", "email": "ada@example.com"}Existing admin
If that email is already an admin, Phin adds this company to that admin. The response id is the existing admin. Phin does not create a second account and does not send another setup email.
Status codes
200 — Admin created, or the company was added to an existing admin400 — Missing or invalid first, last, or email. Also returned when the API client is not this partner's Phin API key, or the company is not in that partner401 — No access token was sent404 — Company id was not found500 — Unexpected server errorInvalid name or email:
{ "error": "Bad request. A valid first name, last name, and email are required to create a company admin."}