AI Document Renaming with Custom Instructions
Tell the AI what you want in plain English. It reads document content, understands meaning, and applies your logic - things regex could never do.
- Natural language instructions - not rigid patterns
- Semantic extraction - reads vendors, amounts, dates from content
- Conditional logic - "if amount > $10k, prefix HIGH-VALUE"
- 20+ languages - reads German, outputs English filenames
Just need to rename a few files? Use the free web tool
Your instruction: "Read document in any language. Extract vendor, invoice number, amount. If amount > 10000 EUR, prefix HIGH-VALUE. Route to Invoices/Vendor/Year, add /priority if marked urgent."
Input
PDF containing: "Mueller GmbH... Rechnungsnummer: INV-98234... Gesamtbetrag: 12.450,00 EUR... DRINGEND"
AI Output
Authentication
All API requests require authentication via Bearer token in the Authorization header.
API Token (recommended)
Generate API tokens from Settings → API Tokens. Tokens are prefixed with rt_ and provide full access to your account.
Authorization: Bearer rt_abc123def456...OAuth 2.0
For apps that authenticate on behalf of users, use OAuth 2.0. After the OAuth flow completes, you receive an access token that works the same way:
Authorization: Bearer <oauth_access_token>See API documentation for OAuth client registration and flow details.
Why AI instructions beat regex
Regex transforms filenames. AI reads documents and understands content.
Input:
scan_001.pdf
Pattern:
s/scan_(\\d+)/document_$1/
Output:
document_001.pdf
- Cannot read document content
- Cannot extract vendor, amount, date
- Cannot apply conditional logic
- Cannot understand multiple languages
Input:
scan_001.pdf
(German invoice, 12,450 EUR)
Instruction:
"Extract vendor + amount, prefix HIGH-VALUE if >10k"
Output:
HIGH-VALUE_2025-01-15_Mueller-GmbH_INV-98234.pdf
- Reads and understands document content
- Extracts entities: vendors, amounts, dates, IDs
- Applies conditional logic from natural language
- Works with 20+ languages, outputs in your choice
Quickstart
Two endpoints: upload a file directly, or pass a URL and we'll fetch it. Use strategy=follow_custom_prompt with customTemplate to give the AI your instructions.
POST /api/v1/rename - multipart file upload
curl -X POST https://www.renamed.to/api/v1/rename \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -F "file=@invoice.pdf" \ -F "strategy=follow_custom_prompt" \ -F "templateMode=custom" \ -F 'customTemplate=Extract vendor name and invoice number.If total amount exceeds $10,000, prefix with HIGH-VALUE_.Format: [prefix]YYYY-MM-DD_VendorName_INV-Number' \ -F "language=en"POST /api/v1/rename-from-url - JSON body, server fetches the file
curl -X POST https://www.renamed.to/api/v1/rename-from-url \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/document.pdf", "strategy": "follow_custom_prompt", "templateMode": "custom", "customTemplate": "Identify document type (contract/invoice/receipt).\nFor contracts include parties and effective date.\nFor invoices include vendor and amount.", "language": "en" }'SDKs
Use our official SDKs for a better developer experience with type safety and error handling.
TypeScript SDK
import { RenamedClient } from '@renamed/sdk'const client = new RenamedClient({ apiKey: process.env.RENAMED_API_KEY })// AI reads the German invoice, understands it, creates English filenameconst result = await client.rename('./rechnung_001.pdf', { strategy: 'follow_custom_prompt', templateMode: 'custom', customTemplate: `Read document in any language, output English filename.Extract: vendor, invoice number, total amount.If amount > 10000 EUR, prefix with HIGH-VALUE_`, language: 'en'})console.log(result.suggestedFilename)// => "HIGH-VALUE_2025-01-15_Mueller-GmbH_INV-98234.pdf"console.log(result.folderPath)// => "Invoices/Mueller-GmbH/2025"Response
{ "originalFilename": "rechnung_001.pdf", "suggestedFilename": "HIGH-VALUE_2025-01-15_Mueller-GmbH_INV-98234.pdf", "extractedInfo": { "date": "2025-01-15", "issuer": "Mueller GmbH", "invoice_number": "INV-98234", "document_type": "invoice" }, "folderPath": "Invoices/Mueller-GmbH/2025", "organizationStrategy": "follow_custom_prompt", "templateUsed": "custom"}SDKs on GitHub: github.com/renamed-to/renamed-sdk
API Parameters
Key parameters for controlling the AI's behavior.
| Parameter | Values | Description |
|---|---|---|
strategy | follow_custom_prompt by_date, by_issuer, by_type by_date_issuer, by_date_type by_issuer_type, by_all, root | Use follow_custom_prompt for AI instructions via customTemplate |
templateMode | auto, predefined, custom | Set to custom when using customTemplate |
customTemplate | string | Natural language instructions for the AI |
language | auto, source, en, de, fr, es it, pt, pt-BR, nl, pl, sv no, da, fi, cs, tr, zh-Hans zh-Hant, ja, ko, ar, hi, id | Output filename language. auto detects, source uses document language |
What your instructions can do
The AI interprets natural language and applies complex logic that would require custom code to build yourself.
- Custom extraction + conditional logic
"Extract vendor name and invoice number. If total amount is over $10,000, prefix with HIGH-VALUE_. Format: [prefix]YYYY-MM-DD_VendorName_INV-Number"- Document type detection
"Identify document type (contract, invoice, receipt, statement). For contracts, include parties and effective date. For invoices, include vendor and amount."- Smart folder routing
- Use predefined strategies like
by_date_issuerorby_allto organize files into folder hierarchies based on extracted data. - Multilingual understanding
"Read document in any language. Extract key info. Output filename in English."- Relationship detection
"If this appears to be a response or amendment to another document, include RE_ or AMD_ prefix and reference the original document number if mentioned"
Built for production
Limits
- File size: 25MB max
- Formats: PDF only
- Rate limit: 10,000/day per user
- Response time: 3-10 seconds typical
Common errors
401Invalid or missing API key402Insufficient credits413File too large (over 25MB)415Unsupported file type (must be PDF)429Rate limited (checkRetry-Afterheader)
Security: All requests over TLS. The /rename-from-url endpoint blocks localhost and private IP ranges.
Pricing
50 free credits on signup. Then $9 per 1,000 documents ($0.009/file).
- 1 credit = 1 rename
- Credits valid for 12 months
- 30-day money-back guarantee
Getting started
Three steps to integrate the Renamer API into your workflow.
Try in the API Playground
Test your instructions interactively before writing code.
Get your API token
Generate an API token from your dashboard. You get 50 free credits on signup.
FAQ
- How is this different from regex-based renaming?
- Regex operates on existing filenames. This API reads document content and understands meaning. It can extract vendor names from letterheads, detect document types, apply conditional logic based on amounts, and route files intelligently - tasks impossible with pattern matching.
- What can I put in customTemplate instructions?
- Natural language instructions describing what you want. Examples: "Extract vendor and invoice number, prefix HIGH-VALUE if over $10k", "Detect document type and include parties involved for contracts", "Read any language, output English filename with topic and date".
- What file formats are supported?
- PDF files up to 25MB. The AI understands content in 20+ languages.
- How accurate is the AI understanding?
- 95%+ accuracy on standard business documents. The AI reads and comprehends document structure, extracts entities (names, dates, amounts, IDs), and applies your instructions contextually.
- What are the rate limits?
- 10,000 renames per 24 hours per user. If exceeded, the API returns 429 with Retry-After and X-RateLimit headers.
- How does pricing work?
- 50 free credits on signup. Then $9 per 1,000 documents ($0.009/file). 1 credit = 1 rename. Credits are valid for 12 months. 30-day money-back guarantee.