Skip to content
OAOpenAppPhysical Security as a Service
Login

Organization context & pagination

Most API keys are created under a single organization in the dashboard; authorization and roles are evaluated in that org’s context. Some accounts participate in multiple organizations. Wire-level list endpoints then combine organization selection (X-Org and related query fields) with pagination query parameters described in the canonical OpenAPI bundle.

This page ties those concepts to each SDK. For installation and credentials, start with Authentication.

ConceptDetails
Key issuanceKeys are minted while an organization is selected in the dashboard; role checks apply in that org. See API keys.
Multi-org usersCall GET /orgs (list orgs your principal can access) and choose a target org id before hitting org-scoped routes.
X-Org headerMany operations are documented as “for the organization context (X-Org)”. Pass the organization id (ULID string) when connecting the client — every SDK attaches it automatically. For multi-org scripts, use the scoped-client helpers below. OpenAPI lists which operations require it — see the API reference.
orgId querySome list surfaces accept an orgId filter in addition to X-Org. Prefer matching the same org id in both when your generator or SDK exposes both.

Set a default org at connect time, or clone a scoped client for a different org:

from openapp_sdk import Client
# Default org for every request
client = Client.connect(api_key="...", org_id="01HORG00000000000000000000")
# Multi-org: scoped clone
other = client.with_org("01HORG00000000000000000001")

Errors: Missing or invalid org context typically surfaces as 403 Forbidden or 404 depending on the route and server rules, in addition to the usual 401 when the key is invalid.

The public API describes list operations with:

  • output_optionsMultiResourceOutputOptionsQuery in the OpenAPI bundle (include_deleted, include_metadata, only_deleted — all required on the wire in the published schema).
  • paginationPaginationQuery: limit (page size, server-enforced max typically 200) and offset (items to skip).

Response shape for paginated JSON bodies is typically PaginatedResponse: items (array) and total (count). Some SDK-level wrappers may expose cursor-style helpers on top of the same routes; where that applies, see Python — Resources for iteration patterns.

When in doubt, use the interactive API reference for the exact parameters and schemas of the operation you are calling.

devices.list accepts optional org_id, limit, and cursor kwargs. Set org context at connect time so X-Org is sent automatically:

client = Client.connect(api_key="...", org_id="01HORG00000000000000000000")
rows = await client.devices.list(limit=50)

For large org listings and other resources, combine limit with the pagination fields returned by the API (for example a next_cursor when the service emits one — see Resources).

page = await client.orgs.list(limit=50)
for org in page.get("items", []):
print(org.get("id"), org.get("name"))