Partner organisations only. A Payroll organisation calling this
endpoint receives 405 Method Not Allowed. An employer-scoped access
token receives 403 Forbidden.
Changes the email address of a workplace admin on a managed
organisation. The admin signs in with a password at the new address,
and Penfold sends their emails there. If you use single sign-on with
Penfold, the admin can still sign in through your platform, because
Penfold matches them on their external_id, not their email.
Sending the admin’s current email address, ignoring case, returns
200 and changes nothing.
Returns 404 Not Found when the organisation does not exist or is not
managed by your Partner organisation, when the admin is not registered
on that organisation, or when the admin’s access has been removed.
Path parameters
-
Unique identifier for the managed organisation.
-
Penfold’s identifier for the workplace admin, as returned when they were registered.
Responses
-
Email changed, or was already this address.
-
Bad request, the request is malformed or contains invalid data.
-
Unauthorized
-
Forbidden, the access token is scoped to an employer.
-
Organisation not found or not managed by your Partner organisation, or workplace admin not registered on that organisation (including admins whose access has been removed).
-
Method not allowed
-
The email address already belongs to another Penfold Workplace Platform account. Nothing is changed.
-
Internal server error. The email is unchanged, so you can retry.
curl \
--request PATCH 'https://payroll-api.getpenfold.dev/v4/organisations/{organisation_id}/workplace_admins/{workplace_admin_id}' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"email": "jane.smith@example.com"
}'
{
"email": "jane.smith@example.com"
}
{
"id": "cm1wxyz2e0000abc123456789",
"email": "jane.smith@example.com",
"first_name": "Jane",
"last_name": "Smith",
"external_id": "usr_01HXYZ"
}
{
"error": "Bad request: invalid data provided.",
"validation_errors": [
{
"field": "email",
"message": "Email address is invalid."
}
]
}
{
"error": "Bad request: invalid data provided."
}
{
"error": "Bad request: invalid data provided."
}
{
"error": "Bad request: invalid data provided."
}
{
"error": "Bad request: invalid data provided."
}
{
"code": "EmailAlreadyInUse",
"error": "email already in use"
}
{
"error": "Bad request: invalid data provided."
}