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

# Retrieve Webhook Signing Key

> Retrieves the public key used to verify signatures on incoming webhook payloads.




## OpenAPI

````yaml /email-api/api-reference/openapi.yaml get /webhook/public-key
openapi: 3.0.0
info:
  contact:
    email: support@mailchannels.com
    name: MailChannels Corporation
  description: >
    This is the API reference for Email API. Here, you'll find more detailed
    information on every endpoint, including parameters, response formats, and
    error codes.
  title: Email API
  version: 1.4.0
servers:
  - url: https://api.mailchannels.net/tx/v1
security: []
tags:
  - name: Send
  - name: DKIM
  - name: Metrics
  - name: Sub-accounts
  - name: Suppression
  - name: Webhooks
  - name: Usage
  - name: Custom Tracking
paths:
  /webhook/public-key:
    get:
      tags:
        - Webhooks
      summary: Retrieve Webhook Signing Key
      description: >
        Retrieves the public key used to verify signatures on incoming webhook
        payloads.
      parameters:
        - description: the ID of the key
          in: query
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Key'
          description: Successfully return the webhook signing key
        '404':
          description: The key is not found
        '500':
          description: Internal Server Error
      x-codeSamples:
        - label: Node.js
          lang: javascript
          source: >-
            import { MailChannels } from "mailchannels-sdk";


            const { MAILCHANNELS_API_KEY, KEY_ID } = process.env;

            if (!MAILCHANNELS_API_KEY) throw new Error("Set MAILCHANNELS_API_KEY
            before running");

            if (!KEY_ID) throw new Error("Set KEY_ID (the signing key ID from
            the signature-input webhook header)");


            const mailchannels = new MailChannels(MAILCHANNELS_API_KEY);


            const { data, error } = await
            mailchannels.webhooks.getSigningKey(KEY_ID);


            if (error) {
              console.error("Get signing key failed:", error);
              process.exit(1);
            }

            console.log(data);
        - label: Python
          lang: python
          source: |-
            import os
            import sys

            import mailchannels

            if not os.environ.get("MAILCHANNELS_API_KEY"):
                sys.exit("Set MAILCHANNELS_API_KEY before running")

            key_id = os.environ.get("KEY_ID")
            if not key_id:
                sys.exit("Set KEY_ID (the signing key ID from the signature-input webhook header)")

            response = mailchannels.Webhooks.public_key(key_id)

            print(response)
        - label: PHP
          lang: php
          source: >-
            <?php


            require_once __DIR__ . '/vendor/autoload.php';


            use MailChannels\Client;


            $api_key = getenv('MAILCHANNELS_API_KEY') or exit("Error:
            MAILCHANNELS_API_KEY is not set\n");

            $key_id  = getenv('KEY_ID') or exit("Error: KEY_ID is not set\n");


            $client = new Client(apiKey: $api_key);


            // KEY_ID is the signing key ID from the signature-input webhook
            header.

            $response = $client->webhooks->publicKey($key_id);


            print_r($response->toArray());
components:
  schemas:
    Key:
      properties:
        id:
          type: string
        key:
          description: The public key used to verify webhook signatures
          type: string
      required:
        - id
        - key
      type: object

````