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. An employer-scoped access token receives 403 Forbidden.

Registers a person as a workplace admin of a managed organisation. Penfold creates their Workplace Platform account and emails them an invitation to set a password.

Path parameters

  • organisation_id string Required

    Unique identifier for the managed organisation.

application/json

Body Required

  • email string(email) Required

    The admin’s email address. Penfold sends the invitation to set a password here.

  • first_name string Required
  • last_name string Required
  • external_id string

    Your platform’s unique identifier for this admin. Penfold stores it to link the admin back to your platform, for example when the admin signs in to Penfold through your platform. Required for Partner organisations that use single sign-on with Penfold; omit it otherwise. Must not be blank. Maximum 255 characters.

    Maximum length is 255.

Responses

  • 201 application/json

    Workplace admin registered and invitation sent

    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.

    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 admin cannot be registered. Nothing is created and no invitation is sent. Use code, not error, to tell the cases apart. error is a human-readable message and its wording may change.

    Any of:
  • 500 application/json

    Internal server error. Nothing is created and no invitation is sent, so you can retry.

    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": "jane.smith@example.com",
  "first_name": "Jane",
  "last_name": "Smith",
  "external_id": "usr_01HXYZ"
}'
Request examples
{
  "email": "jane.smith@example.com",
  "first_name": "Jane",
  "last_name": "Smith",
  "external_id": "usr_01HXYZ"
}
Response examples (201)
{
  "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": "OrganisationHasNoEmployer",
  "error": "organisation has no employer"
}
{
  "code": "ExternalIdAlreadyMapped",
  "error": "external_id already mapped"
}
{
  "code": "EmailAlreadyInUse",
  "error": "email already in use"
}
Response examples (500)
{
  "error": "Bad request: invalid data provided."
}