---
descriptions:
  list_users_for_resource_by_external_id:
    organization_id: The ID of the organization.
    resource_type_slug: The slug of the resource type.
    external_id: The external ID of the resource.
    permission_slug: >-
      The permission slug to filter by. Only users with this permission on the
      resource are returned.
    assignment: >-
      Filter by assignment type. Use "direct" for direct assignments only, or
      "indirect" to include inherited assignments.
    limit: 'Maximum number of records to return (default 10, max 100).'
    before: Cursor for pagination (before).
    after: Cursor for pagination (after).
    order: Sort order (asc or desc).
    data: Array of organization memberships that have access to the resource.
reference:
  curl:
    - key: list_users_for_resource_by_external_id
      id: list_users_for_resource_by_external_id
      url: /reference/fga/access-check/list-memberships-by-external-id
      title: >-
        /authorization/organizations/:organization_id/resources/:resource_type_slug/:external_id/organization_memberships
      type: GET
      parameters:
        - key: organization_id
          type: string
          description: (list_users_for_resource_by_external_id.organization_id)
        - key: resource_type_slug
          type: string
          description: (list_users_for_resource_by_external_id.resource_type_slug)
        - key: external_id
          type: string
          description: (list_users_for_resource_by_external_id.external_id)
        - key: permission_slug
          type: string
          description: (list_users_for_resource_by_external_id.permission_slug)
        - key: assignment
          type: '"direct" | "indirect"'
          optional: true
          description: (list_users_for_resource_by_external_id.assignment)
        - key: limit
          type: number
          optional: true
          description: (list_users_for_resource_by_external_id.limit)
        - key: before
          type: string
          optional: true
          description: (list_users_for_resource_by_external_id.before)
        - key: after
          type: string
          optional: true
          description: (list_users_for_resource_by_external_id.after)
        - key: order
          type: '"asc" | "desc"'
          optional: true
          description: (list_users_for_resource_by_external_id.order)
      returns:
        - key: anonymous
          type: object
          unwrap: true
          properties:
            - key: data
              type: array
              description: (list_users_for_resource_by_external_id.data)
            - key: list_metadata
              type: object
              properties:
                - key: before
                  type: string | null
                - key: after
                  type: string | null
  js:
    - key: listMembershipsForResourceByExternalId
      id: list_users_for_resource_by_external_id
      url: /reference/fga/access-check/list-memberships-by-external-id
      title: authorization.listMembershipsForResourceByExternalId()
      parameters:
        - key: options
          type: object
          unwrap: true
          properties:
            - key: organizationId
              type: string
              description: (list_users_for_resource_by_external_id.organization_id)
            - key: resourceTypeSlug
              type: string
              description: (list_users_for_resource_by_external_id.resource_type_slug)
            - key: externalId
              type: string
              description: (list_users_for_resource_by_external_id.external_id)
            - key: permissionSlug
              type: string
              description: (list_users_for_resource_by_external_id.permission_slug)
            - key: assignment
              type: '"direct" | "indirect"'
              optional: true
              description: (list_users_for_resource_by_external_id.assignment)
            - key: limit
              type: number
              optional: true
              description: (list_users_for_resource_by_external_id.limit)
            - key: before
              type: string
              optional: true
              description: (list_users_for_resource_by_external_id.before)
            - key: after
              type: string
              optional: true
              description: (list_users_for_resource_by_external_id.after)
            - key: order
              type: '"asc" | "desc"'
              optional: true
              description: (list_users_for_resource_by_external_id.order)
      returns:
        - key: anonymous
          type: object
          unwrap: true
          properties:
            - key: data
              type: 'OrganizationMembership[]'
              description: (list_users_for_resource_by_external_id.data)
            - key: listMetadata
              type: ListMetadata
originalPath: >-
  .tmp-workos-clone/packages/docs/content/reference/fga/access-check/list-memberships-by-external-id.mdx
---

## List memberships for a resource by external ID

Returns all organization memberships that have a specific permission on a resource, using the resource's external ID. This is useful for answering "Who can access this resource?" when you only have the external ID.

<CodeBlock referenceId="list_users_for_resource_by_external_id">
  <CodeBlockTab
    title="Request"
    file="list-memberships-for-resource-by-external-id-request"
  />
  <CodeBlockTab
    title="Response"
    file="list-memberships-for-resource-by-external-id-response"
  />
</CodeBlock>
