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

# Toggle Api Key

> Toggle API key active status



## OpenAPI

````yaml /api-reference/openapi-developer.json put /api/v1/proxy/api-keys/{key_id}/toggle
openapi: 3.1.0
info:
  title: PromptGuard Developer API
  description: >-
    Public API for developers to integrate PromptGuard security into their
    applications
  version: 1.0.0
servers:
  - url: https://api.promptguard.dev
    description: Production API
  - url: https://staging-api.promptguard.dev
    description: Staging API
  - url: http://localhost:8080
    description: Local Development
security:
  - ApiKeyAuth: []
paths:
  /api/v1/proxy/api-keys/{key_id}/toggle:
    put:
      tags:
        - api-keys
      summary: Toggle Api Key
      description: Toggle API key active status
      operationId: toggle_api_key_api_v1_proxy_api_keys__key_id__toggle_put
      parameters:
        - name: key_id
          in: path
          required: true
          schema:
            type: string
            title: Key Id
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        PromptGuard API key for developer endpoints. Keys start with pg_live_
        and are created in the dashboard.

````