> 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/sites.md).

# Sites

The sites your API key can access.

## List sites

> Returns the sites the API key has access to (one, for a developer API key).

```json
{"openapi":"3.2.0","info":{"title":"MemberSpace Admin API","version":"1.0.0"},"tags":[{"name":"sites","description":"The sites your API key can access."}],"servers":[{"url":"https://api.memberspace.com/admin/v1","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Opaque Admin API key, prefixed with `ms_admin_`. Pass it as `Authorization: Bearer ms_admin_...`."}},"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"]},"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"]}},"headers":{"totalCount":{"description":"Total number of items matching the query across all pages, ignoring pagination.","schema":{"type":"integer"}}},"responses":{"401-AccessDenied":{"description":"The API key is missing, unknown, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403-NotPermitted":{"description":"The request is not permitted for this API key. For example, the site's plan no longer includes Admin API access because the owner canceled or downgraded — the key itself is still valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429-RateLimited":{"description":"Rate limit exceeded. Wait the number of seconds in the Retry-After header before retrying.","headers":{"Retry-After":{"description":"Number of seconds to wait before making another request.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"paths":{"/sites":{"get":{"tags":["sites"],"summary":"List sites","description":"Returns the sites the API key has access to (one, for a developer API key).","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Site"}}}},"headers":{"X-Total-Count":{"$ref":"#/components/headers/totalCount"}}},"401":{"$ref":"#/components/responses/401-AccessDenied"},"403":{"$ref":"#/components/responses/403-NotPermitted"},"429":{"$ref":"#/components/responses/429-RateLimited"}}}}}}
```
