> ## Documentation Index
> Fetch the complete documentation index at: https://docs.photon.codes/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use Stable documentation by default. Honor an explicit Beta request or a URL under /docs/beta/. If the requested version conflicts with the installed CLI package or API origin, clarify the target before writing integration code.
> Pages under /docs/beta/ document Beta; other product pages document Stable. Keep the CLI package, commands, API origin, and credentials within the selected version. State the documentation version in your answer.
> For MCP search, always pass version: Stable or version: Beta. Unfiltered search mixes both versions. For filesystem reads, keep Beta queries under /beta/ and exclude /beta/ from Stable queries; discover paths before reading them.
> The public docs base is https://photon.codes/docs. Convert MCP page paths to public URLs under that base, preserving /beta/ when present. Read https://photon.codes/docs/skill.md for version selection and https://photon.codes/docs/llms.txt for the version indexes.

# Organizations

> Select an organization and manage its members, invitations, OAuth clients, and payment method.

An organization owns projects, members, OAuth clients, the payment method, and
10DLC registrations. Membership belongs to the organization: a member has one
organization role, and an invitation grants access to all of the
organization's projects.

```sh theme={null}
photon org list
photon org show
photon org use org_123
```

## Command overview

[Browse the automatic command reference](/docs/beta/cli/reference/index).

<CardGroup cols={2}>
  <Card title="OAuth clients" icon="plug" href="/docs/beta/cli/organizations/oauth-clients">
    OAuth applications the organization owns, and their secrets.
  </Card>

  <Card title="Payment method" icon="credit-card" href="/docs/beta/cli/organizations/billing">
    The card on file for the organization.
  </Card>
</CardGroup>

## Select an organization

Organization-scoped commands resolve the organization in this order:

1. The global `--org <organization-id>` flag, for that invocation only.
2. The organization you stored with `photon org use`.
3. The organization your account belongs to, when it belongs to exactly one.

With several organizations and no `--org` or stored selection, commands fail
with `ORGANIZATION_NOT_SELECTED` and exit `2`; run `photon org list`, then
`photon org use <organization-id>`.

```sh theme={null}
photon org show                         # the organization and where it came from
photon org use org_123                  # store an active organization
photon org member list --org org_456    # one invocation only
photon org clear                        # forget the stored selection
```

`org show` reports the source as `flag`, `stored`, or `default`. `org use`
reads the organization before storing it, so you can never make an
inaccessible ID active. `org list` marks the active organization and the ones
you own. When no organization can be selected, nothing is marked active:

```json theme={null}
{"activeOrganizationId":"org_123","organizations":[{"organizationId":"org_123","name":"Acme","owner":true,"avatarUrl":null,"createdAt":"2026-07-01T00:00:00.000Z","updatedAt":"2026-07-02T00:00:00.000Z"}]}
```

Like the [active project](/docs/beta/cli/projects#select-an-active-project), the stored
organization is tied to the authenticated identity and API origin. 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`
* `photon account 10dlc`

Commands that act on one project, such as `project view` or
`project billing plan purchase`, use the project's own organization.

## Members

```sh theme={null}
photon org member list
photon org member invite --email ada@example.com --role member
photon org member edit account_123 --role admin
photon org member remove account_123 --force
```

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](/docs/beta/cli/operations) 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:

```sh theme={null}
photon org invitation list
photon org invitation revoke invitation_123 --force
```

### Accept an invitation

Preview and acceptance **never** accept a token as a command-line argument.
Pipe it through stdin or read it from a file:

```sh theme={null}
printf '%s\n' "$PHOTON_INVITATION_TOKEN" |
  photon org invitation preview --json

photon org invitation accept --token-file ./invitation-token.txt
```

```json theme={null}
{"invitation":{"organizationId":"org_123","organizationName":"Acme","role":"member","status":"accepted"}}
```

Interactive stdin without `--token-file` fails with usage guidance. Token
values are trimmed, bounded, and kept out of output and errors. Acceptance
does not need a selected organization: the token names it.

<Note>
  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](/docs/beta/cli/operations).
</Note>

## Leave an organization

`org leave` removes your own membership from the selected organization:

```sh theme={null}
photon org leave --org org_123 --force --json
```

```json theme={null}
{"left":true,"member":{"accountId":"account_123","organizationId":"org_123","role":"member","status":"removed","joinedVia":"invitation","removedAt":"2026-08-07T18:00:00.000Z","createdAt":"2026-08-01T18:00:00.000Z","updatedAt":"2026-08-07T18:00:00.000Z"}}
```

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.

| Old command | New command |
| - | - |
| `photon project member ...` | `photon org member ...` |
| `photon project invitation ...` | `photon org invitation ...` |
| `photon project leave` | `photon org leave` |
| `photon account oauth client ...` | `photon org oauth-client ...` |
| `photon account oauth secret ...` | `photon org oauth-client secret ...` |
| `photon account billing payment ...` | `photon org billing payment-method ...` |

```json theme={null}
{"error":{"code":"COMMAND_MOVED","message":"\"photon project member\" moved to \"photon org member\".","retryable":false,"remediation":["Run \"photon org member list\" instead."]}}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.