SMAO API Documentation

Create MSP or customer organization

Creates either an MSP organization or a customer organization.

MSP creation requires owner and an initial license whose status is available (or omitted, which defaults to available). The owner invitation is created and email delivery is best-effort; the response includes owner.invitationId.

Customer creation requires parentOrganizationId and an available externalLicenseId. No customer admin is invited automatically, and owner is rejected for customer requests.

POST
/organizations
AuthorizationBearer <token>

In: header

typestring
Value in"msp"
externalOrganizationIdstring
Length1 <= length <= 255
organization
owner
license

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.smao.ai/api/distributor/v2/organizations" \  -H "Content-Type: application/json" \  -d '{    "type": "msp",    "externalOrganizationId": "acme-msp-1000",    "organization": {      "name": "MSP Hamburg GmbH",      "industry": "IT Services",      "timezone": "Europe/Berlin"    },    "owner": {      "email": "[email protected]",      "firstName": "Ada",      "lastName": "Admin"    },    "license": {      "externalLicenseId": "lic-msp-1000",      "status": "available",      "plan": {        "slug": "business",        "commitment": "monthly"      }    }  }'
{
  "status": "success",
  "organization": {
    "id": "string",
    "type": "msp",
    "name": "string",
    "industry": "string",
    "timezone": "string",
    "channelPartner": "string",
    "externalOrganizationId": "string",
    "parentOrganizationId": "string",
    "status": "active",
    "blockedReason": "string",
    "ownerEmail": "string",
    "externalLicenseId": "string",
    "license": {
      "id": "string",
      "externalLicenseId": "string",
      "status": "available",
      "owningOrganizationId": "string",
      "assignedOrganizationId": "string",
      "plan": {
        "id": "string",
        "slug": "string",
        "name": "string",
        "commitment": "none",
        "currency": "string",
        "baseFee": 0
      },
      "assignedAt": "2019-08-24T14:15:22Z",
      "disabledAt": "2019-08-24T14:15:22Z",
      "createdAt": "2019-08-24T14:15:22Z",
      "updatedAt": "2019-08-24T14:15:22Z"
    },
    "createdAt": "2019-08-24T14:15:22Z"
  },
  "owner": {
    "email": "string",
    "firstName": "string",
    "lastName": "string",
    "role": "string",
    "status": "string",
    "source": "string",
    "invitationId": "string",
    "expiresAt": "2019-08-24T14:15:22Z"
  }
}
{
  "status": "error",
  "errorCode": "VALIDATION_ERROR",
  "message": "string"
}
{
  "status": "error",
  "errorCode": "VALIDATION_ERROR",
  "message": "string"
}
{
  "status": "error",
  "errorCode": "VALIDATION_ERROR",
  "message": "string"
}
{
  "status": "error",
  "errorCode": "VALIDATION_ERROR",
  "message": "string"
}

{
  "status": "error",
  "errorCode": "RATE_LIMITED",
  "message": "Too many requests for this API key."
}
{
  "status": "error",
  "errorCode": "VALIDATION_ERROR",
  "message": "string"
}

{
  "status": "error",
  "errorCode": "RATE_LIMIT_UNAVAILABLE",
  "message": "Rate limit storage is unavailable. Try again later."
}