Change a workplace admin’s email

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://docs.getpenfold.dev/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "Penfold Payroll API v4 MCP server": {
    "url": "https://docs.getpenfold.dev/mcp"
  }
}

Close
PATCH /organisations/{organisation_id}/workplace_admins/{workplace_admin_id}

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

  • organisation_id string Required

    Unique identifier for the managed organisation.

  • workplace_admin_id string Required

    Penfold’s identifier for the workplace admin, as returned when they were registered.

application/json

Body Required

  • email string(email) Required

    The admin’s new email address. They sign in with a password at this address, and Penfold sends their emails here.

Responses

  • 200 application/json

    Email changed, or was already this address.

    Hide response attributes Show response attributes object
    • id string Required

      Penfold’s identifier for the workplace admin.

    • email string(email) Required
    • first_name string Required
    • last_name string Required
    • external_id string

      Your platform’s identifier for this admin, as supplied when they were registered. Omitted when none was supplied, and for Partner organisations that do not use single sign-on.

  • 400 application/json

    Bad request, the request is malformed or contains invalid data.

    Hide response attributes Show response attributes object
    • error string

      A descriptive error message.

    • validation_errors array[object]
      Hide validation_errors attributes Show validation_errors attributes object
      • field string Required

        The name of the field that failed validation.

      • message string Required

        A descriptive error message.

  • 401 application/json

    Unauthorized

    Hide response attribute Show response attribute object
    • error string

      A descriptive error message.

  • 403 application/json

    Forbidden, the access token is scoped to an employer.

    Hide response attribute Show response attribute object
    • error string

      A descriptive error message.

  • 404 application/json

    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).

    Hide response attribute Show response attribute object
    • error string

      A descriptive error message.

  • 405 application/json

    Method not allowed

    Hide response attribute Show response attribute object
    • error string

      A descriptive error message.

  • 409 application/json

    The email address already belongs to another Penfold Workplace Platform account. Nothing is changed.

    Hide response attributes Show response attributes object
    • code string Required

      The email address already belongs to a Penfold Workplace Platform account, on this organisation or another one.

      Value is EmailAlreadyInUse.

    • error string Required
  • 500 application/json

    Internal server error. The email is unchanged, so you can retry.

    Hide response attribute Show response attribute object
    • error string

      A descriptive error message.

PATCH /organisations/{organisation_id}/workplace_admins/{workplace_admin_id}
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"
}'
Request examples
{
  "email": "jane.smith@example.com"
}
Response examples (200)
{
  "id": "cm1wxyz2e0000abc123456789",
  "email": "jane.smith@example.com",
  "first_name": "Jane",
  "last_name": "Smith",
  "external_id": "usr_01HXYZ"
}
Response examples (400)
{
  "error": "Bad request: invalid data provided.",
  "validation_errors": [
    {
      "field": "email",
      "message": "Email address is invalid."
    }
  ]
}
Response examples (401)
{
  "error": "Bad request: invalid data provided."
}
Response examples (403)
{
  "error": "Bad request: invalid data provided."
}
Response examples (404)
{
  "error": "Bad request: invalid data provided."
}
Response examples (405)
{
  "error": "Bad request: invalid data provided."
}
Response examples (409)
{
  "code": "EmailAlreadyInUse",
  "error": "email already in use"
}
Response examples (500)
{
  "error": "Bad request: invalid data provided."
}