> ## Documentation Index
> Fetch the complete documentation index at: https://docs.photon.codes/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use Stable documentation by default. Honor an explicit Beta request or a URL under /docs/beta/. If the requested version conflicts with the installed CLI package or API origin, clarify the target before writing integration code.
> Pages under /docs/beta/ document Beta; other product pages document Stable. Keep the CLI package, commands, API origin, and credentials within the selected version. State the documentation version in your answer.
> For MCP search, always pass version: Stable or version: Beta. Unfiltered search mixes both versions. For filesystem reads, keep Beta queries under /beta/ and exclude /beta/ from Stable queries; discover paths before reading them.
> The public docs base is https://photon.codes/docs. Convert MCP page paths to public URLs under that base, preserving /beta/ when present. Read https://photon.codes/docs/skill.md for version selection and https://photon.codes/docs/llms.txt for the version indexes.

# Create a profile picture upload

> Create a profile picture upload: createAccountProfilePictureUpload in the TypeScript, Python and Rust clients.

`POST /v1/account/profile-picture/uploads`

Creates a ten-minute, Account-bound presigned S3 POST for a JPEG, PNG, or WebP profile picture 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 commitAccountProfilePicture with the returned uploadId. Do not cache or log the upload URL or form fields.

<Tabs>
  <Tab title="TypeScript">
    ```typescript TypeScript theme={null}
    photon.account.createProfilePictureUpload(input: CreateAccountProfilePictureUploadInput, options?: RequestOptions): Promise<CreateAccountProfilePictureUploadOutput>
    ```
  </Tab>

  <Tab title="Python">
    ```python Python theme={null}
    photon.account.create_profile_picture_upload(input: CreateAccountProfilePictureUploadInput) -> models.ProfilePictureUpload
    ```
  </Tab>

  <Tab title="Rust">
    ```rust Rust theme={null}
    client.create_account_profile_picture_upload(body: &types::ProfilePictureUploadRequest).await -> Result<ResponseValue<types::ProfilePictureUpload>, Error<CreateAccountProfilePictureUploadError>>
    ```
  </Tab>
</Tabs>

<RequestExample>
  ```typescript TypeScript theme={null}
  import { Photon } from "@photon-ai/api";

  const photon = new Photon({
    headers: { Authorization: `Bearer ${process.env.PHOTON_API_TOKEN}` },
  });
  const result = await photon.account.createProfilePictureUpload({
    body: {
      contentType: "image/jpeg",
    },
  });
  ```

  ```python Python theme={null}
  import os

  from photon_api import Photon
  from photon_api.rpc_generated import CreateAccountProfilePictureUploadInput

  photon = Photon(headers={"Authorization": f"Bearer {os.environ['PHOTON_API_TOKEN']}"})
  result = photon.account.create_profile_picture_upload(
      CreateAccountProfilePictureUploadInput.model_validate({
          "body": {
              "contentType": "image/jpeg",
          },
      })
  )
  ```

  ```rust Rust theme={null}
  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
      .create_account_profile_picture_upload(
          &serde_json::from_value(serde_json::json!({
              "contentType": "image/jpeg",
          }))?,
      )
      .await
      .map_err(|error| format!("{error:?}"))?
      .into_inner();
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "expiresAt": "2026-01-01T00:00:00.000Z",
    "formFields": {},
    "uploadId": "string",
    "uploadUrl": "https://example.com"
  }
  ```
</ResponseExample>

## Body

<ParamField body="contentType" type={"ProfilePictureContentType"} required />

## Returns

**`201`** A short-lived, Account-bound presigned S3 POST. ProfilePictureUpload

<ResponseField name="expiresAt" type={"string (date-time)"} required />

<ResponseField name="formFields" type={"ProfilePictureUploadFormFields"} required />

<ResponseField name="uploadId" type={"string"} required />

<ResponseField name="uploadUrl" type={"string (uri)"} required />


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.