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

# Know the moment ingestion finishes

> Webhooks instead of polling, plus the per-space defaults that stop you resending the same options.

[← All use cases](/use-cases/overview)

<div className="uc-examples"><a href="https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/webhooks_and_settings.py">webhooks\_and\_settings.py</a></div>

## The scenario

Polling a job every five seconds works in a script and is wrong in a pipeline.
And if every call in your codebase passes the same three options, those belong
on the space, not in the call.

Three per-space configuration surfaces, all free to call.

## Step 1 — Register a webhook

```python theme={null}
hook = client.create_webhook(
    space_id=space,
    url="https://example.com/anona-hook",
    event_types=["memory.created"],
)
print(hook["id"], hook["event_types"])
```

<Warning>
  **The signing secret appears exactly once, in this response.** Store it now and
  verify every delivery against it. There is no way to read it back.
</Warning>

## Step 2 — Manage and inspect it

```python theme={null}
client.update_webhook(space_id=space, webhook_id=hook["id"], enabled=False)
deliveries = client.list_webhook_deliveries(space_id=space, webhook_id=hook["id"])
```

Deliveries are inspectable after the fact — status, attempt count, response
codes. That is the difference between "the webhook is broken" and "your endpoint
returned 500 four times".

## Step 3 — Set the proxy's defaults on the space

```python theme={null}
client.set_chat_settings(space_id=space, memory_limit=8, auto_record=True)
print(client.get_chat_settings(space_id=space))
```

A stock OpenAI SDK pointed at the proxy now gets these without per-call knobs.

Every field is nullable, and **null means unset, not off** — which is what lets
a half-configured space inherit the rest of its defaults from the platform. Read
before you write, because a PUT is a full replace: an omitted field is cleared.

```python theme={null}
client.reset_chat_settings(space_id=space)
```

## Step 4 — Tune extraction

```python theme={null}
client.set_extraction_settings(space_id=space, mode="verbose")
```

## Evals

1. Register a webhook against a request-bin URL, write a memory, confirm a
   delivery arrives and its signature verifies.
2. Point it at an endpoint that returns 500 and check the delivery list records
   the attempts.
3. Set chat settings, make a proxy call with no options, confirm the defaults
   applied.

## Guardrails

* **A settings write is a full replace.** An omitted field is cleared, not left
  alone — read, modify, write.
* **Resetting extraction settings clears everything on that surface**, including
  a file-RAG strategy set at space creation. Prefer a targeted write.
* **Config routes are free and are not credit-gated** on purpose: an org out of
  credits must still be able to turn things off.

## The script

Complete and runnable:
[`webhooks_and_settings.py`](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/webhooks_and_settings.py).
