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

# Rotate a webhook signing secret

> Replaces the signing secret and returns the new one; store it now, it is never shown again. Until previousSecretExpiresAt every delivery carries two signatures, one per secret, so receivers can switch without dropping deliveries. A rotation during an overlap replaces the older secret.



## OpenAPI

````yaml /openapi/openapi.json post /v1/webhooks/{id}/rotate-secret
openapi: 3.1.0
info:
  contact:
    name: InkRelay
    url: https://docs.inkrelay.app
  description: >-
    Cloud printing API: send PDFs and raw jobs to printers attached to computers
    running the InkRelay agent.
  title: InkRelay API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.inkrelay.app
security:
  - ApiKeyAuth: []
  - BasicAuth: []
tags:
  - description: Who you are, your plan and usage
    name: Account
  - description: Machines running the InkRelay agent
    name: Computers
  - description: Printers reported by agents
    name: Printers
  - description: Submit and track print jobs
    name: Print jobs
  - description: Signed event delivery to your HTTPS endpoints
    name: Webhooks
  - description: Cursor based event feed
    name: Events
  - description: Prints used this period
    name: Usage
paths:
  /v1/webhooks/{id}/rotate-secret:
    post:
      tags:
        - Webhooks
      summary: Rotate a webhook signing secret
      description: >-
        Replaces the signing secret and returns the new one; store it now, it is
        never shown again. Until previousSecretExpiresAt every delivery carries
        two signatures, one per secret, so receivers can switch without dropping
        deliveries. A rotation during an overlap replaces the older secret.
      operationId: rotateWebhookSecret
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                overlapSeconds:
                  default: 86400
                  description: >-
                    How long deliveries stay signed with the old secret too (0
                    to 604800 seconds, default 1 day). 0 drops it at once.
                  example: 86400
                  maximum: 604800
                  minimum: 0
                  type: integer
              type: object
        description: Rotation options
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointWithSecret'
          description: The endpoint with its new secret
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Invalid request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid API key or session
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: The key scope or member role does not allow this
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not found in this organization and mode
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: >-
            rate_limited: more than 20 requests per second with this API key;
            retry after the Retry-After header
          headers:
            RateLimit-Limit:
              description: Requests allowed per second for this API key (20)
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current one second window
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window frees a request
              schema:
                type: integer
            Retry-After:
              description: Whole seconds to wait before retrying; present on rate_limited
              schema:
                type: integer
      security:
        - ApiKeyAuth: []
        - BasicAuth: []
components:
  schemas:
    WebhookEndpointWithSecret:
      allOf:
        - $ref: '#/components/schemas/WebhookEndpoint'
        - properties:
            secret:
              description: Signing secret, returned only by this response. Store it now.
              example: whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD
              type: string
          required:
            - secret
          type: object
    Error:
      description: >-
        Every error response uses this envelope; code is stable, message is for
        humans.
      properties:
        error:
          properties:
            code:
              example: not_found
              type: string
            message:
              example: Printer not found
              type: string
            request_id:
              example: 4f9c2a7e-1b3d-4c5e-8f6a-0b1c2d3e4f5a
              type: string
            upgrade_url:
              description: Billing page to upgrade from; present on quota_exceeded
              example: https://app.inkrelay.app/billing?upgrade=1
              format: uri
              type: string
          required:
            - code
            - message
            - request_id
          type: object
      required:
        - error
      type: object
    WebhookEndpoint:
      properties:
        createdAt:
          format: date-time
          type: string
        description:
          type:
            - string
            - 'null'
        disabledReason:
          description: >-
            Why the endpoint is disabled: by a user, or automatically after 5
            days of failures
          type:
            - string
            - 'null'
        enabled:
          type: boolean
        events:
          items:
            enum:
              - printjob.queued
              - printjob.sent
              - printjob.received
              - printjob.printing
              - printjob.done
              - printjob.error
              - printjob.cancelled
              - printjob.expired
              - computer.online
              - computer.offline
              - printer.added
              - printer.removed
              - printer.online
              - printer.offline
              - printer.updated
            example: printjob.done
            type: string
          type: array
        failingSince:
          description: Start of the current run of failed deliveries; null while healthy
          format: date-time
          type:
            - string
            - 'null'
        id:
          format: uuid
          type: string
        mode:
          enum:
            - live
            - test
          type: string
        previousSecretExpiresAt:
          description: >-
            Until this time deliveries are also signed with the secret replaced
            by the last rotation; null when there is none
          format: date-time
          type:
            - string
            - 'null'
        url:
          example: https://example.com/inkrelay/webhooks
          type: string
      required:
        - id
        - url
        - description
        - events
        - mode
        - enabled
        - disabledReason
        - failingSince
        - previousSecretExpiresAt
        - createdAt
      type: object
  securitySchemes:
    ApiKeyAuth:
      bearerFormat: ir_live_ or ir_test_ key
      description: >-
        Send `Authorization: Bearer <API key>`. Use an ir_test_ key in the
        playground; it only reaches virtual test printers.
      scheme: bearer
      type: http
      x-default: ir_test_REPLACE_WITH_YOUR_TEST_KEY
    BasicAuth:
      description: >-
        PrintNode compatible: put the API key in the username with an empty
        password
      scheme: basic
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.