.do
Integration

apis

Unified API gateway for all services and integrations

apis

Unified API gateway providing REST, GraphQL, and RPC endpoints for all services with automatic authentication, rate limiting, and versioning.

Overview

The APIs primitive provides a centralized gateway for accessing all platform services through REST, GraphQL, or RPC protocols with built-in security, monitoring, and developer tools.

Quick Example

import { apis } from 'sdk.do'

// Define API endpoint
apis.define('/orders', {
  get: async (req) => {
    return await db.list('orders', { userId: req.user.id })
  },
  post: async (req) => {
    return await db.create('orders', req.body)
  },
})

// Call API
const orders = await apis.get('/orders', { userId: '123' })

Core Capabilities

  • Multi-Protocol - REST, GraphQL, RPC, and WebSocket support
  • Auto-Generated Docs - OpenAPI/Swagger documentation from code
  • Authentication - Built-in auth with API keys, OAuth, JWT
  • Rate Limiting - Configurable rate limits per endpoint/user
  • Versioning - API version management and deprecation

Access Methods

SDK

TypeScript/JavaScript library for API management

await apis.define('/orders', { get: async (req) => db.list('orders') })

SDK Documentation

CLI

Command-line tool for API operations

do api define /orders --method GET --handler "db.list('orders')"

CLI Documentation

API

REST/RPC endpoints for API gateway management

curl -X POST https://api.do/v1/apis -d '{"path":"/orders","method":"GET"}'

API Documentation

MCP

Model Context Protocol for AI-driven API creation

Create a GET endpoint at /orders that lists all orders from the database

MCP Documentation

  • rpc - Remote procedure calls
  • webhooks - HTTP callbacks
  • oauth - API authentication