Link a client’s people to your platform

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 /partner_management_requests/{partner_management_request_id}/sso_identity_links

Partner organisations only. A Payroll organisation calling this endpoint receives 405 Method Not Allowed. An employer-scoped access token receives 403 Forbidden.

While you manage the request’s organisation, links the workplace admins and employees already on the client’s organisation to your platform’s identifiers, so they can sign in to Penfold through your platform. Read Penfold’s identifiers from the workplace admin and employee endpoints, match them to your people, and send the pairs.

Each row is linked, skipped or failed on its own, and one failed row does not stop the others. A row that was already linked is skipped, so you can safely send the whole batch again after fixing the failed rows.

Returns 404 Not Found when the request does not exist or was sent by another organisation.

Path parameters

  • partner_management_request_id string Required

    Penfold’s identifier for the partner management request, as returned when it was created.

application/json

Body Required

  • workplace_admins array[object]
    Hide workplace_admins attributes Show workplace_admins attributes object
    • workplace_admin_id string Required

      Penfold’s identifier for the workplace admin, from GET /organisations/{organisation_id}/workplace_admins.

      Minimum length is 1.

    • external_id string Required

      Your platform’s identifier for the admin. Must not be blank. Maximum 255 characters.

      Minimum length is 1, maximum length is 255.

  • employees array[object]
    Hide employees attributes Show employees attributes object
    • employee_id string Required

      Penfold’s identifier for the employee, from GET /employers/{employer_id}/employees.

      Minimum length is 1.

    • external_id string Required

      Your platform’s identifier for the employee. Must not be blank. Maximum 255 characters.

      Minimum length is 1, maximum length is 255.

Responses

  • 200 application/json

    Every row was processed. Check each row’s result.

    Hide response attributes Show response attributes object
    • workplace_admins array[object] Required
      Hide workplace_admins attributes Show workplace_admins attributes object
      • workplace_admin_id string Required

        The workplace_admin_id you sent.

      • external_id string Required

        The external_id you sent.

      • result string Required

        What happened to one row.

        • Linked: The person can now sign in to Penfold through your platform.
        • Skipped: The person was already linked to this external_id. Nothing changed.
        • Failed: The row was not linked. reason says why.

        Values are Linked, Skipped, or Failed.

      • reason string Required

        Why the row was not linked. null unless result is Failed.

        Values are WorkplaceAdminNotFound, WorkplaceAdminAlreadyLinked, or ExternalIdAlreadyMapped.

    • employees array[object] Required
      Hide employees attributes Show employees attributes object
      • employee_id string Required

        The employee_id you sent.

      • external_id string Required

        The external_id you sent.

      • result string Required

        What happened to one row.

        • Linked: The person can now sign in to Penfold through your platform.
        • Skipped: The person was already linked to this external_id. Nothing changed.
        • Failed: The row was not linked. reason says why.

        Values are Linked, Skipped, or Failed.

      • reason string Required

        Why the row was not linked. null unless result is Failed.

        Values are EmployeeNotFound, EmployeeAlreadyLinked, or ExternalIdAlreadyMapped.

  • 400 application/json

    Bad request, the request is malformed, has no rows, or has more than 1,000 rows in total.

    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

    Partner management request not found, or sent by another 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

    Nothing can be linked for this request. Nothing was linked. Use code, not error, to tell the cases apart; error is a human-readable message and its wording may change.

    Any of:
POST /partner_management_requests/{partner_management_request_id}/sso_identity_links
curl \
 --request POST 'https://payroll-api.getpenfold.dev/v4/partner_management_requests/{partner_management_request_id}/sso_identity_links' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{
  "workplace_admins": [
    {
      "workplace_admin_id": "cm1wxyz2e0000abc123456789",
      "external_id": "usr_01HXYZ"
    }
  ],
  "employees": [
    {
      "employee_id": "cm1emp12e0000abc123456789",
      "external_id": "wkr_01HXYZ"
    }
  ]
}'
Request examples
{
  "workplace_admins": [
    {
      "workplace_admin_id": "cm1wxyz2e0000abc123456789",
      "external_id": "usr_01HXYZ"
    }
  ],
  "employees": [
    {
      "employee_id": "cm1emp12e0000abc123456789",
      "external_id": "wkr_01HXYZ"
    }
  ]
}
Response examples (200)
{
  "workplace_admins": [
    {
      "workplace_admin_id": "cm1wxyz2e0000abc123456789",
      "external_id": "usr_01HXYZ",
      "result": "Linked",
      "reason": "WorkplaceAdminNotFound"
    }
  ],
  "employees": [
    {
      "employee_id": "cm1emp12e0000abc123456789",
      "external_id": "wkr_01HXYZ",
      "result": "Linked",
      "reason": "EmployeeNotFound"
    }
  ]
}
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": "OrganisationNotManagedByPartner",
  "error": "you do not manage this request's organisation"
}
{
  "code": "SsoNotConfigured",
  "error": "single sign-on is not configured"
}