---
updatedAt: 2026-07-21T14:55:00.000Z
agentTools:
  projectIndex: https://docs.sikoia.com/llms.txt
---

# Create a shared secret

### Creates a new secret key to be used to sign all webhook requests.

All subsequent wehook requests sent will include a HMACSHA256 hash that has been Base64 encoded in the `X-HMAC-SHA256-Signature` header. Comparing this hashed value against a SHA256 hash of the request body (using the secret as a key) enables you to verify the payload has not been tampered with.

All subsequent wehook requests sent will include a HMACSHA256 hash that has been Base64 encoded in the `X-HMAC-SHA256-Signature` header. Comparing this hashed value against a SHA256 hash of the request body (using the secret as a key) enables you to verify the payload has not been tampered with.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Sikoia API",
    "termsOfService": "https://sikoia.com/About/Terms",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.sikoia.com",
      "description": "API (Production)"
    },
    {
      "url": "https://oauth2.sikoia.com",
      "description": "Authorization Server (Production)"
    },
    {
      "url": "https://api-staging.sikoia.com",
      "description": "API (Staging)"
    },
    {
      "url": "https://oauth2-staging.sikoia.com",
      "description": "Authorization Server (Staging)"
    }
  ],
  "paths": {
    "/v2/webhooks/secrets": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Create a shared secret",
        "description": "### Creates a new secret key to be used to sign all webhook requests.\r\n\r\nAll subsequent wehook requests sent will include a HMACSHA256 hash that has been Base64 encoded in the `X-HMAC-SHA256-Signature` header. Comparing this hashed value against a SHA256 hash of the request body (using the secret as a key) enables you to verify the payload has not been tampered with.",
        "operationId": "POST_v2-webhooks-secrets",
        "responses": {
          "201": {
            "description": "Create a new webhook secret",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MicroserviceUserManagement.Resources.External.WebhookSecret"
                },
                "example": {
                  "shared_key": "string",
                  "date_created": "string",
                  "date_updated": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MicroserviceUserManagement.Resources.SikoiaErrorResponse401"
                },
                "example": {
                  "type": "InvalidToken",
                  "status": "401",
                  "title": "Invalid Token",
                  "detail": "Invalid token",
                  "correlation_id": "a28d1abd-ad97-4a1f-bd14-6698c5214544"
                }
              }
            }
          },
          "409": {
            "description": "Cannot create multiple webhook secrets",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MicroserviceUserManagement.Resources.SikoiaErrorResponse409"
                },
                "example": {
                  "type": "UnprocessableRequest",
                  "status": "409",
                  "title": "Cannot create multiple webhook secrets",
                  "detail": "Only one webhook secret is supported. Please refer to the API docs on how to either rotate the existing key value or delete it from the system.",
                  "correlation_id": "a28d1abd-ad97-4a1f-bd14-6698c5214544"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MicroserviceUserManagement.Resources.SikoiaErrorResponse429"
                },
                "example": {
                  "type": "RateLimit",
                  "status": "429",
                  "title": "Too Many Requests",
                  "detail": "You've exceeded the maximum API request limit per minute. Please try again later.",
                  "correlation_id": "a28d1abd-ad97-4a1f-bd14-6698c5214544"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MicroserviceUserManagement.Resources.SikoiaErrorResponse500"
                },
                "example": {
                  "type": "ServerError",
                  "status": "500",
                  "title": "Internal Server Error",
                  "detail": "Something has gone wrong, please try again",
                  "correlation_id": "a28d1abd-ad97-4a1f-bd14-6698c5214544"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "MicroserviceUserManagement.Resources.External.WebhookSecret": {
        "type": "object",
        "properties": {
          "shared_key": {
            "type": "string",
            "description": "The UTF8 encoded value used as the key in the SHA256 hash.",
            "readOnly": true
          },
          "date_created": {
            "type": "string",
            "description": "The timestamp for when the secret started being used to add a HMACSHA256 header to all webhook requests. Formatted: yyyy-MM-ddTHH:mm:ss.fffZ",
            "format": "date-time",
            "readOnly": true
          },
          "date_updated": {
            "type": "string",
            "description": "The timestamp for when the key last changed. If a key is rotated this will be different to the date_created. Formatted: yyyy-MM-ddTHH:mm:ss.fffZ",
            "format": "date-time",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "The current secret used as the shared key for the HMACSHA256 header."
      },
      "MicroserviceUserManagement.Resources.SikoiaErrorResponse401": {
        "title": "MicroserviceUserManagement.Resources.SikoiaErrorResponse",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The error type",
            "readOnly": true,
            "example": "InvalidToken"
          },
          "status": {
            "type": "integer",
            "description": "HTTP status code of the error",
            "format": "HttpCode",
            "readOnly": true,
            "example": "401"
          },
          "title": {
            "type": "string",
            "description": "A short description of the error",
            "readOnly": true,
            "example": "Invalid Token"
          },
          "detail": {
            "type": "string",
            "description": "More details about what went wrong",
            "readOnly": true,
            "example": "Invalid token"
          },
          "correlation_id": {
            "type": "string",
            "description": "Correlation ID, please include this in any support tickets raised",
            "readOnly": true,
            "example": "a28d1abd-ad97-4a1f-bd14-6698c5214544"
          }
        },
        "additionalProperties": false
      },
      "MicroserviceUserManagement.Resources.SikoiaErrorResponse409": {
        "title": "MicroserviceUserManagement.Resources.SikoiaErrorResponse",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The error type",
            "readOnly": true,
            "example": "UnprocessableRequest"
          },
          "status": {
            "type": "integer",
            "description": "HTTP status code of the error",
            "format": "HttpCode",
            "readOnly": true,
            "example": "409"
          },
          "title": {
            "type": "string",
            "description": "A short description of the error",
            "readOnly": true,
            "example": "Cannot create multiple webhook secrets"
          },
          "detail": {
            "type": "string",
            "description": "More details about what went wrong",
            "readOnly": true,
            "example": "Only one webhook secret is supported. Please refer to the API docs on how to either rotate the existing key value or delete it from the system."
          },
          "correlation_id": {
            "type": "string",
            "description": "Correlation ID, please include this in any support tickets raised",
            "readOnly": true,
            "example": "a28d1abd-ad97-4a1f-bd14-6698c5214544"
          }
        },
        "additionalProperties": false
      },
      "MicroserviceUserManagement.Resources.SikoiaErrorResponse429": {
        "title": "MicroserviceUserManagement.Resources.SikoiaErrorResponse",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The error type",
            "readOnly": true,
            "example": "RateLimit"
          },
          "status": {
            "type": "integer",
            "description": "HTTP status code of the error",
            "format": "HttpCode",
            "readOnly": true,
            "example": "429"
          },
          "title": {
            "type": "string",
            "description": "A short description of the error",
            "readOnly": true,
            "example": "Too Many Requests"
          },
          "detail": {
            "type": "string",
            "description": "More details about what went wrong",
            "readOnly": true,
            "example": "You've exceeded the maximum API request limit per minute. Please try again later."
          },
          "correlation_id": {
            "type": "string",
            "description": "Correlation ID, please include this in any support tickets raised",
            "readOnly": true,
            "example": "a28d1abd-ad97-4a1f-bd14-6698c5214544"
          }
        },
        "additionalProperties": false
      },
      "MicroserviceUserManagement.Resources.SikoiaErrorResponse500": {
        "title": "MicroserviceUserManagement.Resources.SikoiaErrorResponse",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The error type",
            "readOnly": true,
            "example": "ServerError"
          },
          "status": {
            "type": "integer",
            "description": "HTTP status code of the error",
            "format": "HttpCode",
            "readOnly": true,
            "example": "500"
          },
          "title": {
            "type": "string",
            "description": "A short description of the error",
            "readOnly": true,
            "example": "Internal Server Error"
          },
          "detail": {
            "type": "string",
            "description": "More details about what went wrong",
            "readOnly": true,
            "example": "Something has gone wrong, please try again"
          },
          "correlation_id": {
            "type": "string",
            "description": "Correlation ID, please include this in any support tickets raised",
            "readOnly": true,
            "example": "a28d1abd-ad97-4a1f-bd14-6698c5214544"
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "authorizationHeader": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "name": "apikey",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "authorizationHeader": []
    },
    {
      "apiKeyHeader": []
    }
  ]
}
```