API ReferenceapimembershipPOST /v1/memberships/{id}/transition

POST /v1/memberships/\{id\}/transition

Service: membership · operationId: (none)

Required scopes

(no scope declared — review service config)

Path parameters

  • id (string) required

Request body

{
  "type": "object",
  "properties": {
    "trigger": {
      "type": "string"
    },
    "reason": {
      "type": "string"
    },
    "subscription_id": {
      "type": "string"
    },
    "tier": {
      "type": "string"
    }
  },
  "required": [
    "trigger"
  ]
}

Responses

200 Transition applied

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "user_id": {
      "type": "string"
    },
    "brand_id": {
      "type": "string"
    },
    "tier": {
      "type": "string"
    },
    "state": {
      "type": "string"
    },
    "subscription_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "has_access": {
      "type": "boolean"
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "user_id",
    "brand_id",
    "tier",
    "state",
    "subscription_id",
    "has_access",
    "created_at",
    "updated_at"
  ]
}

400 Invalid transition

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

404 Not found

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://membership.platform.loop.health/v1/memberships/{id}/transition \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'