Data Access

Overview

Understand the Monospace API structure, endpoints, and response format.

Access the API

Every Monospace project exposes a REST API for reading and writing data. The base URL follows this pattern:

https://{your-instance}/api/{project}/items/{collection}

Fetch all articles from the blog project:

import { createClient } from './generated/monospace';

const client = createClient({
  url: 'https://example.monospace.io',
  project: 'blog',
  apiKey: 'YOUR_API_KEY',
});

const articles = await client.Articles.readMany({
  fields: ['*'],
});

Understand the URL Structure

Each segment of the URL targets a specific resource.

SegmentExampleDescription
Instance URLhttps://example.monospace.ioYour Monospace deployment
API path/apiFixed prefix for all API requests
Project slug/blogIdentifies which project to query
Items path/itemsFixed prefix for collection data
Collection/articlesThe collection you are accessing
Item ID/7Optional — targets a single item

The table below maps each CRUD operation to its HTTP method and URL pattern.

OperationMethodURL PatternDescription
List itemsGET/api/{project}/items/{collection}Retrieve all items in a collection
Get single itemGET/api/{project}/items/{collection}/{id}Retrieve one item by its primary key
Create itemsPOST/api/{project}/items/{collection}Create one or more items
Update single itemPATCH/api/{project}/items/{collection}/{id}Update an existing item by ID
Update many itemsPATCH/api/{project}/items/{collection}Update items matching a filter
Delete single itemDELETE/api/{project}/items/{collection}/{id}Remove an item by ID
Delete many itemsDELETE/api/{project}/items/{collection}Remove items matching a filter

Read the Response Format

All responses are wrapped in a { data } envelope. List endpoints return an array inside data:

response.json
{
  "data": [
    { "id": 1, "title": "Getting Started with Monospace", "author": "alice" },
    { "id": 2, "title": "Data Modeling Best Practices", "author": "bob" }
  ]
}

Single-item endpoints return an object inside data:

response.json
{
  "data": {
    "id": 1,
    "title": "Getting Started with Monospace",
    "author": "alice"
  }
}
The SDK unwraps the { data } envelope automatically. See Client Setup for details.
The SDK provides typed methods for every REST endpoint documented here. See the Client SDK Reference for method signatures, type inference, and setup.
Copyright © 2026