Commit agent avatar
Commit agent avatar: commitAgentProfileAvatar in the TypeScript, Python, Rust and Go clients.
PUT /v1/projects/{projectId}/agent-profile/avatar
Commits an agent avatar previously uploaded through createAgentProfileAvatarUpload. Call this only after the direct multipart upload succeeds, using the uploadId from the same upload session and a stable Idempotency-Key. The service validates the temporary object's Project ownership, size, content type, image bytes, dimensions, encryption, and age before changing the agent profile.
photon.projects.agentProfile.commitAvatar(input: CommitAgentProfileAvatarInput, options?: RequestOptions): Promise<CommitAgentProfileAvatarOutput>photon.projects.agent_profile.commit_avatar(input: CommitAgentProfileAvatarInput, *, options: RequestOptions | None = None) -> models.AgentProfileclient.commit_agent_profile_avatar(idempotency_key: String, project_id: String, body: &types::CommitAgentProfileAvatarRequest).await -> Result<ResponseValue<types::AgentProfile>, Error<CommitAgentProfileAvatarError>>client.Projects.AgentProfile.CommitAvatar(ctx context.Context, params *CommitAgentProfileAvatarParams, opts ...RequestOption) (*AgentProfile, error)import { Photon } from "@photon-ai/api";
const photon = new Photon({
headers: { Authorization: `Bearer ${process.env.PHOTON_API_TOKEN}` },
});
const result = await photon.projects.agentProfile.commitAvatar({
path: {
projectId: "projectId",
},
headers: {
idempotencyKey: "idempotencyKey",
},
body: {
uploadId: "uploadId",
},
});import os
from photon_api import Photon
from photon_api.rpc_generated import CommitAgentProfileAvatarInput
photon = Photon(headers={"Authorization": f"Bearer {os.environ['PHOTON_API_TOKEN']}"})
result = photon.projects.agent_profile.commit_avatar(
CommitAgentProfileAvatarInput.model_validate({
"path": {
"projectId": "projectId",
},
"headers": {
"Idempotency-Key": "idempotencyKey",
},
"body": {
"uploadId": "uploadId",
},
})
)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
.commit_agent_profile_avatar(
"idempotencyKey".to_owned(),
"projectId".to_owned(),
&serde_json::from_value(serde_json::json!({
"uploadId": "uploadId",
}))?,
)
.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.CommitAgentProfileAvatarRequest
if err := json.Unmarshal([]byte(`{
"uploadId": "uploadId"
}`), &body); err != nil {
return err
}
result, err := client.Projects.AgentProfile.CommitAvatar(ctx, &photonapi.CommitAgentProfileAvatarParams{
IdempotencyKey: "idempotencyKey",
ProjectID: "projectId",
Body: body,
})
if err != nil {
return err
}
_ = result{
"avatarUrl": "https://example.com",
"firstName": "string",
"lastName": null
}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 agent profile with its committed avatar. AgentProfile
Headers: Photon-Version. The raw response carries these headers; see Raw responses.