Note that if you ever want to see an example of how parts of the API work, you can just pop open the Network Inspector on your browser and watch what API requests are made when using Flarum's default client (e.g. here on discuss.flarum.org or on your own setup). For example, the request that made this post was:
POST https://discuss.flarum.org/api/posts
{"data":{"type":"posts","attributes":{"content":"Note that if you ever want to see an example of how parts of the API work, you can just pop open the Network Inspector on your browser and watch what API requests are made when using Flarum's default client (e.g. here on discuss.flarum.org or on your own setup)."},"relationships":{"discussion":{"data":{"type":"discussions","id":"2011"}}}}}