---
title: "Register a webhook subscription for an agent's card changes."
method: POST
path: "/agents/{agent_id}/notifications/webhook"
tags: ["Notifications"]
---

# Register a webhook subscription for an agent's card changes.

`POST /agents/{agent_id}/notifications/webhook`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/agents/{agent_id}/notifications/webhook`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Mnemom-Api-Key`

Creates (or updates) a webhook subscription. The HMAC-SHA256 shared secret is returned **once** in the response — store it; subsequent verifications use the stored hash on Mnemom's side. Idempotent on (agent_id, consumer_id, webhook_url). cards-as-primitive Phase 5 C1. `webhook_url` — Outbound URL rules: the URL must be https and must point at a publicly reachable host. Credentials in the URL, single-label or internal host names (localhost, *.local, *.internal, *.home.arpa), and hosts that are or resolve to loopback, private (RFC1918), link-local (including cloud metadata), CGNAT, IPv6 unique-local/link-local, or other non-public addresses are rejected with 400. The host is resolved and re-checked again before every delivery and every redirect hop.

## Path parameters

- `agent_id` string, required

## Request body

- object
  - `webhook_url` string, uri, required
  - `consumer_id` string
  - `expires_at` string, date-time

## Response `201`

Subscription created or updated.

- object
  - `subscription_id` string, required
  - `webhook_url` string, uri, required
  - `secret` string, required: Shown exactly once; store it server-side.
  - `expires_at` string, date-time, required

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Resource not found
- `429`: Rate-limit exceeded. The global per-IP limiter (100 requests/minute, applied to every `/v1/*` route) rejected this request. Back off until the window resets — `Retry-After` carries the cooldown in seconds and `X-RateLimit-Reset` the absolute reset time.
- `500`: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.
- `503`: An upstream dependency is currently unavailable. The request was not processed; retry after the cooldown window.

---

[API](https://skmtc.dev/mnemom/apis/mnemom-api.md) · [All operations](https://skmtc.dev/mnemom/apis/mnemom-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mnemom/apis/mnemom-api/revisions/274b7a6ea182?raw)
