Register a workplace admin

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
POST /organisations/{organisation_id}/workplace_admins

Partner organisations only. A Payroll organisation calling this endpoint receives 405 Method Not Allowed.

Registers a person who can manage this organisation, and every employer in it, on the Penfold Workplace Platform. Penfold emails them an invitation to set a password. The organisation must hold at least one employer first.

If your organisation uses single sign-on with Penfold, the person is matched at sign-in on external_id. Registering an external_id that belonged to an admin you removed moves it to the new admin.

Safe to retry after a 500: nothing is left behind, and a retry sends the invitation again rather than failing.

Path parameters

  • organisation_id string Required

    Penfold organisation id.

application/json

Body Required

  • email string(email) Required

    Where Penfold sends the invitation to set a password. Must not already belong to a Penfold Workplace Platform user.

  • first_name string Required

    Minimum length is 1.

  • last_name string Required

    Minimum length is 1.

  • external_id string

    Your identifier for this person: the subject id (sub) your identity provider puts in its sign-in token. Penfold matches the admin on this at sign-in, never on email. Treated as an opaque string.

    Required if your organisation uses single sign-on with Penfold, and must be omitted otherwise (400).

    Minimum length is 1.

Responses

  • 201 application/json

    Workplace admin registered and invitation sent

    Hide response attributes Show response attributes object
    • id string Required

      Penfold workplace admin id.

    • email string(email) Required

      The admin's Penfold email address.

    • first_name string Required
    • last_name string Required
    • external_id string | null Required

      Your identifier for this person: the subject id your identity provider puts in its sign-in token. null if your organisation does not use single sign-on with Penfold.

  • 400 application/json

    Request body failed validation, or external_id was sent or missing contrary to your organisation's single sign-on setting.

    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

    Missing or invalid authentication token

    Hide response attribute Show response attribute object
    • error string

      A descriptive error message.

  • 404 application/json

    Organisation not found, or not one you manage.

    Hide response attribute Show response attribute object
    • error string

      A descriptive error message.

  • 405 application/json

    Method not allowed. Partner organisations only.

    Hide response attribute Show response attribute object
    • error string

      A descriptive error message.

  • 409 application/json

    The organisation has no employer yet (OrganisationHasNoEmployer), the external_id already belongs to an active admin (ExternalIdAlreadyMapped), or the email already belongs to a Penfold Workplace Platform user (EmailAlreadyInUse). Check code. Nothing was created and no invitation was sent.

    Any of:
  • 500 application/json

    Internal server error

    Hide response attribute Show response attribute object
    • error string

      A descriptive error message.

POST /organisations/{organisation_id}/workplace_admins
curl \
 --request POST 'https://payroll-api.getpenfold.dev/v4/organisations/{organisation_id}/workplace_admins' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{
  "email": "sam@harbourgroup.example",
  "first_name": "Sam",
  "last_name": "Taylor",
  "external_id": "usr_01HXYZ"
}'
Request examples
{
  "email": "sam@harbourgroup.example",
  "first_name": "Sam",
  "last_name": "Taylor",
  "external_id": "usr_01HXYZ"
}
Response examples (201)
{
  "id": "cmo1adm000001abcd",
  "email": "sam@harbourgroup.example",
  "first_name": "Sam",
  "last_name": "Taylor",
  "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 (404)
{
  "error": "Bad request: invalid data provided."
}
Response examples (405)
{
  "error": "Bad request: invalid data provided."
}
Response examples (409)
{
  "code": "OrganisationHasNoEmployer",
  "error": "organisation has no employer"
}
{
  "code": "ExternalIdAlreadyMapped",
  "error": "external_id already mapped to a workplace admin",
  "external_id": "usr_01HXYZ"
}
Response examples (500)
{
  "error": "Bad request: invalid data provided."
}