Skip to main content
An organization owns projects, members, OAuth clients, and the payment method. Membership belongs to the organization: a member has one organization role, and an invitation grants access to all of the organization’s projects.

Command overview

OAuth clients

OAuth applications the organization owns, and their secrets.

Payment method

The card on file for the organization.

Select an organization

Organization-scoped commands resolve the organization in this order:
  1. The global --org <organization-id> flag, for that invocation only.
  2. A non-empty PHOTON_ORGANIZATION_ID environment variable.
  3. The organization of the project in the folder’s .photon/project.json.
  4. The organization you stored with photon org use.
  5. The organization your account belongs to, when it belongs to exactly one.
With several organizations and none of the first four, commands fail with ORGANIZATION_NOT_SELECTED and exit 2; run photon org list, then photon org use <organization-id>.
Before a command changes anything in an organization you didn’t name with --org, project create included, it names the organization and where it came from on stderr, for example Organization: pho_org_01k9yq3m7d2c8x4v6b5n0p1r2s, from your only organization or Organization: pho_org_01k9yq3m7d2c8x4v6b5n0p1r2s, from /srv/support-bot/.photon/project.json. A command that knows its organization before it asks for confirmation prints the line before the question, --org included. org show reports the source as flag, environment, folder (with the file’s path), stored, or default. org use reads the organization before storing it, so you can never make an inaccessible ID active. With --json, both print the organization as the API returns it under organization, beside source. org use and org clear warn you when PHOTON_ORGANIZATION_ID or the folder’s project still selects another organization. org list marks the active organization and the ones you own. With --json, it prints the API’s response, where ownedOrganizationIds lists the ones you own, and adds the active organization’s ID as activeOrganizationId. When no organization can be selected, nothing is marked active and activeOrganizationId is left out:
The stored organization is tied to the identity you’re signed in as. If it becomes unreadable, org list still works, and org use or org clear replaces it. These commands use the selected organization:
  • photon project list, project count, and project create
  • photon org member, org invitation, org leave, org oauth-client, and org billing
Commands that act on one project, such as project view or project billing plan purchase, use the project’s own organization.

Members

Invitations grant member or viewer. member edit can set admin, member, or viewer; ownership is not changed through these commands. Membership changes are guarded by the member’s current version. The CLI reads it before edit, remove, and leave, and records it with the operation, so a replay sends the same request. If the membership changed in between, Photon rejects the request rather than overwriting the change.

Invitations

member invite sends an invitation. Track and withdraw outstanding invitations from the invitation namespace:

Accept an invitation

The token is the token value in the invitation email’s link (the part after token=), not the whole link. Preview and acceptance never accept a token as a command-line argument. Read it from a file, or pipe it through stdin with --token-file -:
Without --token-file, the command fails and names the option; it doesn’t read piped stdin unless you pass -. Token values are trimmed, bounded, and kept out of output and errors. Acceptance does not need a selected organization: the token names it.
If acceptance is left unresolved, its journal record keeps the token so a replay does not have to ask you for it again. See Recoverable operations.

Leave an organization

org leave removes your own membership from the selected organization:
With --json, it prints your membership as the API returns it after the change, with status removed. Leaving clears the organization if it was your stored selection.

Moved commands

These commands moved here from photon project and photon account. For one release the old names only print the replacement and exit with code 2; they do not run it. The replacement keeps the global options you gave (--org, --project, --json, --debug, --no-color, --no-input), so it acts on the same organization and project, and leaves out the command’s own options, so it never carries a --yes.