SurrealDB

SurrealDB HTTP API

The HTTP endpoints enable simple selection and modifications of all records or a single record in a table, in addition to support for custom SurrealQL queries…

Data & analytics#openapi

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

The HTTP endpoints enable simple selection and modifications of all records or a single record in a table, in addition to support for custom SurrealQL queries with multiple statements, using traditional RESTful HTTP url endpoints.

Endpoints 16

status

  • GETFetch the status of a SurrealDB server/statusChecks the connection status of a local or remote SurrealDB server.
  • GETFetch the health of a SurrealDB server/healthChecks the health status of a local or remote SurrealDB server and storage engine.
  • GETFetch the version of a SurrealDB server/versionReturns the version of a local or remote SurrealDB database server.

import

  • POSTImport SurrealQL data into SurrealDB/importImports SurrealQL data into a local or remote SurrealDB server.

export

  • GETExport SurrealQL data from SurrealDB/exportExports SurrealQL data from a local or remote SurrealDB server.

table

  • GETSelect all records from a table/key/:tableThis HTTP RESTful endpoint selects all records from a specific table in the database. It is equivalent to running: SELECT * FROM type::table($table);
  • PUTUpdate all records in a table/key/:tableThis HTTP RESTful endpoint updates all records in a specific table in the database. It replaces the record content with the supplied request data, and is…
  • POSTCreate a new record in a table/key/:tableThis HTTP RESTful endpoint creates a record in a specific table in the database. The supplied request body is used as the content of the record, and is…
  • DELETEDelete all records from a table/key/:tableThis HTTP RESTful endpoint deletes all records from a specific table in the database. It is equivalent to running: DELETE type::table($table);
  • PATCHUpdate all records in a table/key/:tableThis HTTP RESTful endpoint updates all records in a specific table in the database. It merges the supplied request data with the records in the table, and is…

record

  • GETSelect a specific record from a table/key/:table/:idThis HTTP RESTful endpoint selects a specific record from a table in the database. It is equivalent to running: SELECT * FROM type::thing($table, $id);
  • PUTUpdate a specific record in a table/key/:table/:idThis HTTP RESTful endpoint updates a specific record in a table in the database. The supplied request body is used as the content of the record, and is…
  • POSTCreate a specific record in a table/key/:table/:idThis HTTP RESTful endpoint creates a specific record in a table in the database. The supplied request body is used as the content of the record, and is…
  • DELETEDelete a specific record from a table/key/:table/:idThis HTTP RESTful endpoint deletes a specific record from a table in the database. It is equivalent to running: DELETE type::thing($table, $id);
  • PATCHUpdate a specific record in a table/key/:table/:idThis HTTP RESTful endpoint updates a specific record in a table in the database. It merges the supplied request data with the records in the table, and is…

sql

  • POSTRun SurrealQL queries against SurrealDB/sqlThe SQL endpoint enables running advanced SurrealQL queries. This HTTP endpoint expects the HTTP body to be one or more SurrealQL statements, separated by a…

API details

Authentication
None declared in the description
Operations
16 operations on 8 pathsGET 6POST 4PUT 2PATCH 2DELETE 2
Main resources
record 5table 5status 3export 1import 1sql 1
Response formats
application/json text/plain
Description format
OpenAPI 3.0.3, API version 1.0.0

How to test the SurrealDB HTTP API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the SurrealDB HTTP API collection, without the publisher's secrets.
  3. Add your credentialsOpen the collection's variables or an environment and enter your API key or token, if the API needs one.
  4. Send a requestPick an endpoint, for example “Fetch the status of a SurrealDB server” (GET /status), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the SurrealDB HTTP API?

The HTTP endpoints enable simple selection and modifications of all records or a single record in a table, in addition to support for custom SurrealQL queries… It is listed under Data & analytics and has 16 endpoints.

Who publishes the SurrealDB HTTP API?

It is listed from SurrealDB's public API description (an OpenAPI document), not published by SurrealDB on Swastik Codes. Anyone who controls surrealdb.com can claim the profile by adding a DNS TXT record.

How do I authenticate with the SurrealDB HTTP API?

Its OpenAPI description does not declare an authentication scheme. Some endpoints may be open; check the provider's documentation before relying on that.

How many endpoints does the SurrealDB HTTP API have?

16 operations on 8 paths (6 GET, 4 POST, 2 PUT, 2 PATCH, 2 DELETE). The largest groups are record, table, status, export.

Is forking the SurrealDB HTTP API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.