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

# Rotate a webhook signing secret

> Issues a new signing key and returns its secret once. You choose what happens to the key it replaces: `previous_secret: "revoke"` stops it immediately; `previous_secret: "expire"` with `expires_in` (60 to 259200 seconds, which is 72 hours) keeps it signing alongside the new one so you can deploy the new secret first. While both are live, every webhook carries one signature per key. At most 3 keys are live at once. Pass `signature_scheme` to switch between HMAC and Ed25519.



## OpenAPI

````yaml /api-reference/openapi.json post /webhook-endpoints/{id}/rotate-secret
openapi: 3.1.0
info:
  title: i10 API
  version: 0.0.0
  description: >-
    Transactional email API. Generated from the same Zod schemas the server
    validates with and the SDKs are built from, so the reference cannot drift
    from the implementation.
servers:
  - url: https://api.i10.tech
    description: Production
security: []
tags:
  - name: Emails
    description: Sending and retrieving transactional mail.
  - name: Domains
    description: Managing sending domains and DNS verification.
  - name: Webhooks
    description: Managing webhook endpoints, deliveries, replays and stats.
  - name: Webhook events
    description: Event payloads i10 signs and POSTs to your webhook endpoints.
  - name: Suppressions
    description: Managing workspace-wide suppressed recipient addresses.
  - name: Trusted templates
    description: Submitting email templates for deliverability review.
paths:
  /webhook-endpoints/{id}/rotate-secret:
    post:
      tags:
        - Webhooks
      summary: Rotate a webhook signing secret
      description: >-
        Issues a new signing key and returns its secret once. You choose what
        happens to the key it replaces: `previous_secret: "revoke"` stops it
        immediately; `previous_secret: "expire"` with `expires_in` (60 to 259200
        seconds, which is 72 hours) keeps it signing alongside the new one so
        you can deploy the new secret first. While both are live, every webhook
        carries one signature per key. At most 3 keys are live at once. Pass
        `signature_scheme` to switch between HMAC and Ed25519.
      operationId: rotateWebhookEndpointSecret
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RotateWebhookSecret'
      responses:
        '200':
          description: >-
            Rotated. `secret` is shown only in this response (null for Ed25519,
            which you verify with `public_key`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointWithSecret'
        '401':
          description: The API key is missing, malformed, or unknown.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The key is restricted to a domain, or is a test key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such endpoint for this API key's tenant.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            No choice for the previous secret, an `expires_in` out of range, or
            too many live keys.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '501':
          description: Webhook endpoints are not configured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    RotateWebhookSecret:
      type: object
      properties:
        previous_secret:
          type: string
          enum:
            - revoke
            - expire
        expires_in:
          type: integer
          minimum: 60
          maximum: 259200
        signature_scheme:
          type: string
          enum:
            - hmac_sha256
            - ed25519
      required:
        - previous_secret
    WebhookEndpointWithSecret:
      type: object
      properties:
        object:
          type: string
          enum:
            - webhook_endpoint
        id:
          type: string
          format: uuid
        kind:
          type: string
          enum:
            - http
            - polling
            - sqs
        url:
          type:
            - string
            - 'null'
          format: uri
        events:
          type: array
          items:
            type: string
            enum:
              - email.sent
              - email.delivered
              - email.delivery_delayed
              - email.bounced
              - email.complained
              - email.failed
              - email.opened
              - email.clicked
              - email.unsubscribed
              - webhook_endpoint.failing
              - webhook_endpoint.disabled
              - webhook_endpoint.recovered
              - member.provisioned
              - member.deprovisioned
              - sso.connection.failed
              - sso.certificate.expiring
        description:
          type:
            - string
            - 'null'
        enabled:
          type: boolean
        disabled_reason:
          type:
            - string
            - 'null'
        health:
          type: string
          enum:
            - healthy
            - failing
            - disabled
        health_changed_at:
          type:
            - string
            - 'null'
        poll_cursor:
          type:
            - string
            - 'null'
        last_polled_at:
          type:
            - string
            - 'null'
        transformation:
          type:
            - object
            - 'null'
          properties:
            code:
              type: string
              minLength: 1
              maxLength: 65536
            enabled:
              type: boolean
          required:
            - code
            - enabled
        aws_access_key_id:
          type:
            - string
            - 'null'
        created_at:
          type: string
        signature_scheme:
          type: string
          enum:
            - hmac_sha256
            - ed25519
        rate_limit:
          type:
            - integer
            - 'null'
        header_names:
          type: array
          items:
            type: string
        filter_domains:
          type:
            - array
            - 'null'
          items:
            type: string
        filter_tags:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
        public_key:
          type:
            - string
            - 'null'
        previous_secrets:
          type: array
          items:
            type: object
            properties:
              signature_scheme:
                type: string
                enum:
                  - hmac_sha256
                  - ed25519
              expires_at:
                type: string
            required:
              - signature_scheme
              - expires_at
        secret:
          type:
            - string
            - 'null'
      required:
        - object
        - id
        - kind
        - url
        - events
        - description
        - enabled
        - disabled_reason
        - health
        - health_changed_at
        - poll_cursor
        - last_polled_at
        - transformation
        - aws_access_key_id
        - created_at
        - signature_scheme
        - rate_limit
        - header_names
        - filter_domains
        - filter_tags
        - public_key
        - previous_secrets
        - secret
    Error:
      type: object
      properties:
        statusCode:
          type: integer
        name:
          type: string
          enum:
            - validation_error
            - missing_required_field
            - invalid_access
            - not_found
            - method_not_allowed
            - rate_limit_exceeded
            - daily_quota_exceeded
            - monthly_quota_exceeded
            - test_quota_exceeded
            - invalid_from_address
            - invalid_to_address
            - domain_not_verified
            - idempotency_conflict
            - domain_already_exists
            - domain_already_claimed
            - plan_limit_exceeded
            - mail_signin_off
            - mailbox_already_exists
            - restricted_api_key
            - test_key_not_allowed
            - confirmation_required
            - sending_paused
            - sending_held
            - template_already_submitted
            - internal_server_error
        message:
          type: string
      required:
        - statusCode
        - name
        - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your i10 API key, prefixed `i10_live_` or `i10_test_`. Test keys can
        only send simulated emails (never delivered externally or counted toward
        limits), read test emails and list domains; all other endpoints refuse
        them with 403 `test_key_not_allowed`.

````

## Related topics

- [Revoke previous webhook signing secrets](https://docs.i10.tech/api-reference/webhooks/revoke-previous-webhook-endpoint-secrets.md)
- [Create a webhook endpoint](https://docs.i10.tech/api-reference/webhooks/create-webhook-endpoint.md)
- [List webhook endpoints](https://docs.i10.tech/api-reference/webhooks/list-webhook-endpoints.md)
- [Get a webhook endpoint](https://docs.i10.tech/api-reference/webhooks/get-webhook-endpoint.md)
- [Resume a webhook endpoint](https://docs.i10.tech/api-reference/webhooks/resume-webhook-endpoint.md)


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