---
title: "Revoke Api Key"
method: POST
path: "/api/api_key/{key_id}/revoke"
tags: ["API Keys"]
---

# Revoke Api Key

`POST /api/api_key/{key_id}/revoke`

## Path parameters

- `key_id` integer, required

## Response `200`

Successful Response

- APIKeyCreateResponse
  - `name` string, required
  - `note` string, nullable
  - `permissions` RolePermissions — Typed permission map. Missing resource or action = denied. Each action value is True (allowed), {"scope": N} (scoped), or None (denied).
    - `users` UsersPermissions
      - `create` union
        - boolean
        - object
      - `read` union
        - boolean
        - object
      - `read_simple` union
        - boolean
        - object
      - `update` union
        - boolean
        - object
      - `delete` union
        - boolean
        - object
      - `reset_usage` union
        - boolean
        - object
      - `revoke_sub` union
        - boolean
        - object
      - `set_owner` union
        - boolean
        - object
      - `activate_next_plan` union
        - boolean
        - object
    - `admins` AdminsPermissions
      - `create` union
        - boolean
        - object
      - `read` union
        - boolean
        - object
      - `read_simple` union
        - boolean
        - object
      - `update` union
        - boolean
        - object
      - `delete` union
        - boolean
        - object
      - `reset_usage` union
        - boolean
        - object
    - `nodes` NodesPermissions
      - `create` union
        - boolean
        - object
      - `read` union
        - boolean
        - object
      - `read_simple` union
        - boolean
        - object
      - `update` union
        - boolean
        - object
      - `delete` union
        - boolean
        - object
      - `reconnect` union
        - boolean
        - object
      - `update_core` union
        - boolean
        - object
      - `logs` union
        - boolean
        - object
      - `stats` union
        - boolean
        - object
    - `groups` CRUDPermissions — Standard create/read/read_simple/update/delete permissions. Used directly by: groups, templates, client_templates, cores, admin_roles. Also serves as base for resources with additional actions.
      - `create` union
        - boolean
        - object
      - `read` union
        - boolean
        - object
      - `read_simple` union
        - boolean
        - object
      - `update` union
        - boolean
        - object
      - `delete` union
        - boolean
        - object
    - `hosts` HostsPermissions
      - `create` union
        - boolean
        - object
      - `read` union
        - boolean
        - object
      - `update` union
        - boolean
        - object
    - `templates` CRUDPermissions — Standard create/read/read_simple/update/delete permissions. Used directly by: groups, templates, client_templates, cores, admin_roles. Also serves as base for resources with additional actions.
      - `create` union
        - boolean
        - object
      - `read` union
        - boolean
        - object
      - `read_simple` union
        - boolean
        - object
      - `update` union
        - boolean
        - object
      - `delete` union
        - boolean
        - object
    - `client_templates` CRUDPermissions — Standard create/read/read_simple/update/delete permissions. Used directly by: groups, templates, client_templates, cores, admin_roles. Also serves as base for resources with additional actions.
      - `create` union
        - boolean
        - object
      - `read` union
        - boolean
        - object
      - `read_simple` union
        - boolean
        - object
      - `update` union
        - boolean
        - object
      - `delete` union
        - boolean
        - object
    - `cores` CRUDPermissions — Standard create/read/read_simple/update/delete permissions. Used directly by: groups, templates, client_templates, cores, admin_roles. Also serves as base for resources with additional actions.
      - `create` union
        - boolean
        - object
      - `read` union
        - boolean
        - object
      - `read_simple` union
        - boolean
        - object
      - `update` union
        - boolean
        - object
      - `delete` union
        - boolean
        - object
    - `settings` SettingsPermissions
      - `read` union
        - boolean
        - object
      - `read_general` union
        - boolean
        - object
      - `update` union
        - boolean
        - object
    - `system` SystemPermissions
      - `read` union
        - boolean
        - object
    - `hwids` HwidsPermissions
      - `read` union
        - boolean
        - object
      - `delete` union
        - boolean
        - object
    - `admin_roles` CRUDPermissions — Standard create/read/read_simple/update/delete permissions. Used directly by: groups, templates, client_templates, cores, admin_roles. Also serves as base for resources with additional actions.
      - `create` union
        - boolean
        - object
      - `read` union
        - boolean
        - object
      - `read_simple` union
        - boolean
        - object
      - `update` union
        - boolean
        - object
      - `delete` union
        - boolean
        - object
    - `api_keys` APIKeysPermissions
      - `create` boolean, nullable
      - `read` union
        - boolean
        - object
      - `read_simple` union
        - boolean
        - object
      - `update` union
        - boolean
        - object
      - `delete` union
        - boolean
        - object
  - `inherit_permissions` boolean
  - `expire_date` string, date-time, nullable
  - `id` integer, required
  - `admin_id` integer, required
  - `created_at` string, date-time, required
  - `api_key_trimmed` string, required
  - `revoked_at` string, date-time, nullable
  - `status` 'active' | 'disabled'
  - `is_expired` boolean
  - `api_key` string, required

## Other responses

- `401` — Unauthorized Error
- `403` — Forbidden Error
- `404` — NotFound Error
- `422` — Validation Error

---

[API](https://skmtc.dev/socialser/apis/pasarguardapi.md) · [All operations](https://skmtc.dev/socialser/apis/pasarguardapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/socialser/pasarguardapi/revisions/4b082bbcb6c3/schema)
