API Reference

OpenOfficeAI lets you create spreadsheets and documents with a single API call. You get back a shareable URL that opens a full editor in the browser. No SDK needed — just HTTP.

Base URL

https://openofficeai.com

Quick Start

Create a spreadsheet in 3 steps:

1. Get an API key

Sign up at /signup, then go to Dashboard and generate an API key.

2. Create a spreadsheet

curl -X POST https://openofficeai.com/api/v1/sheets \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "My First Sheet",
    "sheets": [{
      "rows": [
        ["Name", "Email", "Role"],
        ["Arjav Jain", "arjav@example.com", "Founder"],
        ["Vaibhav Jain", "vaibhav@example.com", "Co-founder"]
      ]
    }]
  }'

3. Open the link

The response includes a url field. Open it in a browser — full spreadsheet editor, instantly shareable.

{
  "id": "x7k2m9p3",
  "url": "https://openofficeai.com/s/x7k2m9p3",
  "type": "sheet",
  "title": "My First Sheet",
  "edit_token": "tok_...",
  "created_at": "2026-03-24T10:00:00.000Z"
}

Authentication

All write operations (POST, PUT, DELETE) require a Bearer token. GET requests are public and free.

Authorization: Bearer YOUR_API_KEY

Generate API keys from your Dashboard under the API Keys tab.

Create a Spreadsheet

POST
/api/v1/sheets

Creates a new spreadsheet with optional pre-filled data. Returns a shareable URL.

Request Body

title
string

Title shown in the editor tab and dashboard. Defaults to "Untitled Spreadsheet".

sheets
array

Array of sheet objects. Each sheet becomes a tab in the spreadsheet.

sheets[].name
string

Tab name (e.g. "Revenue", "Q1 Data"). Defaults to "Sheet1".

sheets[].rows
array

Simple 2D array. First row is typically headers. Each inner array is one row. Values can be strings, numbers, or booleans.

sheets[].cells
object

Cell-by-cell data keyed by cell reference (e.g. "A1", "B2"). Use this instead of rows when you need formatting or formulas. See next section.

Example — Simple rows

curl -X POST https://openofficeai.com/api/v1/sheets \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Sales Report Q1",
    "sheets": [
      {
        "name": "Revenue",
        "rows": [
          ["Product", "Revenue", "Units Sold"],
          ["Widget A", 50000, 1200],
          ["Widget B", 32000, 800],
          ["Widget C", 78000, 2100]
        ]
      },
      {
        "name": "Costs",
        "rows": [
          ["Category", "Amount"],
          ["Marketing", 12000],
          ["Engineering", 45000]
        ]
      }
    ]
  }'

Response

{
  "id": "x7k2m9p3",
  "type": "sheet",
  "title": "Sales Report Q1",
  "url": "https://openofficeai.com/s/x7k2m9p3",
  "edit_token": "tok_NEwHxoaxrJ1bILIa...",
  "created_at": "2026-03-24T10:00:00.000Z"
}

Formatting & Formulas

POST

Use the cells object instead of rows for per-cell control. Keys are cell references like "A1", "B2", etc.

Cell Properties

value
string | number

The cell value.

formula
string

Excel-style formula. Must start with = (e.g. "=SUM(B2:B10)", "=A1*1.1"). Supports 400+ functions.

bold
boolean

Bold the cell text.

italic
boolean

Italicize the cell text.

fontSize
number

Font size in points (e.g. 14).

fontColor
string

Text color as hex (e.g. "#ff0000" for red).

bgColor
string

Background color as hex (e.g. "#f0f0f0" for light gray).

Example

curl -X POST https://openofficeai.com/api/v1/sheets \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Budget Calculator",
    "sheets": [{
      "name": "Summary",
      "cells": {
        "A1": { "value": "Category", "bold": true, "bgColor": "#1e1e1e", "fontColor": "#ffffff" },
        "B1": { "value": "Budget", "bold": true, "bgColor": "#1e1e1e", "fontColor": "#ffffff" },
        "C1": { "value": "Actual", "bold": true, "bgColor": "#1e1e1e", "fontColor": "#ffffff" },
        "D1": { "value": "Diff", "bold": true, "bgColor": "#1e1e1e", "fontColor": "#ffffff" },
        "A2": { "value": "Marketing" },
        "B2": { "value": 15000 },
        "C2": { "value": 12300 },
        "D2": { "formula": "=B2-C2" },
        "A3": { "value": "Engineering" },
        "B3": { "value": 50000 },
        "C3": { "value": 48700 },
        "D3": { "formula": "=B3-C3" },
        "A4": { "value": "Total", "bold": true },
        "B4": { "formula": "=SUM(B2:B3)", "bold": true },
        "C4": { "formula": "=SUM(C2:C3)", "bold": true },
        "D4": { "formula": "=B4-C4", "bold": true, "fontColor": "#10b981" }
      }
    }]
  }'

Create a Document

POST
/api/v1/docs

Creates a rich text document with headings, paragraphs, and formatting.

Content Block Properties

type
stringrequired

"heading" or "paragraph". Determines how the block is rendered.

text
stringrequired

The text content of the block.

level
number

Heading level from 1 (largest) to 5 (smallest). Only applies when type is "heading".

bold
boolean

Bold the entire block.

italic
boolean

Italicize the entire block.

color
string

Text color as hex.

Example

curl -X POST https://openofficeai.com/api/v1/docs \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Project Brief",
    "content": [
      { "type": "heading", "level": 1, "text": "Project Brief: OpenOfficeAI" },
      { "type": "heading", "level": 2, "text": "Overview" },
      { "type": "paragraph", "text": "OpenOfficeAI is an API-first document platform that lets developers and AI agents create spreadsheets and documents programmatically." },
      { "type": "heading", "level": 2, "text": "Goals" },
      { "type": "paragraph", "text": "1. Launch public beta by end of March" },
      { "type": "paragraph", "text": "2. Reach 500 API keys in first month" },
      { "type": "paragraph", "text": "3. Achieve $2k MRR by Q2" },
      { "type": "heading", "level": 2, "text": "Timeline" },
      { "type": "paragraph", "text": "Week 1: API docs + SDK. Week 2: Stripe billing. Week 3: Product Hunt launch." }
    ]
  }'

Get a Document

GET
/api/v1/sheets/:idor/api/v1/docs/:id

Retrieve a document by ID. Returns the full data. No authentication required — anyone with the ID can read it.

curl https://openofficeai.com/api/v1/sheets/x7k2m9p3

Update a Document

PUT
/api/v1/sheets/:idor/api/v1/docs/:id

Replace the document data. Requires authentication. The data field should contain the full Univer snapshot object (the same format returned by GET).

curl -X PUT https://openofficeai.com/api/v1/sheets/x7k2m9p3 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "data": { ... } }'

Delete a Document

DELETE
/api/v1/sheets/:idor/api/v1/docs/:id

Permanently delete a document. Requires authentication. This cannot be undone.

curl -X DELETE https://openofficeai.com/api/v1/sheets/x7k2m9p3 \
  -H "Authorization: Bearer YOUR_API_KEY"

Download / Export

GET
/api/v1/download/:id?format=FORMAT

Export a document in various formats. No authentication required.

Spreadsheet Formats

xlsx — Excel workbook

csv — Comma-separated values

html — HTML table

json — Raw JSON snapshot

Document Formats

pdf — PDF document

docx — Word document

txt — Plain text

json — Raw JSON snapshot

# Download spreadsheet as Excel
curl -O https://openofficeai.com/api/v1/download/x7k2m9p3?format=xlsx

# Download document as PDF
curl -O https://openofficeai.com/api/v1/download/p3n8q2w1?format=pdf

Sharing & Permissions

Viewing: Anyone with the document URL can view it. No account needed. The URL format is /s/:id for sheets and /d/:id for docs.

Editing: Requires a signed-in account. Anonymous visitors see a "Sign in to edit" button. Edits auto-save every 2 seconds.

API access: GET requests are public. POST/PUT/DELETE require a valid API key via the Authorization header.

Rate Limits

API calls are counted per user per month. GET requests are free and unlimited. Usage resets on the 1st of each month.

PlanPriceAPI Calls / monthDocumentsOverage
Free$050025Blocked
Pro$12/mo25,000Unlimited$0.002/call
Scale$49/mo200,000Unlimited$0.001/call

When you hit the limit, the API returns 429 Too Many Requests. Existing documents remain accessible.

Error Responses

All errors return JSON with an error field.

StatusMeaningBody
400Bad request — invalid JSON or missing fields{"error": "Invalid request"}
401Missing or invalid API key{"error": "Authentication required"}
404Document not found{"error": "Not found"}
429Rate limit exceeded{"error": "API call limit reached..."}