Skip to main content

Welcome to Agent Office API

Agent Office API allows you to programmatically edit Microsoft Word and PDF documents using AI. Upload documents, apply edits via natural language instructions, and download the modified files.

Base URL

All API requests should be made to:
https://api.agentoffice.dev

Authentication

All API endpoints require authentication using a Bearer token. You can generate API keys from your Agent Office Dashboard.
Keep your API keys secure and never share them publicly. API keys should be stored as environment variables.

Using Your API Key

Include your API key in the Authorization header of every request:
Authorization: Bearer YOUR_API_KEY

Example Authentication

const response = await fetch("https://api.agentoffice.dev/v1/documents/", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_KEY",
    "Content-Type": "multipart/form-data",
  },
  body: formData,
});

Request Latency

Most document edits complete in under 5 seconds. Response times vary based on document complexity and edit instructions.
Pro and Enterprise users benefit from dedicated infrastructure with faster request processing and priority queue handling for optimal performance.
You can monitor your request performance under usage.

Error Handling

The API uses standard HTTP status codes:
Status CodeDescription
200Success
400Bad Request - Check your request parameters
401Unauthorized - Invalid or missing API key
403Forbidden - API key doesn’t have access
404Not Found - Resource doesn’t exist
422Validation Error - Request body validation failed
500Server Error - Something went wrong on our end

API Workflow

  1. Upload Document - Upload a Word (.docx) or PDF file to create a document
  2. Apply Edits - Send natural language instructions to edit the document
  3. Download Result - Get a presigned URL to download the edited document
Documents are automatically stored for 1 hour (configurable) and the TTL is refreshed after each edit.

Supported File Types

  • Microsoft Word (.docx)
  • PDF (.pdf)
  • Maximum file size: 10MB

Getting Started

Ready to start? Check out our endpoint documentation:
I