Skip to main content
Developer docs menu

Reference · Organisation

Get your organisation

get/api/organizations/current

Returns the organisation the key belongs to: its id, its name and the name of its plan. Any active key can call it, whatever its scopes, so it is the quickest way to check a new key works.

Parameters

None.

Example request

curl -s "https://www.quickpolicy.co.uk/api/organizations/current" \
  -H "Authorization: Bearer $QP_API_KEY"

Response

200 OK with a JSON body. Responses can carry more fields than are listed here; ignore any you do not recognise.

  • successalways true
  • organizationobject
    • idstring
    • namestring
    • planobject
      • namestring

        The name of your plan, for example Professional.

Example response
{
  "success": true,
  "organization": {
    "id": "cm3org0001",
    "name": "Acme Health Ltd",
    "plan": {
      "name": "Professional"
    }
  }
}

Errors

Every error has a JSON body with an error message. About errors

  • 401 The key is missing, wrong, deleted, switched off or past its expiry date.

    {"error":{"code":"UNAUTHORIZED","message":"The API key is missing, wrong, deleted or past its expiry date."}}
  • 403 Your organisation's plan no longer includes API access. Checked on every request.

    {"error":{"code":"API_ACCESS_NOT_IN_PLAN","message":"Your organisation's plan no longer includes API access, so its API keys have stopped working."}}
  • 429 The key has made more than 120 requests in a minute. Wait for the seconds in Retry-After.

    {"error":{"code":"RATE_LIMITED","message":"This key has made more than 120 requests in a minute. Wait 42 seconds and try again."}}
  • 404 The organisation no longer exists.

    {"error":{"code":"NOT_FOUND","message":"Organization not found"}}
  • 500 Something went wrong on our side.

    {"error":{"code":"INTERNAL_ERROR","message":"Unable to fetch organization"}}