Setting TTL
Every memory has a time-to-live. Set it with expiresIn:
| Format | Example | Duration |
|---|
{n}s | 30s | 30 seconds |
{n}m | 15m | 15 minutes |
{n}h | 6h | 6 hours |
{n}d | 30d | 30 days |
Default: 30d. Minimum: 10s. Maximum: 365d.
What Happens on Expiry
A background job runs periodically and:
- Finds memories past their
expiresAt
- Deletes the Shelby blob from the blockchain
- Marks the memory as
visibility: "expired"
Pinned memories (pinned: true) are skipped by TTL cleanup. They never auto-expire.
Monitoring Expiring Memories
Check which memories are about to expire:
GET /v1/memory/expiring?within=24h&type=semantic
TTL Renewal
Renew TTLs via the TTL alerts endpoint:
curl -X POST "$API/memory/ttl-alerts" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"within": "24h",
"renewIds": ["id1", "id2"],
"renewExpiresIn": "30d"
}'
This extends the on-chain blob expiration and updates the database expiration in a single call. No re-upload of content is required — the blob data stays untouched.
renewExpiresIn sets expiry from now, not additive to the current expiry.
Renewing with "10d" means the memory expires 10 days from now, regardless of its current TTL.
Maximum renewal is 365d.
Webhooks
Subscribe to expiry events:
{
"url": "https://your-app.com/webhook",
"events": ["memory.expiring"],
"config": { "alertWindow": "24h" }
}
The webhook fires when memories enter the alert window.