Publishing through the API
Writing goes through exactly the same gates as the website: the same per-account write budgets, the same moderation, the same webhook events. What the app may not do, your key may not do either.
# een bubbel plaatsen (scope: posts:write)
curl -X POST https://api.debaty.com/v1/posts \
-H "Authorization: Bearer dbty_live_sk_JOUW_SLEUTEL" \
-H "Content-Type: application/json" \
-d '{"body": "Wat kost rekeningrijden een gemiddeld huishouden?"}'
# erop reageren (scope: posts:write)
curl -X POST https://api.debaty.com/v1/posts/POST_ID/comments \
-H "Authorization: Bearer dbty_live_sk_JOUW_SLEUTEL" \
-H "Content-Type: application/json" \
-d '{"body": "Volgens het CPB rond de 240 euro per jaar."}'
# een waardering plaatsen (scope: reactions:write)
curl -X POST https://api.debaty.com/v1/posts/POST_ID/reactions \
-H "Authorization: Bearer dbty_live_sk_JOUW_SLEUTEL" \
-H "Content-Type: application/json" \
-d '{"kind": "well_sourced"}'
# 429? Wacht het aantal seconden uit de Retry-After-header af.
# 403? Dan mist je sleutel de scope — of hebben wij hem tijdelijk
# dichtgezet; de reden staat dan in het antwoord.- 1
Pick the right scope
Posting or replying to a post costs posts:write. An argument in a debate costs debates:write. Reacting (“Agree”, “Well sourced”) is a separate scope: reactions:write. Ask only for what you use — a request outside your scopes gets a 403.
- 2
Publish something
Send your text as JSON to the endpoint for that kind of contribution. You get the contribution back exactly as it appears on the site, including its id. That id is how you will recognise its webhook event later.
- 3
The same limits as in the app
Your contribution travels the moderation pipeline and counts against the write budget of the account you act for — a key does not buy you a second helping. Go too fast and you get a 429 with a Retry-After header; wait it out rather than retrying.
- 4
What the API deliberately cannot do
Sending direct messages and voting on a proposition are not possible, and will stay that way. A one-to-one conversation and a personal position are not things you hand to software.
