Use a dynamic table for this recipe. Save a filter on
marketing_email_consent. Casa Layer then keeps members whose effective
marketing-email status is granted.
Partner credentials are read-only. An operator creates the table in the
Casa Layer app. The partner then reads members over the public API.
What you need
An operator with access to the Casa Layer app creates and saves the table. The partner credential needs these scopes:write:tables is session-only. Partner credentials cannot create or save a
table.
What a table is
A table holds members in one property group. Member rows are directory projections: name, email, phone, and when the member entered the table. Each member also returns:
On a guest table,
id and guest_profile_id are the same. Use
guest_profile_id on other endpoints.
On a master table:
- A clustered row has
master_profile_idset andguest_profile_idnull. Load member guests fromGET /v1/master-profiles/{id}. - A singleton row is an unclustered guest.
guest_profile_idis set.master_profile_idis null.
consents is the effective rollup. When more than one observation exists
for the same contact method and purpose, Casa Layer keeps the most
restrictive status: withdrawn, then denied, then granted.
No consent row means unknown. Unknown is not granted. A guest with an
empty consents array has not provided marketing consent.
See Tables and Consents.
1. Create the table in the app
Do this in the Casa Layer app. Do not call create from a partner credential.- Open Tables.
- Click Create table.
- Enter a name, for example
Marketing email granted. - Set Type to Dynamic.
- Set Guest profile type:
- Guest profiles — one row per source record
- Master profiles (default) — one row per resolved guest
- Click Create table.
guest_profile_id you can send to other endpoints.
Pick Master profiles when the partner wants one row per real guest.
2. Save the marketing consent filter
The new table opens with no members. Add the filter, then save it.- Click Filter.
- Set Field to Marketing email consent.
- Set Condition to is.
- Set Value to Granted.
- Click Save.
marketing_email_consent is the effective marketing-email status for the
member. Allowed values are granted, denied, and withdrawn.
A static table does not apply this filter. If you add members by hand,
validate consents on every row. Do not trust membership alone.
3. Create partner credentials
Create the credential in the Casa Layer app. See Partner API credentials for the full steps.- Open Integrations → Partner credentials → Custom Integration.
- Name the credential.
- Select
read:tables. Addread:consentsandread:guestsif the partner will run the extra checks below. - Click Create credentials.
- Copy the client ID and client secret.
4. Get an access token
Exchange the client ID and client secret for a short-lived access token.access_token from the response. Cache it until exp.
Send the token as a bearer credential on every request below:
5. Find the table
limit is 100. The maximum is 500.
Match the table by name, or store id when the operator creates it.
type is dynamic and member_type is the grain you chose.
Read the saved filter:
filter_doc includes marketing_email_consent with value
granted.
You can also preview a filter without a saved table:
count. It does not return members. Use it to check
the filter before the operator saves.
6. Retrieve members
has_more is true, send offset
equal to next_offset. Repeat until has_more is false.
7. Validate marketing consent
Treat each member as granted only whenconsents contains a row that
matches all three fields:
Reject the member when:
consentsis missing or empty- the marketing-email row is
deniedorwithdrawn - the only granted row is a different purpose or contact method
consents already rolls up member guests. You do
not need a guest profile ID to validate that row.
Optional — load member guests of a clustered master
Whenguest_profile_id is null, load the master:
guest_profile_ids. Each value is a Casa Layer guest profile ID.
Optional — list stored observations
GET /v1/consents returns individual observations. It does not return the
effective rollup. guest_profile_id on that route is ingest-time
provenance only.
consents to decide
eligibility.
This search has no master_profile_id filter. For a clustered master,
validate consents on the member, or call the search once per guest
profile ID.
If the member list is empty
Work through this list:- Confirm the operator clicked Save after the filter.
- Confirm
GET /v1/tables/{id}/filtersshowsmarketing_email_consentisgranted. - Confirm ingest has stored consent observations.
- Confirm you did not expect unknown guests. No row means unknown.
- Confirm
member_typematches the grain you want. - For a static table, add members by hand. The filter does not run.
Errors
An empty member page is not
404. The list is empty.
Related
Partner API credentials
Create, rotate, and revoke the credential.
Data model
Tables, members, and consents.
Browse table members
GET /v1/tables/{id}/members reference.Search consents
Stored consent observations.