---
title: "Update a machine"
method: PATCH
path: "/machines/{machine_id}"
tags: ["Machines"]
---

# Update a machine

`PATCH /machines/{machine_id}`

Updates an existing machine.
Only the provided fields will be updated.

## Path parameters

- `machine_id` string, required

## Request body

- object
  - `name` string — The name of the machine
  - `default_token_ttl` integer — The default time-to-live (TTL) in seconds for tokens created by this machine. Must be at least 1 second.

## Response `200`

Success

- Machine
  - `object` 'machine', required
  - `id` string, required — Unique identifier for the machine.
  - `name` string, required — The name of the machine.
  - `instance_id` string, required — The ID of the instance this machine belongs to.
  - `created_at` integer, required — Unix timestamp of creation.
  - `updated_at` integer, required — Unix timestamp of last update.
  - `default_token_ttl` integer — The default time-to-live (TTL) in seconds for tokens created by this machine.
  - `scoped_machines` MachineWithoutScopedMachines[], required — Array of machines this machine has access to.
    - `object` 'machine', required
    - `id` string, required — Unique identifier for the machine.
    - `name` string, required — The name of the machine.
    - `instance_id` string, required — The ID of the instance this machine belongs to.
    - `created_at` integer, required — Unix timestamp of creation.
    - `updated_at` integer, required — Unix timestamp of last update.
    - `default_token_ttl` integer — The default time-to-live (TTL) in seconds for tokens created by this machine.

## Other responses

- `400` — Request was not successful
- `401` — Authentication invalid
- `403` — Authorization invalid
- `404` — Resource not found
- `422` — Invalid request parameters

---

[API](https://skmtc.net/clerk/apis/clerk-backend-api.md) · [All operations](https://skmtc.net/clerk/apis/clerk-backend-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/clerk/clerk-backend-api/revisions/cf036e7951d3/schema)
