Skip to main content
Mutation

mintProfileMediaUpload

Adds a file to the profile's media library and returns where to upload its content. The file stays PENDING until it is uploaded and processed, and is shown publicly only after it passes moderation. Requires being signed in and able to edit the profile (an owner or admin member, or a member of a space that manages it).

Arguments

  • altTextString

    Images: alt text, for screen readers.

  • captionString

    Default caption.

  • contentTypeString

    MIME type of the file. Images: image/jpeg, image/png or image/webp. Audio: a common audio type such as audio/mpeg.

  • Whether the file is a video, an image or audio.

  • maxDurationSecondsInt

    Videos: the longest allowed duration, in seconds. Defaults to 180.

  • profileIdID!

    ID of the profile.

  • sizeBytesBigInt

    File size in bytes. Required. Videos up to 5 GB, images up to 10 MB, audio up to 50 MB.

  • titleString

    Label for the file in the media library.

Returns

ProfileMediaUploadOutput!

Example

mutation MintProfileMediaUpload($altText: String, $caption: String, $contentType: String, $kind: ProfileMediaAssetKind!, $maxDurationSeconds: Int, $profileId: ID!, $sizeBytes: BigInt, $title: String) {
  mintProfileMediaUpload(
    altText: $altText
    caption: $caption
    contentType: $contentType
    kind: $kind
    maxDurationSeconds: $maxDurationSeconds
    profileId: $profileId
    sizeBytes: $sizeBytes
    title: $title
  ) {
    asset {
      __typename
      ... on ProfileMediaAudioAsset {
        audioUrl
        caption
        contentType
        createdAt
        durationMs
        id
        kind
        profileId
      }
      ... on ProfileMediaImageAsset {
        caption
        createdAt
        focalX
        focalY
        id
        kind
        photographer
        profileId
      }
      ... on ProfileMediaVideoAsset {
        caption
        createdAt
        id
        kind
        previewEndMs
        previewStartMs
        profileId
        status
      }
    }
    audioUploadTarget {
      expiresAt
      method
      objectKey
      uploadUrl
    }
    imageUploadTarget {
      expiresAt
      method
      objectKey
      uploadUrl
    }
  }
}