> ## 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.

# Start company sign-in

> Start company sign-in: startEnterpriseLogin in the TypeScript, Python and Rust clients.

`POST /v1/auth/login/enrollment`

Returns a sign-in URL without requiring an existing account: the company SSO connection when the target has a ready connection, otherwise ordinary account login. Supply one documented enrollment variant: organizationId with returnTo (optionally invitationToken), invitationToken with returnTo, or retryToken. Open the returned URL to continue authentication; receiving a URL does not complete sign-in. This is a browser flow: the request must come from an allowed Origin, and the retryToken variant also needs the retry cookie set by the failed sign-in, so send it with credentials.

<Tabs>
  <Tab title="TypeScript">
    ```typescript TypeScript theme={null}
    photon.auth.startEnterpriseLogin(input: StartEnterpriseLoginInput, options?: RequestOptions): Promise<StartEnterpriseLoginOutput>
    ```
  </Tab>

  <Tab title="Python">
    ```python Python theme={null}
    photon.auth.start_enterprise_login(input: StartEnterpriseLoginInput) -> models.StartEnterpriseLoginResponse
    ```
  </Tab>

  <Tab title="Rust">
    ```rust Rust theme={null}
    client.start_enterprise_login(body: &types::StartEnterpriseLoginRequest).await -> Result<ResponseValue<types::StartEnterpriseLoginResponse>, Error<StartEnterpriseLoginError>>
    ```
  </Tab>
</Tabs>

<RequestExample>
  ```typescript TypeScript theme={null}
  import { Photon } from "@photon-ai/api";

  const photon = new Photon();
  const result = await photon.auth.startEnterpriseLogin({
    body: {
      organizationId: "organizationId",
      returnTo: "returnTo",
    },
  });
  ```

  ```python Python theme={null}
  from photon_api import Photon
  from photon_api.rpc_generated import StartEnterpriseLoginInput

  photon = Photon()
  result = photon.auth.start_enterprise_login(
      StartEnterpriseLoginInput.model_validate({
          "body": {
              "organizationId": "organizationId",
              "returnTo": "returnTo",
          },
      })
  )
  ```

  ```rust Rust theme={null}
  use photon_ai_api::PhotonClientBuilder;

  let client = PhotonClientBuilder::new().build()?;
  let result = client
      .start_enterprise_login(
          &serde_json::from_value(serde_json::json!({
              "organizationId": "organizationId",
              "returnTo": "returnTo",
          }))?,
      )
      .await
      .map_err(|error| format!("{error:?}"))?
      .into_inner();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "url": "https://example.com"
  }
  ```
</ResponseExample>

## Body

**One of: OrganizationEnterpriseLoginRequest**

<ParamField body="invitationToken" type={"string"} />

<ParamField body="organizationId" type={"string"} required />

<ParamField body="returnTo" type={"string"} required />

**One of: InvitationEnterpriseLoginRequest**

<ParamField body="invitationToken" type={"string"} required />

<ParamField body="returnTo" type={"string"} required />

**One of: RetryEnterpriseLoginRequest**

<ParamField body="retryToken" type={"string"} required />

## Returns

**`200`** Company SSO URL when the target has a ready connection, otherwise the ordinary Account login URL. The response never says which, and access is decided only after authentication. StartEnterpriseLoginResponse

<ResponseField name="url" type={"string (uri)"} required />


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