Fauna REST API
Serverless document-relational database with GraphQL
Fauna is a distributed document-relational database delivered as a cloud API. It combines the flexibility of documents with the relational integrity of SQL databases, offering ACID transactions, temporal queries, and native GraphQL support. Developers use Fauna for building modern applications that require global distribution, strong consistency, and serverless scalability without operational overhead.
https://db.fauna.com
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /query/1 | Execute FQL (Fauna Query Language) queries to read and write data |
| POST | / | Execute GraphQL queries and mutations against your schema |
| GET | /databases | List all databases in the current scope, returning name and metadata for each. |
| POST | /databases | Create a new database within the current scope, requires a unique name in the request body. |
| GET | /databases/{name} | Retrieve details about a specific database, including configuration and creation timestamp. |
| DELETE | /databases/{name} | Delete a database and all its contents, requires the database name in the path. |
| GET | /collections | List all collections in the current database, returning names and schema definitions. |
| POST | /collections | Create a new collection with optional schema definition |
| GET | /indexes | List all indexes in the current database, showing terms, values, and source collections. |
| POST | /indexes | Create a new index for efficient querying, specify source collection and indexed terms. |
| GET | /functions | List all user-defined functions in the database, returning names and FQL definitions. |
| POST | /functions | Create a new user-defined function in FQL, requires name and function body. |
| GET | /keys | List all authentication keys in the current scope, showing permissions and creation dates. |
| POST | /keys | Create a new authentication key with specific permissions |
| DELETE | /keys/{id} | Revoke an authentication key, requires the key ID in the path. |
Sponsor this page
AvailableReach developers actively building with Fauna. See live pageview data and self-serve checkout — your slot goes live in minutes.
View inventory & pricing →Code Examples
curl -X POST https://db.fauna.com/query/1 \
-H 'Authorization: Bearer YOUR_FAUNA_SECRET' \
-H 'Content-Type: application/json' \
-d '{
"query": {
"get": {
"ref": {
"collection": "users",
"id": "12345"
}
}
}
}'
Use Fauna from Claude / Cursor / ChatGPT
Get a hosted MCP endpoint for Fauna. Paste your Fauna API key, copy back one URL, drop it into Claude Desktop, Cursor, or any AI client that supports remote MCP. Your AI calls Fauna directly with your credentials — no local install, works on mobile.
fauna_query
Execute FQL queries to read, write, update, or delete documents with full transaction support
fauna_create_document
Create a new document in a specified collection with automatic timestamp tracking
fauna_search_documents
Search documents using indexes with pagination and filtering capabilities
fauna_temporal_query
Query historical data at a specific timestamp or retrieve document history
fauna_manage_schema
Create, update, or delete collections, indexes, and user-defined functions
Connect in 60 seconds
Paste your Fauna key → get an MCP URL → paste into Claude/Cursor. Hosted by IOX, encrypted at rest.
Connect Fauna to your AI →