Connections are the services Svanja works with for you, like GitHub, Google Drive, or your own API. You can manage them in Connections, or use these endpoints to check a connection’s health and read or write in a connected service from your own code. Reading requires the Connections area, which is included in Full access and Read-only. Making changes requires Full access or Connections set to Read and write, and every write to another service waits for someone to approve it. For more details, see Connections.
GET /connections lists your connections along with their health status, and GET /connections/{id} returns a single connection and the operations it supports. To start a new connection, send POST /connections with a provider, which requires approval in the app first. If the service requires a sign-in, the response includes a link to finish signing in through a browser. A Custom API connection returns right away.
Use PATCH /connections/{id} to change a connection’s settings. For everything else, send POST /connections/{id}/actions with action set to read, write, check, or disconnect. Writing to a connected service takes three steps:
- Prepare the exact write with
POST /authorization-requests, using theconnection.actionoperation and the sameinputyou plan to send. - Have a person approve the request in the app using the
approval_url. - Send the write along with the
authorization_request_id.
See The REST API for more on the API, or use svanja connection if you are working from a terminal.