Rotate Voice outbound credential
Rotate Voice outbound credential: rotateVoiceProfileOutboundCredential in the TypeScript, Python, Rust and Go clients.
POST /v1/projects/{id}/platforms/voice/profiles/{profileId}/outbound/rotate
Rotates a SIP profile's outbound credential when expectedVersion matches. The profileId may identify the default or an additional profile. Normal rotation gives the previous credential one hour of grace; emergency rotation gives none. The new password is returned once and is never recoverable. Requires platforms:write bound to the path project.
photon.projects.platforms.rotateVoiceProfileOutboundCredential(input: RotateVoiceProfileOutboundCredentialInput, options?: RequestOptions): Promise<RotateVoiceProfileOutboundCredentialOutput>photon.projects.platforms.rotate_voice_profile_outbound_credential(input: RotateVoiceProfileOutboundCredentialInput, *, options: RequestOptions | None = None,) -> models.RotateVoiceProfileOutboundCredentialResponseclient.rotate_voice_profile_outbound_credential(idempotency_key: String, id: String, profile_id: String, body: &types::RotateVoiceProfileOutboundCredentialRequest).await -> Result<ResponseValue<types::RotateVoiceProfileOutboundCredentialResponse>, Error<RotateVoiceProfileOutboundCredentialError>>client.Projects.Platforms.RotateVoiceProfileOutboundCredential(ctx context.Context, params *RotateVoiceProfileOutboundCredentialParams, opts ...RequestOption) (*RotateVoiceProfileOutboundCredentialResponse, error)import { Photon } from "@photon-ai/api";
const photon = new Photon({
headers: { Authorization: `Bearer ${process.env.PHOTON_API_TOKEN}` },
});
const result = await photon.projects.platforms.rotateVoiceProfileOutboundCredential({
path: {
id: "id",
profileId: "profileId",
},
headers: {
idempotencyKey: "idempotencyKey",
},
body: {
expectedVersion: 1,
mode: "normal",
},
});import os
from photon_api import Photon
from photon_api.rpc_generated import RotateVoiceProfileOutboundCredentialInput
photon = Photon(headers={"Authorization": f"Bearer {os.environ['PHOTON_API_TOKEN']}"})
result = photon.projects.platforms.rotate_voice_profile_outbound_credential(
RotateVoiceProfileOutboundCredentialInput.model_validate({
"path": {
"id": "id",
"profileId": "profileId",
},
"headers": {
"Idempotency-Key": "idempotencyKey",
},
"body": {
"expectedVersion": 1,
"mode": "normal",
},
})
)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
.rotate_voice_profile_outbound_credential(
"idempotencyKey".to_owned(),
"id".to_owned(),
"profileId".to_owned(),
&serde_json::from_value(serde_json::json!({
"expectedVersion": 1,
"mode": "normal",
}))?,
)
.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.RotateVoiceProfileOutboundCredentialRequest
if err := json.Unmarshal([]byte(`{
"expectedVersion": 1,
"mode": "normal"
}`), &body); err != nil {
return err
}
result, err := client.Projects.Platforms.RotateVoiceProfileOutboundCredential(ctx, &photonapi.RotateVoiceProfileOutboundCredentialParams{
IdempotencyKey: "idempotencyKey",
ID: "id",
ProfileID: "profileId",
Body: body,
})
if err != nil {
return err
}
_ = result{
"password": null,
"previousPasswordValidUntil": null,
"profileVersion": 1
}Parameters
Selects the API contract date. Without it, the request is served as 2026-07-01.
Identifies one logical mutation across retries.
Body
Returns
200 The rotated password result and next profile version. RotateVoiceProfileOutboundCredentialResponse
Headers: Photon-Version. The raw response carries these headers; see Raw responses.