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

# Enable or Disable Secure Mode on Public Key

> Enable or disable secure mode on an existing public key (e.g. `ws_pubk_...`).



## OpenAPI

````yaml PATCH /v1/{workspace}/ws_public_key/{public_key_id}/
openapi: 3.1.1
info:
  title: SuprSend API
  description: APIs supported on suprsend platform
  version: 1.2.2
servers:
  - url: https://hub.suprsend.com
security:
  - sec0: []
  - BearerAuth: []
paths:
  /v1/{workspace}/ws_public_key/{public_key_id}/:
    patch:
      summary: Enable/Disable Secure Mode on Public Key
      description: >-
        Enable or disable secure mode on an existing public key (e.g.
        `ws_pubk_...`).
      operationId: patch-workspace-public-key
      parameters:
        - in: path
          name: workspace
          required: true
          schema:
            type: string
          description: Workspace slug (e.g. `staging`, `production`).
        - in: path
          name: public_key_id
          required: true
          schema:
            type: string
          description: Public key identifier (e.g. `ws_pubk_...`).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkspacePublicKeyPatchRequest'
            example:
              is_secure_mode_enabled: true
      responses:
        '202':
          description: Secure mode update accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagementWorkspacePublicKey'
              example:
                id: ws_pubk_exampleId01
                api_key: SS.PUBK.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                name: web-app
                allowed_domains: null
                is_secure_mode_enabled: true
                is_deleted: false
                is_default: false
                created_at: '2026-04-21T13:08:29.144658Z'
                created_by:
                  name: Example User
                  email: user@example.com
                rotated_at: '2026-04-21T13:08:59.983999Z'
                rotated_by:
                  name: System User
                  email: org_XXXXXXXXXXXXXXXXXXXXXX@systemuser.suprsend.com
                updated_at: '2026-04-21T13:08:59.984183Z'
                updated_by:
                  name: System User
                  email: org_XXXXXXXXXXXXXXXXXXXXXX@systemuser.suprsend.com
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
      security:
        - ServiceTokenAuth: []
      servers:
        - url: https://management-api.suprsend.com
      x-codeSamples:
        - lang: cURL
          label: Patch Workspace Public Key
          source: >
            curl -X PATCH
            "https://management-api.suprsend.com/v1/{workspace}/ws_public_key/{public_key_id}/"
            \
              --header 'Authorization: ServiceToken <SERVICE_TOKEN>' \
              --header 'Content-Type: application/json' \
              --data '{"is_secure_mode_enabled":true}'
components:
  schemas:
    WorkspacePublicKeyPatchRequest:
      type: object
      required:
        - is_secure_mode_enabled
      properties:
        is_secure_mode_enabled:
          type: boolean
          description: Enable or disable secure mode for this public key.
    ManagementWorkspacePublicKey:
      type: object
      description: Workspace public key used by client SDKs.
      properties:
        id:
          type: string
          example: ws_pubk_exampleId01
        api_key:
          type: string
          description: Public key value exposed to clients.
          example: SS.PUBK.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        name:
          type: string
          example: web-app
        allowed_domains:
          type: array
          nullable: true
          items:
            type: string
        is_secure_mode_enabled:
          type: boolean
        is_deleted:
          type: boolean
        is_default:
          type: boolean
        created_at:
          type: string
          format: date-time
        created_by:
          $ref: '#/components/schemas/ManagementActor'
        rotated_at:
          type: string
          format: date-time
          nullable: true
        rotated_by:
          $ref: '#/components/schemas/ManagementActor'
        updated_at:
          type: string
          format: date-time
        updated_by:
          $ref: '#/components/schemas/ManagementActor'
    ManagementActor:
      type: object
      description: >-
        Identity that performed an action (created, updated, rolled, deleted,
        rotated).
      nullable: true
      properties:
        name:
          type: string
          description: Display name of the actor.
          example: System User
        email:
          type: string
          description: Email address of the actor.
          example: user@example.com
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: HTTP status code
        error_code:
          type: string
          description: Specific error code identifier
        type:
          type: string
          description: Error type classification
        message:
          type: string
          description: Human-readable error message
        detail:
          type: string
          description: Additional error details
  responses:
    ValidationError:
      description: Validation error - data validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    AuthenticationError:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 401
            error_code: authentication_failed
            type: AuthenticationFailed
            message: Invalid service token.
            detail: Invalid service token.
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 404
            error_code: not_found
            type: NotFound
            message: workspace 'demo' not found
            detail: workspace 'demo' not found
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where <token>
        is your auth token.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API_Key
      description: >-
        Pass as `Bearer <API_KEY>`. Get API Key from SuprSend dashboard
        Developers -> API Keys section.
    ServiceTokenAuth:
      type: apiKey
      in: header
      name: ServiceToken <token>
      description: >-
        You can get Service Token from [SuprSend dashboard -> Account Settings
        -> Service
        Tokens](https://app.suprsend.com/en/account-settings/service-tokens)
        section.

````