Buttondown Documentation
You can automatically expand certain fields in Buttondown's API by passing the expand
query parameter. This is useful when you want to retrieve related objects in a single request, rather than making multiple requests to fetch them individually. (If you're familiar with Stripe's expansion concept, it's very similar.)
By default, Buttondown's API only returns the ID of related objects. For example, when you retrieve a comment, you can make a basic API call:
And you'll only see the ID of the subscriber who left the comment:
If you want to see the full subscriber object, you can pass the expand
query parameter:
And you'll see the full subscriber object back alongside the ID:
Some other notes about expansion:
detail
endpoint that only returns a single object, but the same principles apply to list
endpoints that return multiple objects. The only requirement is that the endpoint supports the expanded field; you can check the relevant path to confirm that it does.expand=subscriber&expand=webhook
).