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

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:

POST /partners/{partnerId}/companies/{companyId}/admins


Body:

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 admin
400 — 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 partner
401 — No access token was sent
404 — Company id was not found
500 — Unexpected server error

Invalid name or email:

{
  "error": "Bad request. A valid first name, last name, and email are required to create a company admin."
}