Disconnect a managed organisation

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}/disconnect

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

Hands a managed organisation back to Penfold, for example when the customer leaves you but stays with Penfold. The organisation and its employers stay on Penfold.

This ends your access to the organisation and its employers. Requests for them return 404 Not Found and you receive no more webhooks about them, unless an employer is also in another organisation you manage.

Returns 404 Not Found when the organisation does not exist, is not managed by your Partner organisation, or has already been disconnected.

Path parameters

  • organisation_id string Required

    Unique identifier for the managed organisation.

Responses

  • 200

    Organisation disconnected.

  • 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, not managed by your Partner organisation, or already disconnected.

    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.

POST /organisations/{organisation_id}/disconnect
curl \
 --request POST 'https://payroll-api.getpenfold.dev/v4/organisations/{organisation_id}/disconnect' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
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."
}