---
title: "Update Permission"
method: PATCH
path: "/api/admin/v1/permissions/{id}"
tags: ["Admin Resources"]
---

# Update Permission

`PATCH /api/admin/v1/permissions/{id}`

Update a user's admin level. Requires superadmin privileges.

## Path parameters

- `id` string, required

## Request body

- object
  - `admin_level` 'superadmin' | 'admin' | 'viewer' | 'default' | 'ultraadmin', required

## Response `200`

successful

- object
  - `success` boolean
  - `message` string
  - `user` object
    - `id` integer
    - `username` string
    - `display_name` string, nullable
    - `admin_level` string
    - `previous_admin_level` string
    - `updated_at` string

## Other responses

- `401` — unauthorized
- `403` — forbidden — Returned when the caller is not allowed to set the target to the requested level (e.g. attempting to change your own admin level). Body is { error: <denial message> }.
- `404` — not found handled
- `422` — validation error handled — Returned when admin_level is not a valid admin level. Body is { error: "Invalid admin level" }.

---

[API](https://skmtc.dev/hackclub/apis/hackatime-admin-api.md) · [All operations](https://skmtc.dev/hackclub/apis/hackatime-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hackclub/hackatime-admin-api/revisions/f5a2d53cd28d/schema)
