POST /v1/organizations/{organizationId}/sso/subscription
- TypeScript
- Python
- Rust
- Go
TypeScript
photon.organizations.subscribeSso(input: SubscribeSsoInput, options?: RequestOptions): Promise<SubscribeSsoOutput>
Python
photon.organizations.subscribe_sso(input: SubscribeSsoInput) -> models.SubscribeSsoResponse
Rust
client.subscribe_sso(idempotency_key: String, organization_id: String, body: &types::SubscribeSsoRequest).await -> Result<ResponseValue<types::SubscribeSsoResponse>, Error<SubscribeSsoError>>
Go
client.Organizations.SubscribeSso(ctx context.Context, params *SubscribeSsoParams, opts ...RequestOption) (*SubscribeSsoResponse, error)
import { Photon } from "@photon-ai/api";
const photon = new Photon({
headers: { Authorization: `Bearer ${process.env.PHOTON_API_TOKEN}` },
});
const result = await photon.organizations.subscribeSso({
path: {
organizationId: "organizationId",
},
headers: {
idempotencyKey: "idempotencyKey",
},
body: {
expectedAmount: "expectedAmount",
expectedCurrency: "expectedCurrency",
expectedCurrentPeriodEnd: "2026-01-01T00:00:00Z",
},
});
import os
from photon_api import Photon
from photon_api.rpc_generated import SubscribeSsoInput
photon = Photon(headers={"Authorization": f"Bearer {os.environ['PHOTON_API_TOKEN']}"})
result = photon.organizations.subscribe_sso(
SubscribeSsoInput.model_validate({
"path": {
"organizationId": "organizationId",
},
"headers": {
"Idempotency-Key": "idempotencyKey",
},
"body": {
"expectedAmount": "expectedAmount",
"expectedCurrency": "expectedCurrency",
"expectedCurrentPeriodEnd": "2026-01-01T00:00:00Z",
},
})
)
use photon_ai_api::{Credential, PhotonClientBuilder, SecretString};
let token = std::env::var("PHOTON_API_TOKEN")?;
let client = PhotonClientBuilder::new()
.credential("accountServiceKey", Credential::Bearer(SecretString::from(token)))
.build()?;
let result = client
.subscribe_sso(
"idempotencyKey".to_owned(),
"organizationId".to_owned(),
&serde_json::from_value(serde_json::json!({
"expectedAmount": "expectedAmount",
"expectedCurrency": "expectedCurrency",
"expectedCurrentPeriodEnd": "2026-01-01T00:00:00Z",
}))?,
)
.await
.map_err(|error| format!("{error:?}"))?
.into_inner();
import (
"context"
"encoding/json"
"os"
photonapi "github.com/photon-hq/api/packages/go"
)
ctx := context.Background()
client := photonapi.NewClient(photonapi.WithAPIKey(os.Getenv("PHOTON_API_TOKEN")))
var body photonapi.SubscribeSsoRequest
if err := json.Unmarshal([]byte(`{
"expectedAmount": "expectedAmount",
"expectedCurrency": "expectedCurrency",
"expectedCurrentPeriodEnd": "2026-01-01T00:00:00Z"
}`), &body); err != nil {
return err
}
result, err := client.Organizations.SubscribeSso(ctx, &photonapi.SubscribeSsoParams{
IdempotencyKey: "idempotencyKey",
OrganizationID: "organizationId",
Body: body,
})
if err != nil {
return err
}
_ = result
{
"accepted": true
}
Parameters
string
required
Identifies one logical mutation across retries.
string
required
Body
string
required
string
required
string (date-time)
required
Returns
202 SSO subscription request accepted SubscribeSsoResponse
boolean
required