Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listOrganizationMemberships not returning all memberships #1221

Closed
tanayagrawal opened this issue Feb 17, 2025 · 3 comments
Closed

listOrganizationMemberships not returning all memberships #1221

tanayagrawal opened this issue Feb 17, 2025 · 3 comments

Comments

@tanayagrawal
Copy link

tanayagrawal commented Feb 17, 2025

const memberships = await workos.userManagement.listOrganizationMemberships({ organizationId: organizationId });

only returns active memberships of an organization.

I need to write the following query to get all memberships:

const memberships = await workos.userManagement.listOrganizationMemberships({ organizationId: organizationId, statuses: ['active', 'pending', 'inactive'], limit: 100 });

The first query should return all memberships for an organization if only organization id is passed without the status list.

@mattgd
Copy link
Contributor

mattgd commented Feb 18, 2025

Hi @tanayagrawal - thanks for your feedback. This is currently by design for backwards compatibility. Prior to introducing pending and inactive organization memberships, the list organization memberships API only returned active memberships. We'll see about changing this behavior in the future.

@mattgd mattgd closed this as completed Feb 18, 2025
@tanayagrawal
Copy link
Author

Sounds good! But could you please update the behavior in the SDK documentation? This behavior wasn't evident in the documentation and it took some time to exactly figure why the API did not return the entire list of memberships.

@mattgd
Copy link
Contributor

mattgd commented Feb 18, 2025

Sounds good! But could you please update the behavior in the SDK documentation? This behavior wasn't evident in the documentation and it took some time to exactly figure why the API did not return the entire list of memberships.

Yes, absolutely. This has been updated in the docs here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants