Skip to main content
Docs

update()

Updates a machine by its ID.

function update(params: UpdateMachineParams): Promise<Machine>
  • Name
    machineId
    Type
    string
    Description

    The ID of the machine to update.

  • Name
    name?
    Type
    string
    Description

    The name of the machine.

  • Name
    defaultTokenTtl?
    Type
    number
    Description

    The default time-to-live (TTL) in seconds for tokens created by this machine.

Note

Importing clerkClient varies based on your framework. Refer to the Backend SDK overview for usage details, including guidance on how to access the userId and other properties.

const machineId = 'mch_123'

const response = await clerkClient.machines.update({
  machineId,
  name: 'New Machine Name',
  defaultTokenTtl: 3600,
})

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint PATCH/machines/{machine_id}. See the BAPI reference for more information.

Feedback

What did you think of this content?

Last updated on