> ## Documentation Index
> Fetch the complete documentation index at: https://tyk.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Revoke API Key

> Clear a user's API key. The key stops working immediately; the user shows as having none issued.



## OpenAPI

````yaml /swagger/5.16/ai-studio-swagger.yml delete /users/{id}/api-key
openapi: 3.0.1
info:
  title: Midsommar API
  description: This is the API for the Midsommar user and group management system.
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    url: http://www.swagger.io/support
    email: support@swagger.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: //localhost:8080/api/v1
security: []
paths:
  /users/{id}/api-key:
    delete:
      tags:
        - users
      summary: Revoke API Key
      description: >-
        Clear a user's API key. The key stops working immediately; the user
        shows as having none issued.
      parameters:
        - name: id
          in: path
          description: User ID
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.UserResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    api.UserResponse:
      type: object
      properties:
        attributes:
          $ref: '#/components/schemas/api.UserAttributes'
        id:
          type: string
        type:
          type: string
      description: User response model
    api.ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              detail:
                type: string
              title:
                type: string
      description: Error response model
    api.UserAttributes:
      type: object
      properties:
        access_to_sso_config:
          type: boolean
        account_type:
          type: string
          description: AccountType is "" for a person or "service" for a service account.
        api_key:
          type: string
        api_key_hint:
          type: string
        api_key_last_used_at:
          type: string
        auth_source:
          type: string
          description: |-
            Provenance and activity. auth_source is local | admin | sso | host;
            sso_profile_id names the identity provider profile that provisioned
            (or last signed in) the user.
        budget_team_id:
          type: integer
          description: >-
            BudgetTeamID is the team the user's new Apps and chat spend are

            attributed to (Enterprise team budgets); null = resolved
            automatically.
        disabled:
          type: boolean
          description: Account switch. A disabled user cannot authenticate by any means.
        disabled_at:
          type: string
        email:
          type: string
        email_verified:
          type: boolean
        groups:
          type: array
          items:
            $ref: '#/components/schemas/api.GroupResponse'
        has_api_key:
          type: boolean
        is_admin:
          type: boolean
        last_login_at:
          type: string
        last_login_method:
          type: string
        name:
          type: string
        notifications_enabled:
          type: boolean
        role:
          type: string
        roles:
          type: array
          items:
            $ref: '#/components/schemas/rbac.RoleSummary'
        show_chat:
          type: boolean
        show_portal:
          type: boolean
        sso_profile_id:
          type: string
      description: User attributes
    api.GroupResponse:
      type: object
      properties:
        attributes:
          $ref: '#/components/schemas/api.GroupAttributes'
        id:
          type: string
        type:
          type: string
      description: Group response model
    rbac.RoleSummary:
      type: object
      properties:
        group_id:
          type: integer
          description: when Via == "group"
        group_name:
          type: string
          description: when Via == "group"
        id:
          type: integer
        is_system:
          type: boolean
        name:
          type: string
        slug:
          type: string
        via:
          type: string
          description: >-
            "direct" | "group" | "host" (direct, assigned by the host
            application)| "group"
    api.GroupAttributes:
      type: object
      properties:
        catalogues:
          type: array
          items:
            $ref: '#/components/schemas/api.CatalogueResponse'
        data_catalogues:
          type: array
          items:
            $ref: '#/components/schemas/api.DataCatalogueResponse'
        name:
          type: string
        roles:
          type: array
          items:
            $ref: '#/components/schemas/rbac.RoleSummary'
        tool_catalogues:
          type: array
          items:
            $ref: '#/components/schemas/api.ToolCatalogueResponse'
        users:
          type: array
          items:
            $ref: '#/components/schemas/api.UserResponse'
      description: Group attributes
    api.CatalogueResponse:
      type: object
      properties:
        attributes:
          type: object
          properties:
            llm_names:
              type: array
              items:
                type: string
            name:
              type: string
            workspace_id:
              type: integer
        id:
          type: string
        type:
          type: string
      description: Catalogue response model
    api.DataCatalogueResponse:
      type: object
      properties:
        attributes:
          type: object
          properties:
            datasources:
              type: array
              items:
                $ref: '#/components/schemas/api.DatasourceResponse'
            icon:
              type: string
            long_description:
              type: string
            name:
              type: string
            short_description:
              type: string
            tags:
              type: array
              items:
                $ref: '#/components/schemas/api.TagResponse'
            workspace_id:
              type: integer
        id:
          type: string
        type:
          type: string
      description: Data Catalogue response model
    api.ToolCatalogueResponse:
      type: object
      properties:
        attributes:
          type: object
          properties:
            icon:
              type: string
            long_description:
              type: string
            name:
              type: string
            short_description:
              type: string
            tags:
              type: array
              items:
                $ref: '#/components/schemas/api.TagResponse'
            tools:
              type: array
              items:
                $ref: '#/components/schemas/api.ToolResponse'
            workspace_id:
              type: integer
        id:
          type: string
        type:
          type: string
      description: Tool Catalogue response model
    api.DatasourceResponse:
      type: object
      properties:
        attributes:
          type: object
          properties:
            active:
              type: boolean
            allow_internal_host:
              type: boolean
              description: |-
                AllowInternalHost: the datasource's own host may be an internal
                address (an administrator's switch).
            db_conn_api_key:
              type: string
            db_conn_string:
              type: string
            db_name:
              type: string
            db_source_type:
              type: string
            embed_api_key:
              type: string
            embed_model:
              type: string
            embed_url:
              type: string
            embed_vendor:
              type: string
            embedder_id:
              type: integer
            embedder_name:
              type: string
            files:
              type: array
              items:
                $ref: '#/components/schemas/api.FileStoreResponse'
            has_db_conn_api_key:
              type: boolean
            has_embed_api_key:
              type: boolean
            icon:
              type: string
            long_description:
              type: string
            name:
              type: string
            namespace:
              type: string
            privacy_score:
              type: integer
            short_description:
              type: string
            tags:
              type: array
              items:
                $ref: '#/components/schemas/api.TagResponse'
            tracing_content_mode_max:
              type: string
              description: Agent tracing content mode cap (Enterprise); "" is no cap.
            url:
              type: string
            user_id:
              type: integer
            workspace_id:
              type: integer
              description: |-
                WorkspaceID is the Workspace that owns the datasource (admin
                responses).
        governed_metadata:
          type: object
          description: Governed metadata (Enterprise); see LLMResponse.
        governed_metadata_status:
          type: string
        id:
          type: string
        type:
          type: string
      description: Datasource response model
    api.TagResponse:
      type: object
      properties:
        attributes:
          type: object
          properties:
            name:
              type: string
        id:
          type: string
        type:
          type: string
      description: Tag response model
    api.ToolResponse:
      type: object
      properties:
        attributes:
          $ref: '#/components/schemas/api.ToolResponseAttributes'
        governed_metadata:
          type: object
          description: Governed metadata (Enterprise); see LLMResponse.
        governed_metadata_status:
          type: string
        id:
          type: string
        type:
          type: string
      description: Tool response model
    api.FileStoreResponse:
      type: object
      properties:
        attributes:
          type: object
          properties:
            description:
              type: string
            file_name:
              type: string
            last_processed_on:
              type: string
            length:
              type: integer
            workspace_id:
              type: integer
              description: |-
                WorkspaceID is the Workspace that owns the entry (Enterprise
                Workspaces); a stored 0 reads as the Default.
        id:
          type: string
        type:
          type: string
      description: FileStore response model
    api.ToolResponseAttributes:
      type: object
      properties:
        active:
          type: boolean
        allow_internal_host:
          type: boolean
          description: >-
            AllowInternalHost: the tool's own API hosts may be internal
            addresses

            (an administrator's switch).
        app_grantable:
          type: boolean
        auth_key:
          type: string
        auth_schema_name:
          type: string
        dependencies:
          type: array
          items:
            $ref: '#/components/schemas/api.ToolResponse'
        description:
          type: string
        file_stores:
          type: array
          items:
            $ref: '#/components/schemas/api.FileStoreResponse'
        filters:
          type: array
          items:
            $ref: '#/components/schemas/api.FilterResponse'
        has_auth_key:
          type: boolean
        mcp_access_enabled:
          type: boolean
        mcp_endpoint_url:
          type: string
        name:
          type: string
        namespace:
          type: string
        oas_spec:
          type: string
        operations:
          type: array
          items:
            type: string
        privacy_score:
          type: integer
        rest_access_enabled:
          type: boolean
          description: >-
            Access methods. Chat is always available and is not listed.

            AppGrantable is false for a chat-only tool, which cannot be bound to
            an

            App.
        rest_endpoint_url:
          type: string
          description: >-
            Gateway URLs of the two access methods, built from TOOL_DISPLAY_URL
            (or

            PROXY_URL) and the slug. Empty for client tools and when no base URL
            is

            configured. They say where a method is served, not whether it is on.
        slug:
          type: string
          description: >-
            Slug is the path segment the gateway serves the tool under. It is

            computed server-side (with transliteration), so clients must not
            derive

            it from the name.
        tool_type:
          type: string
        tracing_content_mode_max:
          type: string
          description: Agent tracing content mode cap (Enterprise); "" is no cap.
        workspace_id:
          type: integer
          description: WorkspaceID is the Workspace that owns the tool (admin responses).
    api.FilterResponse:
      type: object
      properties:
        attributes:
          $ref: '#/components/schemas/api.FilterAttributes'
        id:
          type: string
        type:
          type: string
      description: Filter response model
    api.FilterAttributes:
      type: object
      properties:
        config:
          type: object
          additionalProperties: true
        description:
          type: string
        kind:
          type: string
        name:
          type: string
        namespace:
          type: string
        response_filter:
          type: boolean
        script:
          type: array
          items:
            type: integer
        workspace_id:
          type: integer
          description: WorkspaceID is the Workspace that owns the filter.
      description: Filter attributes
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````