Skip to main content

Welcome to the Midday API

Midday provides two API options to integrate with your platform:
  1. REST API - Standard HTTP endpoints for external integrations
  2. tRPC API - Type-safe RPC for TypeScript applications
Both APIs provide access to the same core functionality including invoicing, time tracking, transactions, documents, and more.

Base URLs

Production REST API
string
https://api.midday.ai
Production tRPC API
string
https://api.midday.ai/trpc

API Architecture

REST API

The REST API follows OpenAPI 3.1.0 specification and is available at https://api.midday.ai. All REST endpoints use standard HTTP methods:
  • GET - Retrieve resources
  • POST - Create new resources
  • PUT - Update existing resources
  • DELETE - Remove resources
  • PATCH - Partially update resources
View the interactive API reference at https://api.midday.ai powered by Scalar.

tRPC API

The tRPC API provides end-to-end type safety for TypeScript applications. It’s available at https://api.midday.ai/trpc and uses JSON-RPC protocol.
import { createTRPCProxyClient, httpBatchLink } from '@trpc/client';
import type { AppRouter } from '@midday/api';

const client = createTRPCProxyClient<AppRouter>({
  links: [
    httpBatchLink({
      url: 'https://api.midday.ai/trpc',
      headers: {
        Authorization: `Bearer ${process.env.MIDDAY_API_KEY}`,
      },
    }),
  ],
});

// Type-safe API calls
const transactions = await client.transactions.get.query();

Request Format

REST API

All REST requests must include:
  • Content-Type: application/json header for POST/PUT/PATCH requests
  • Authorization: Bearer <token> header for authentication
curl https://api.midday.ai/transactions \
  -H "Authorization: Bearer mid_your_api_key_here" \
  -H "Content-Type: application/json"

tRPC API

TRPC requests use JSON-RPC format. When using the tRPC client, this is handled automatically.

Response Format

All API responses use JSON format.

Success Response

{
  "data": {
    "id": "trans_123",
    "amount": 1000,
    "currency": "USD"
  }
}

Error Response

{
  "error": "Unauthorized",
  "description": "Invalid API key"
}

Available Resources

The Midday API provides access to the following resources:

Transactions

Manage financial transactions and categorization

Invoices

Create, update, and manage invoices

Customers

Manage customer information

Documents

Upload and manage documents

Bank Accounts

Access bank account information

Time Tracking

Track time entries and projects

Reports

Generate financial reports and insights

Teams

Manage team settings and members

CORS Support

The API supports Cross-Origin Resource Sharing (CORS) for allowed origins. Allowed origins are configured via the ALLOWED_API_ORIGINS environment variable. Supported headers:
  • Authorization
  • Content-Type
  • User-Agent
  • x-request-id
  • x-user-locale
  • x-user-timezone
  • x-user-country

Health Checks

The API provides health check endpoints for monitoring:
curl https://api.midday.ai/health

API Versioning

The Midday API is currently at version 0.0.1 and is subject to change. Breaking changes will be communicated in advance.
Current version: 0.0.1

Next Steps

Authentication

Learn how to authenticate your API requests

Rate Limits

Understand rate limiting policies

Build docs developers (and LLMs) love