Most Membership.io endpoints return JSON:API-style documents.
Use this request header:
application/json is also accepted by the backend for compatibility, but application/vnd.api+json is the canonical media type.
Resource response
A single resource response has data.id, data.type, and data.attributes.
List response
A list response returns data as an array. Paginated endpoints also include links and metadata.
Write request
Many newer write endpoints use a JSON:API envelope:
Update request
A PATCH is a partial update: send only the attributes you want to change. An omitted attribute is left alone. An explicit null clears an attribute that can be empty, and is a 422 on one that can’t.
You may send the resource’s id in data, as JSON:API recommends:
data.id is optional. When you send it, it must be the id of the resource you’re updating, the same id the response returns. A different id is a 409 with code resource_id_mismatch and source.pointer /data/id, and nothing is written. That protects you from updating the wrong record when a client mixes up its ids. Leave id out rather than sending null: "id": null, or any id that isn’t a string, is a 422. Where a path accepts a slug, such as /hubs/{identifier} or /pages/{identifier}, compare against the canonical id, never the slug.
Authentication and route-level checks run before this one. Some routes check your permission on the resource later, so a request that isn’t allowed and also names a different id can get the 409 instead of a 403 or 404; nothing is written either way. A request that names a resource that doesn’t exist may likewise get a 404 or the 409.
This rule applies to hubs, pages, products, spaces, playlists, playlist items, playlist attachments, files, folders, attachments, report reasons, email templates, hub events, comments, /contact-auth/me and /portal/hubs/{hub_id}/me/profile (the id is your contact id), contact-attribute definitions and options, contacts, coupons, access rules and overrides, automations, page sections, hub price and product displays, product prices, segments, tags, discussions, moderation reports, transcription settings (the id is the team id), conversations, messages, achievements, drip campaigns and drip steps.
On routes whose resource id isn’t in the URL, send the id the response gives you:
Some alpha endpoints still accept flat request bodies or return flat token bodies. Check the generated OpenAPI page for the exact endpoint before building a client.
Errors
Errors return an errors array. Each error has an HTTP status string, title, detail, optional code, and optional source pointer.