---
title: "Role Upsert"
method: POST
path: "/api/v1.admin.auth-role.upsert"
tags: ["Admin"]
---

# Role Upsert

`POST /api/v1.admin.auth-role.upsert`

Create or update a role

## Request body

- AdminRoleUpsertIn
  - `id` string, required
  - `description` string, required
  - `rules` AccessRule[]
    - `effect` 'allow' | 'deny', required
    - `resource` string, required
    - `actions` string[], required
  - `policies` string[]
  - `context` object

## Response `200`

- AdminRoleUpsertOut
  - `id` string, required
  - `created` string, date-time, required
  - `updated` string, date-time, required

## Other responses

- `400`
- `401`
- `403`
- `422`

## Changes

- **2026-03-31** `f62be26d2a53` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/svix/apis/diom-api/changes/api/v1.admin.auth-role.upsert/post.md)

---

[API](https://skmtc.dev/svix/apis/diom-api.md) · [All operations](https://skmtc.dev/svix/apis/diom-api/llms.txt) · [OpenAPI document](https://skmtc.dev/svix/apis/diom-api/revisions/8128e16dd64a?raw)
