> 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 Site object

```json
{"openapi":"3.2.0","info":{"title":"MemberSpace Admin API","version":"1.0.0"},"components":{"schemas":{"Site":{"type":"object","description":"A MemberSpace site the API key is authorized to access.","properties":{"id":{"type":"integer","description":"Unique site identifier."},"name":{"type":"string","description":"The site's display name."},"subdomain":{"type":"string","description":"Secondary unique ID of the site"},"domain":{"type":"string","description":"The site's custom domain."},"defaultCurrency":{"type":"string","description":"ISO 4217 currency code used for the site's plans, e.g. `usd`."},"locale":{"type":"string","description":"The 2 char [ISO 639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language code"},"metrics":{"type":"object","description":"Member counts for the site.","properties":{"activeMemberCount":{"type":"integer","description":"Number of active members on the site."},"freeMemberCount":{"type":"integer","description":"Number of members on free plans."},"paidMemberCount":{"type":"integer","description":"Number of members on paid plans."}},"required":["activeMemberCount","freeMemberCount","paidMemberCount"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","subdomain","domain","defaultCurrency","locale","metrics","createdAt"]}}}}
```

## 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","properties":{"mode":{"type":"string","enum":["none"]}},"required":["mode"]},{"title":"After time period","type":"object","properties":{"mode":{"type":"string","enum":["interval"]},"count":{"type":"integer"},"unit":{"type":"string","enum":["day","week","month","year"]}},"required":["mode","count","unit"]},{"title":"At specific datetime","type":"object","properties":{"mode":{"type":"string","enum":["specificTime"]},"expiresAt":{"type":"string","format":"date-time"}},"required":["mode","expiresAt"]}]}}}}
```

## 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","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"}},"required":["id","publicId","name","status","isPublic","activeMemberCount","colorCode","createdAt"]},{"oneOf":[{"title":"Free","type":"object","properties":{"type":{"type":"string","enum":["free"]},"expiration":{"$ref":"#/components/schemas/PlanExpiration"}},"required":["type","expiration"]},{"title":"One time payment","type":"object","properties":{"type":{"type":"string","enum":["oneTimePayment"]},"billing":{"type":"object","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."}},"required":["price","currency"]},"expiration":{"$ref":"#/components/schemas/PlanExpiration"}},"required":["type","billing","expiration"]},{"title":"Multi-payment","type":"object","properties":{"type":{"type":"string","enum":["multiPayment"]},"billing":{"type":"object","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.","properties":{"count":{"type":"integer","description":"The number part of the interval. I.e. `3 month`."},"unit":{"type":"string","enum":["day","week","month","year"]}},"required":["count","unit"]},"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."}},"required":["price","currency","interval","paymentCountRequired"]},"expiration":{"$ref":"#/components/schemas/PlanExpiration"}},"required":["type","billing","expiration"]},{"title":"Subscription","type":"object","properties":{"type":{"type":"string","enum":["subscription"]},"billing":{"type":"object","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.","properties":{"count":{"type":"integer","description":"The number part of the interval. I.e. `3 month`."},"unit":{"type":"string","enum":["day","week","month","year"]}},"required":["count","unit"]},"billingDate":{"type":"object","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."}},"required":["day"]},"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."}},"required":["price","currency","interval"]}},"required":["type","billing"]}]}]},"PlanExpiration":{"description":"When a member's access from this plan expires.","oneOf":[{"title":"Never expires","type":"object","properties":{"mode":{"type":"string","enum":["none"]}},"required":["mode"]},{"title":"After time period","type":"object","properties":{"mode":{"type":"string","enum":["interval"]},"count":{"type":"integer"},"unit":{"type":"string","enum":["day","week","month","year"]}},"required":["mode","count","unit"]},{"title":"At specific datetime","type":"object","properties":{"mode":{"type":"string","enum":["specificTime"]},"expiresAt":{"type":"string","format":"date-time"}},"required":["mode","expiresAt"]}]}}}}
```

## The Membership object

```json
{"openapi":"3.2.0","info":{"title":"MemberSpace Admin API","version":"1.0.0"},"components":{"schemas":{"Membership":{"type":"object","description":"A member's enrollment on a plan.","allOf":[{"type":"object","properties":{"id":{"type":"integer","description":"Unique membership identifier."},"memberId":{"type":"integer","description":"The member this membership belongs to."},"planId":{"type":"integer","description":"The plan this membership is on."},"planPublicId":{"type":"string","description":"Public identifier of the plan."},"status":{"type":"string","enum":["active","trialing","pastDue","inactive","expired","canceled","incomplete","incompleteExpired","unpaid"],"description":"Membership state. `active`, `trialing`, and `pastDue` grant access; the rest do not."},"createdAt":{"type":"string","format":"date-time"}},"required":["id","memberId","planId","planPublicId","status","createdAt"]},{"oneOf":[{"type":"object","title":"Free","properties":{"type":{"type":"string","enum":["free"],"description":"The type of plan this membership is on."},"expiresOn":{"type":"string","format":"date-time","description":"If the membership is set to expire, this is the expiration date"}},"required":["type"]},{"type":"object","title":"One Time Payment","properties":{"type":{"type":"string","enum":["oneTimePayment"],"description":"The type of plan this membership is on."},"expiresOn":{"type":"string","format":"date-time","description":"If the membership is going to expire, this is the expiration date"},"billing":{"type":"object","properties":{"currency":{"type":"string","description":"3 letter [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217)."}},"required":["currency"]}},"required":["type","billing"]},{"type":"object","title":"Subscription","properties":{"type":{"type":"string","enum":["subscription"],"description":"The type of plan this membership is on."},"cancelsOn":{"type":"string","format":"date-time","description":"When a scheduled cancellation takes effect. Absent unless cancellation is pending."},"billing":{"type":"object","properties":{"billingPeriodEnd":{"type":"string","format":"date-time","description":"Indicates the date-time when the current billing period ends, and the next one begins."},"currency":{"type":"string","description":"3 letter [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217)."},"paymentFailure":{"type":"boolean","description":"Whether the most recent payment attempt failed."}},"required":["billingPeriodEnd","currency","paymentFailure"]}},"required":["type","billing"]},{"type":"object","title":"Multi-payment","properties":{"type":{"type":"string","enum":["multiPayment"],"description":"The type of plan this membership is on."},"expiresOn":{"type":"string","format":"date-time","description":"If the membership is going to expire, this is the expiration date"},"billing":{"type":"object","properties":{"billingPeriodEnd":{"type":"string","format":"date-time","description":"Only present if not yet fully paid. Indicates the date-time when the current billing period ends, and the next one (if there will be one) begins."},"currency":{"type":"string","description":"3 letter [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217)."},"paymentCountMade":{"type":"integer","description":"Number of payments completed so far."},"paymentCountRequired":{"type":"integer","description":"Total number of payments required to fully pay off the plan."},"paymentFailure":{"type":"boolean","description":"Whether the most recent payment attempt failed."}},"required":["currency","paymentCountMade","paymentCountRequired","paymentFailure"]}},"required":["type","billing"]}]}]}}}}
```

## The MemberEvent object

```json
{"openapi":"3.2.0","info":{"title":"MemberSpace Admin API","version":"1.0.0"},"components":{"schemas":{"MemberEvent":{"type":"object","description":"An activity event recorded for a member.","properties":{"id":{"type":"integer","description":"Unique event identifier."},"memberId":{"type":"integer","description":"The member the event relates to."},"eventType":{"type":"string","enum":["abandonedConversion","acceptedInvitation","accountCreated","cardUpdated","changedEmail","chargeCreated","dunningConversion","email","logIn","logOut","planAdded","planChanged","planDowngraded","planExpired","planRemoved","planSetToCancel","planUpgraded","resetPassword"],"description":"The specific event that occurred."},"details":{"type":"object","description":"Event-specific metadata. Always present (empty object when the event has none); its fields vary by eventType and include `planId` when the event relates to a plan.","additionalProperties":true},"createdAt":{"type":"string","format":"date-time","description":"When the event occurred."}},"required":["id","memberId","eventType","details","createdAt"]}}}}
```

## The Member object

```json
{"openapi":"3.2.0","info":{"title":"MemberSpace Admin API","version":"1.0.0"},"components":{"schemas":{"Member":{"type":"object","description":"A person who has signed up on your site.","properties":{"id":{"type":"integer","description":"Unique member identifier."},"email":{"type":"string","format":"email","description":"Member's email address."},"firstName":{"type":"string","description":"Member's first name."},"lastName":{"type":"string","description":"Member's last name."},"status":{"type":"string","enum":["approved","approvedManually","awaitingApproval","denied","imported","invited","removed"],"description":"Member account state. `approved` and `approvedManually` can access member-only content; the others cannot."},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","firstName","lastName","status","createdAt"]}}}}
```

## The ContentLibraryView object

```json
{"openapi":"3.2.0","info":{"title":"MemberSpace Admin API","version":"1.0.0"},"components":{"schemas":{"ContentLibraryView":{"type":"object","description":"A record of a member successfully viewing a piece of your Content Library content.","properties":{"id":{"type":"integer","description":"Unique view identifier."},"memberId":{"type":"integer","description":"The member who viewed the content."},"node":{"type":"object","description":"The content item that was viewed.","properties":{"id":{"type":"integer","description":"Unique node identifier."},"name":{"type":"string","description":"Name of the content item."},"type":{"type":"string","enum":["file","link","article","post","protectedPage","video"],"description":"The kind of content item."}},"required":["id","name","type"]},"spaceNode":{"type":"object","description":"The space (collection) the content belongs to.","properties":{"id":{"type":"integer","description":"Unique space node identifier."},"name":{"type":"string","description":"Name of the space."}},"required":["id","name"]},"viewedAt":{"type":"string","format":"date-time","description":"When the content was viewed."}},"required":["id","memberId","node","spaceNode","viewedAt"]}}}}
```

## 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.","properties":{"errors":{"type":"array","description":"The errors that occurred.","items":{"type":"object","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."}},"required":["path","code","message"]}}},"required":["errors"]}}}}
```
