> For the complete documentation index, see [llms.txt](https://developers.memberspace.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.memberspace.com/admin-api/endpoints/models.md).

# Models

## The PlanExpiration object

```json
{"openapi":"3.2.0","info":{"title":"MemberSpace Admin API","version":"1.0.0"},"components":{"schemas":{"PlanExpiration":{"description":"When a member's access from this plan expires.","oneOf":[{"title":"Never expires","type":"object","required":["mode"],"properties":{"mode":{"type":"string","enum":["none"]}}},{"title":"After time period","type":"object","required":["mode","count","unit"],"properties":{"mode":{"type":"string","enum":["interval"]},"count":{"type":"integer"},"unit":{"type":"string","enum":["day","week","month","year"]}}},{"title":"At specific datetime","type":"object","required":["mode","expiresAt"],"properties":{"mode":{"type":"string","enum":["specificTime"]},"expiresAt":{"type":"string","format":"date-time"}}}]}}}}
```

## The Plan object

```json
{"openapi":"3.2.0","info":{"title":"MemberSpace Admin API","version":"1.0.0"},"components":{"schemas":{"Plan":{"type":"object","description":"A membership plan.","allOf":[{"type":"object","required":["id","publicId","name","status","isPublic","colorCode","activeMemberCount","createdAt","updatedAt"],"properties":{"id":{"type":"integer","description":"Unique plan identifier."},"publicId":{"type":"string","description":"Unique public plan identifier."},"name":{"type":"string","description":"Plan name."},"description":{"type":"string","description":"Rich text shown during signup."},"status":{"type":"string","enum":["enabled","disabled","archived","deleted"],"description":"Plan lifecycle state. Archived plans are hidden from the dashboard but retain their memberships; deleted plans are read-only."},"isPublic":{"type":"boolean","description":"Whether the plan is publicly listed."},"activeMemberCount":{"type":"integer","description":"Number of active members on the plan."},"colorCode":{"type":"string","description":"Hex color code, auto-assigned when the plan is created."},"contentUrl":{"type":"string","description":"Redirect target for content after login."},"welcomeUrl":{"type":"string","description":"Redirect target for the welcome screen after signup."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},{"oneOf":[{"title":"Free","type":"object","required":["type","expiration"],"properties":{"type":{"type":"string","enum":["free"]},"expiration":{"$ref":"#/components/schemas/PlanExpiration"}}},{"title":"One time payment","type":"object","required":["type","billingDetails","expiration"],"properties":{"type":{"type":"string","enum":["oneTimePayment"]},"billingDetails":{"type":"object","required":["price","currency"],"properties":{"price":{"type":"number","description":"Price in the plan currency."},"currency":{"type":"string","description":"3 letter [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217)."},"taxPercentage":{"type":"number"},"taxDescription":{"type":"string","description":"Rich text shown during signup. Present only with taxPercentage."}}},"expiration":{"$ref":"#/components/schemas/PlanExpiration"}}},{"title":"Multi-payment","type":"object","required":["type","billingDetails","expiration"],"properties":{"type":{"type":"string","enum":["multiPayment"]},"billingDetails":{"type":"object","required":["price","currency","interval","paymentCountRequired"],"properties":{"price":{"type":"number"},"currency":{"type":"string","description":"3 letter [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217)."},"interval":{"type":"object","description":"How often the member is billed.","required":["count","unit"],"properties":{"count":{"type":"integer","description":"The number part of the interval. I.e. `3 month`."},"unit":{"type":"string","enum":["day","week","month","year"]}}},"paymentCountRequired":{"type":"integer","description":"Total number of payments before the plan is paid off."},"trialPeriodDays":{"type":"integer","description":"Length of the free trial in days. Mutually exclusive with signupFee."},"signupFee":{"type":"number","description":"One-time fee charged at signup. Mutually exclusive with trialPeriodDays."},"taxPercentage":{"type":"number"},"taxDescription":{"type":"string","description":"Rich text shown during signup. Present only with taxPercentage."}}},"expiration":{"$ref":"#/components/schemas/PlanExpiration"}}},{"title":"Subscription","type":"object","required":["type","billingDetails"],"properties":{"type":{"type":"string","enum":["subscription"]},"billingDetails":{"type":"object","required":["price","currency","interval"],"properties":{"price":{"type":"number"},"currency":{"type":"string","description":"3 letter [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217)."},"interval":{"type":"object","description":"How often the member is billed.","required":["count","unit"],"properties":{"count":{"type":"integer","description":"The number part of the interval. I.e. `3 month`."},"unit":{"type":"string","enum":["day","week","month","year"]}}},"billingDate":{"type":"object","required":["day"],"description":"Fixed billing date, when set. `day` for monthly, `day` + `month` for yearly.","properties":{"day":{"type":"integer","description":"1–31."},"month":{"type":"integer","description":"1–12."}}},"trialPeriodDays":{"type":"integer","description":"Length of the free trial in days. Mutually exclusive with signupFee."},"signupFee":{"type":"number","description":"One-time fee charged at signup. Mutually exclusive with trialPeriodDays."},"taxPercentage":{"type":"number"},"taxDescription":{"type":"string","description":"Rich text shown during signup. Present only with taxPercentage."}}}}}]}]},"PlanExpiration":{"description":"When a member's access from this plan expires.","oneOf":[{"title":"Never expires","type":"object","required":["mode"],"properties":{"mode":{"type":"string","enum":["none"]}}},{"title":"After time period","type":"object","required":["mode","count","unit"],"properties":{"mode":{"type":"string","enum":["interval"]},"count":{"type":"integer"},"unit":{"type":"string","enum":["day","week","month","year"]}}},{"title":"At specific datetime","type":"object","required":["mode","expiresAt"],"properties":{"mode":{"type":"string","enum":["specificTime"]},"expiresAt":{"type":"string","format":"date-time"}}}]}}}}
```

## The ApiError object

```json
{"openapi":"3.2.0","info":{"title":"MemberSpace Admin API","version":"1.0.0"},"components":{"schemas":{"ApiError":{"type":"object","description":"Error response.","required":["errors"],"properties":{"errors":{"type":"array","description":"The errors that occurred.","items":{"type":"object","required":["path","code","message"],"properties":{"path":{"type":"string","description":"`base` for errors not tied to a specific field; otherwise the dotted path of the offending field (e.g. `community.isEnabled`)."},"code":{"type":"string","description":"Machine-readable error code."},"message":{"type":"string","description":"Human-readable error message."}}}}}}}}}
```
