HTTP API
Question (sorry if I miss something obvious in the documentation again): is it possible to expose an action or mutation as an API endpoint that I can call programmatically? Let's say that I have a really long running task that runs on a different backend and I don't want to
await
on it from the action
. I found API for Airbyte https://docs.convex.dev/http-api/ is that my best bet?Convex HTTP API | Convex Developer Hub
Connecting to Convex directly with HTTP
6 Replies
Good point, we should document the HTTP endpoints more directly. If you're in js/typescript, you can call queries/mutations from ConvexHttpClient https://docs.convex.dev/api/modules/browser
Module: browser | Convex Developer Hub
Tools for accessing Convex in the browser.
There is also a python client https://pypi.org/project/convex/
Oh python is perfect. Thank you!
Would be even better if you have a golang one 🙂
We don't have an official client in golang (yet) but you can hack it together yourself if you're feeling ambitious. Like this https://github.com/gautamg795/convex-golink/blob/main/convex.go
GitHub
convex-golink/convex.go at main · gautamg795/convex-golink
A private shortlink service for tailnets. Contribute to gautamg795/convex-golink development by creating an account on GitHub.
haha was just about to link that — it's pretty scrappy, but gets the job done
func (c *ConvexDB) mutation
and func (c *ConvexDB) query
are the two important functions theresweet, thanks!