API ReferenceapimembershipPOST /v1/memberships

POST /v1/memberships

Service: membership · operationId: (none)

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "user_id": {
      "type": "string"
    },
    "brand_id": {
      "type": "string"
    },
    "tier": {
      "type": "string"
    },
    "subscription_id": {
      "type": "string"
    }
  },
  "required": [
    "user_id",
    "brand_id",
    "tier"
  ]
}

Responses

201 Membership created

{
  "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"
  ]
}

409 Membership already exists

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

Example

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