Docs

updateOrganizationLogo()

Updates the organization's logo.

function updateOrganizationLogo(
  organizationId: string,
  params: UpdateLogoParams,
): Promise<Organization>
  • Name
    file
    Type
    Blob | File
    Description

    The file to upload as the organization's logo.

  • Name
    uploaderUserId?
    Type
    string
    Description

    The ID of the user uploading the logo.

Warning

Using Backend SDK methods can contribute towards rate limiting. To set an organization's logo, it's recommended to use the frontend organization.setLogo() method instead.

const organizationId = 'org_123'
const uploaderUserId = 'user_123'

const fileBits = ['logo-pic-content']
const fileName = 'logo.png'
const file = new File(fileBits, fileName, { type: 'image/png' })

const params = {
  file,
  uploaderUserId,
}

const response = await clerkClient.organizations.updateOrganizationLogo(organizationId, params)

console.log(response)
/*
_Organization {
  id: 'org_123',
  name: 'test',
  slug: 'test',
  imageUrl: 'https://img.clerk.com/eyJ...',
  hasImage: true,
  createdBy: 'user_123',
  createdAt: 1714572514789,
  updatedAt: 1715633676620,
  publicMetadata: {},
  privateMetadata: {},
  maxAllowedMemberships: 1,
  adminDeleteEnabled: true,
  membersCount: undefined
}
*/

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint PUT/organizations/{organization_id}/logo. See the BAPI reference for more information.

Feedback

What did you think of this content?

Last updated on