Skip to content

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>
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",
  },
});
{
  "avatarUrl": "https://example.com",
  "firstName": "string",
  "lastName": null
}

Parameters

Photon-VersionPhotonVersion

Selects the API contract date. Without it, the request is served as 2026-07-01.

Idempotency-Keystringrequired

Identifies one logical mutation across retries.

projectIdstringrequired

Body

uploadIdstringrequired

Returns

200 The agent profile with its committed avatar. AgentProfile

Headers: Photon-Version. The raw response carries these headers; see Raw responses.

avatarUrlstring (uri)required
firstNamestringrequired
lastNamestring | nullrequired