Skip to content

Business Services

Connect and synchronize an existing Stable service

Connect an existing Stable location to a requested business enrollment (platform admins only), sync one page of mail, or generate a hosted USPS authorization session. Requires business-services:write and current business management permission. connect_existing requires explicit confirmation that the location belongs to the selected business. Does not create or purchase subscriptions, change the state agent record, forward or destroy mail, deposit checks, form a business or file taxes. Recheck current access before idempotent replay.

Method

POST

Path

/v1/business-services

Required scope

business-services:write

Request

curl -X POST "https://api.endurancehq.app/v1/business-services" \
  -H "Authorization: Bearer $EHQ_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

JSON body schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "scopeType": {
      "type": "string",
      "enum": [
        "platform",
        "organization",
        "user"
      ]
    },
    "scopeId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "action": {
      "type": "string",
      "enum": [
        "connect_existing",
        "sync",
        "onboard"
      ]
    },
    "enrollmentId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "providerLocationId": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "confirmBusinessOwnership": {
      "type": "boolean",
      "const": true
    },
    "after": {
      "type": "string",
      "maxLength": 2000
    }
  },
  "required": [
    "scopeType",
    "action",
    "enrollmentId"
  ],
  "additionalProperties": false
}

Response

Success status: 200

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "enrollmentId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "action": {
          "type": "string",
          "enum": [
            "connect_existing",
            "sync",
            "onboard"
          ]
        },
        "syncedMailCount": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        },
        "hasMore": {
          "type": "boolean"
        },
        "onboarding": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "expiresAt": {
                  "type": "string"
                }
              },
              "required": [
                "url",
                "expiresAt"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "enrollmentId",
        "action",
        "syncedMailCount",
        "nextCursor",
        "hasMore",
        "onboarding"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "data"
  ],
  "additionalProperties": false
}

Other surfaces

MCP tool: ehq_business_services_command