2 operations. Every schema and example on this page is generated from the platform contract.
Merchant fetches the AI-generated moments surfaced for their store - the pending opportunities to act on, with each moment's definition and owning addon. Defaults to pending moments (expired ones excluded), and returns lifetime counts by status (pending, accepted, dismissed) for the badge rollups.
Store whose moments to list (also authorises the merchant).
Status to fetch (default 'pending'). Matches moment_instances.status exactly.
Only meaningful when status='pending': pass 'true' to keep moments that carry a dismissed_reason.
Page size (default 20, max 50).
curl -G "https://www.membber.com/api/v1/moments" \
-H "Authorization: Bearer $MEMBBER_TOKEN" \
--data-urlencode "store_id=6659c139-0000-4000-8000-d0c500000066"import { createMembberClient } from "@membber/sdk-ts";
const membber = createMembberClient({
getAccessToken: () => process.env.MEMBBER_TOKEN,
});
const { data, error } = await membber.raw.GET("/api/v1/moments", {
params: { query: { store_id: "6659c139-0000-4000-8000-d0c500000066" } },
});
if (error) {
// Typed error envelope: { error: { code, message, requestId } }
throw new Error(`${error.error.code}: ${error.error.message}`);
}
console.log(data);import MembberSwift
let client = MembberClient(
serverURL: MembberClient.productionServerURL,
tokenProvider: { session.accessToken }
)
let response = try await client.api.listMoments(
query: .init(storeId: "6659c139-0000-4000-8000-d0c500000066")
).ok.body.json
print(response){
"moments": [
{
"id": "00000d1b-0000-4000-8000-d0c500000000",
"status": "<status>",
"confidence_score": 1,
"confidence_breakdown": {},
"target_entity_type": "<target_entity_type>",
"target_entity_id": "c98b49c9-0000-4000-8000-d0c5000000c9",
"context": {},
"suggested_action": {},
"expires_at": "<expires_at>",
"created_at": "<created_at>",
"definition": {
"slug": "<slug>",
"name": "Example name",
"description": "Added at the front desk",
"category": "<category>",
"priority": 1,
"addon": {
"slug": "<slug>",
"name": "Example name",
"icon_name": "<icon_name>"
}
}
}
],
"counts": {
"pending": 1,
"accepted": 1,
"dismissed": 1
}
}Merchant dismisses one of the AI-surfaced moments for their store. This is a SOFT dismiss: the moment keeps status 'pending' (so it can still be accepted later) and records an optional dismissed_reason that feeds future moment-quality tuning. Only a still-pending moment can be dismissed; an already-accepted one rejects. Faithful migration of the legacy POST /api/ios/moments/[id]/dismiss.
Store the moment belongs to (also authorises the merchant).
Optional dismissal reason. Known values: 'not_relevant', 'already_contacted', 'too_frequent', 'not_worth_effort', 'customer_not_trustworthy', 'other'. Any other text is stored (truncated to 500 chars).
curl -X POST "https://www.membber.com/api/v1/moments/ea770b3b-0000-4000-8000-d0c5000000ea/dismiss" \
-H "Authorization: Bearer $MEMBBER_TOKEN" \
-H "Idempotency-Key: 1f0e2d3c-4b5a-4678-9abc-def012345678" \
-H "Content-Type: application/json" \
-d '{
"store_id": "6659c139-0000-4000-8000-d0c500000066"
}'import { createMembberClient } from "@membber/sdk-ts";
const membber = createMembberClient({
getAccessToken: () => process.env.MEMBBER_TOKEN,
});
const { data, error } = await membber.raw.POST("/api/v1/moments/{momentId}/dismiss", {
params: { path: { momentId: "ea770b3b-0000-4000-8000-d0c5000000ea" } },
body: {
store_id: "6659c139-0000-4000-8000-d0c500000066"
},
headers: { "Idempotency-Key": crypto.randomUUID() },
});
if (error) {
// Typed error envelope: { error: { code, message, requestId } }
throw new Error(`${error.error.code}: ${error.error.message}`);
}
console.log(data);import MembberSwift
let client = MembberClient(
serverURL: MembberClient.productionServerURL,
tokenProvider: { session.accessToken }
)
let response = try await client.api.dismissMoment(
path: .init(momentId: "ea770b3b-0000-4000-8000-d0c5000000ea"),
body: .json(.init(
storeId: "6659c139-0000-4000-8000-d0c500000066"
))
).ok.body.json
print(response){
"moment": {
"id": "00000d1b-0000-4000-8000-d0c500000000",
"store_id": "6659c139-0000-4000-8000-d0c500000066",
"status": "<status>",
"dismissed_reason": "Added at the front desk",
"updated_at": "<updated_at>"
},
"message": "Added at the front desk"
}