Skip to content

POST /v1/projects/{projectId}/agent-profile/avatar/uploads

Creates a ten-minute, Project-bound presigned S3 POST for a JPEG, PNG, or WebP agent avatar up to 5 MiB. Copy every returned formFields entry into a multipart/form-data request to uploadUrl, append the local file as the final form part, and upload it directly without sending Photon credentials. After the upload succeeds, call commitAgentProfileAvatar with the returned uploadId. Do not cache or log the upload URL or form fields.

photon.projects.agentProfile.createAvatarUpload(input: CreateAgentProfileAvatarUploadInput, options?: RequestOptions): Promise<CreateAgentProfileAvatarUploadOutput>
import { Photon } from "@photon-ai/api";

const photon = new Photon({
  headers: { Authorization: `Bearer ${process.env.PHOTON_API_TOKEN}` },
});
const result = await photon.projects.agentProfile.createAvatarUpload({
  path: {
    projectId: "projectId",
  },
  body: {
    contentType: "image/jpeg",
  },
});
{
  "expiresAt": "2026-01-01T00:00:00.000Z",
  "formFields": {},
  "uploadId": "string",
  "uploadUrl": "https://example.com"
}

Parameters

Photon-VersionPhotonVersion

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

projectIdstringrequired

Body

contentTypeAgentProfileAvatarContentTyperequired

Returns

201 A short-lived, project-bound presigned S3 POST. AgentProfileAvatarUpload

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

expiresAtstring (date-time)required
formFieldsAgentProfileAvatarUploadFormFieldsrequired
uploadIdstringrequired
uploadUrlstring (uri)required