• Start

Languages

/

Mojo

/

Methods

api

The api() method for the SurrealDB Mojo SDK calls a custom API handler defined on the database.

Calls a custom API handler defined on the database with DEFINE API.

Method Syntax

client.api(path, method, session, txn)
ArgumentDescription
pathThe API path to call.
methodThe HTTP method. Defaults to "GET".
sessionAn optional session id.
txnAn optional transaction id.
var resp = client.api("/users", "GET")

Was this page helpful?