# /organizations/{organizationId}/subaccounts/{subaccountId}/memberships

List memberships for a subaccount. Results are ordered by `createdAt` ascending, then membership id. Pagination matches other Partner list endpoints (`total`, `page`, `data`).

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Partner API",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://admin.formstack.com/api/v1",
      "description": "Partner API"
    }
  ],
  "paths": {
    "/organizations/{organizationId}/subaccounts/{subaccountId}/memberships": {
      "get": {
        "tags": [
          "PartnerApi"
        ],
        "description": "List memberships for a subaccount. Results are ordered by `createdAt` ascending, then membership id. Pagination matches other Partner list endpoints (`total`, `page`, `data`).",
        "operationId": "listSubaccountMemberships",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "description": "ID of the parent organization",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "b443d63c-3e37-11f1-8898-0242ac000003"
            }
          },
          {
            "name": "subaccountId",
            "in": "path",
            "description": "ID of the subaccount",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "8ecb0a3c-3e38-11f1-96c0-0242ac000003"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page",
            "required": false,
            "schema": {
              "type": "integer",
              "example": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size",
            "required": false,
            "schema": {
              "type": "integer",
              "example": 25,
              "default": 10,
              "enum": [
                10,
                25,
                50,
                100
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Membership rows for the subaccount",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "total": {
                      "type": "integer",
                      "example": 12
                    },
                    "page": {
                      "type": "integer",
                      "example": 1
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PartnerApiSubaccountMembershipListItem"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Organization or subaccount could not be found"
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/general_validation_error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "general_validation_error": {
        "properties": {
          "message": {
            "description": "Basic error description",
            "type": "string",
            "example": "The given data failed to pass validation."
          },
          "errors": {
            "description": "Basic error description",
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string",
                "example": "cannot be blank"
              }
            }
          }
        },
        "type": "object"
      },
      "PartnerApiSubaccountMembershipListItem": {
        "properties": {
          "membershipId": {
            "type": "string",
            "format": "uuid",
            "readOnly": true,
            "example": "2b609bb4-3e57-11f1-8a46-0242ac000003"
          },
          "userId": {
            "description": "Formstack user id when the member is a user; null for a pending invitation.",
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "readOnly": true,
            "example": "b443d63c-3e37-11f1-8898-0242ac000003"
          },
          "email": {
            "type": "string",
            "format": "email",
            "readOnly": true,
            "example": "member@acme.com"
          },
          "firstName": {
            "type": "string",
            "readOnly": true,
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "readOnly": true,
            "example": "Doe"
          },
          "isOrganizationAdmin": {
            "description": "True when this membership has the organization (FSID) admin role.",
            "type": "boolean",
            "readOnly": true,
            "example": true
          },
          "roles": {
            "description": "Product roles for this membership (subscription access summary).",
            "type": "array",
            "items": {
              "properties": {
                "product": {
                  "type": "string",
                  "example": "formstack_classic"
                },
                "role": {
                  "type": "string",
                  "example": "admin"
                }
              },
              "type": "object"
            },
            "readOnly": true,
            "example": [
              {
                "product": "organization",
                "role": "admin"
              },
              {
                "product": "formstack_classic",
                "role": "regular"
              }
            ]
          },
          "invitationAccepted": {
            "description": "True when a user is linked to this membership (invitation accepted or created without a pending invite). False for pending invitations.",
            "type": "boolean",
            "readOnly": true,
            "example": true
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer authentication"
      }
    }
  },
  "tags": [
    {
      "name": "PartnerApi",
      "description": "PartnerApi"
    }
  ]
}
```