MemorySync
API Reference · Control-plane API

List Organizations

List organization memberships available to the authenticated account.

Endpoint contract

GET/organizations
200 OK

Use the exact method and path shown above. Paths are relative to the API base URL.

Authentication, permission, and scope

ControlRequired contract
AuthenticationBearer access token.
Permission or scopeCurrent authenticated account.
Resource scopeOnly memberships associated with the caller are returned.

Request fields

FieldTypeContract
Request bodynoneNo body or organization ID is accepted.

Code examples

import os
from memorysync import ControlPlaneClient
client = ControlPlaneClient(
base_url="https://api.memorysync.io",
access_token=os.environ["MEMORYSYNC_ACCESS_TOKEN"],
)
memberships = client.list_organizations()

Response shape

response.json
[{"user_id":42,"organization_id":7,"role":"owner"},{"user_id":42,"organization_id":12,"role":"developer"}]
  • The result is an array and may be empty.
  • Each item represents the caller’s role in one organization.

Status outcomes

HTTP outcomes
2xx
Request completed

Read the operation-specific response and persist only fields needed by the task.

400 / 422
Correct the request

Fix invalid path, query, or body fields before trying again.

401 / 403
Access denied

Refresh authentication or verify the required organization permission and scope.

404
Unavailable in scope

Treat the resource as unavailable without revealing whether it exists elsewhere.

429 / 5xx
Keep the action recoverable

Use returned retry metadata when present and reconcile uncertain mutations before repeating them.

Production handling

Production request path
  1. 01

    Authorize

    APP

    Confirm the signed-in principal may perform this product action.

  2. 02

    Validate

    INPUT

    Validate identifiers and body fields before sending the request.

  3. 03

    Call

    SDK

    Use the named ControlPlaneClient method or equivalent HTTPS request from a trusted application context.

  4. 04

    Inspect

    RESULT

    Use the returned membership list to build an authorized organization selector.

  5. 05

    Reconcile

    SAFE

    Resolve organization details through protected application flows rather than accepting an arbitrary ID.

Security notes

Control-plane safety

Required

Keep organization controls inside trusted boundaries.

  • Do not merge membership data across signed-in accounts.
  • Treat roles as current server state.
  • Revalidate context after membership changes.

Avoid

Do not weaken the route contract in client code.

  • Do not expose bearer or refresh tokens in URLs, logs, or public clients.
  • Do not accept organization, member, project, or resource IDs without application authorization.
  • Do not treat returned data as trusted HTML, prompt instructions, or proof of application authorization.
Was this page helpful?