Renamed.to REST API v1
Turn messy uploads into consistent, human-readable filenames with a single API call. Renamed.to reads the file itself (OCR for scans, NLP for text) to extract the right fields, then applies your naming template to return the exact filename you expect—every time. Clean JSON in/out with Bearer token authentication, so you can integrate in minutes.
Rename files from their content, not their existing names.
- Reads the file (OCR for scans) to extract real metadata
- Templates you control: auto, ready-made, or natural-language custom
- Consistent, safe output with characters that work everywhere
- JSON-first REST API with Bearer token authentication
- Optional folder path for smart routing and organization
- Privacy-first defaults that avoid long-term content storage
Get started: 50 free credits for new accounts.
Base URL
Quick Start: Generate an API token in Settings → API Tokens, then make your first request using the examples below.
Getting Started
Get up and running with the Renamed.to REST API in minutes. Follow these steps to make your first API call and start renaming PDF files programmatically.
Create an Account
Sign up for a free account at renamed.to/sign-up. New accounts receive 50 free credits to get started.
Generate an API Token
Navigate to Settings → API Tokens and create a new API token. Tokens are shown only once when created—make sure to save it securely.
Tip: Use descriptive names for your tokens (e.g., "Production Server", "Development") to help manage multiple tokens.
Make Your First Request
Use your API token to authenticate requests. The service will automatically extract metadata from your PDF files. Here's a minimal example:
Note: These are simplified examples for getting started. For production code with comprehensive error handling, retry logic, and validation, see the Error Handling section and the Rename endpoint documentation.
curl -X POST https://www.renamed.to/api/v1/rename \
-H "Authorization: Bearer rt_your_token_here" \
-F file=@invoice.pdfHandle the Response
A successful response includes the generated filename and folder path with extracted metadata:
Common Issues
- Python 415 Error: If using Python, ensure file uploads include filename and content-type (see Python File Upload Requirements)
- 401 Errors: Verify your API token is correct and has necessary permissions
- File Size: Maximum file size is 25 MB for PDF files only
Next Steps
- Read the Authentication section for detailed token management
- Explore the Rename endpoint documentation for advanced options
- Review Error Handling to implement robust error handling
- Check out Use Case Examples for real-world integration patterns
- See Troubleshooting for solutions to common problems
Need help? Check our documentation or contact support if you run into any issues.
API Versioning
The Renamed.to API uses URL-based versioning to ensure stability and backward compatibility as we evolve the platform.
Current Version
The current API version is v1, accessible at:
https://www.renamed.to/api/v1Versioning Policy
Backward Compatibility
We maintain backward compatibility within each major version. New features and non-breaking changes are added to the current version without requiring code changes in your integration.
Breaking Changes
Breaking changes (removed endpoints, changed response formats, removed fields) will result in a new major version (e.g., v2). When a new major version is released:
- The previous version remains available for at least 12 months
- We provide migration guides and deprecation notices
- Breaking changes are announced at least 90 days in advance
Deprecation Timeline
When a version is deprecated, we follow this timeline:
- 90 days notice: Deprecation announcement with migration guide
- 12 months support: Deprecated version remains functional
- Sunset: Deprecated version is retired after support period
Requesting a Specific Version
The API version is specified in the URL path. Always include the version number in your requests:
https://www.renamed.to/api/v1/rename✓ Current versionhttps://www.renamed.to/api/v2/renameFuture version (not yet available)Version Headers
While versioning is handled via URL path, API responses include version information in headers:
| Header | Description | Example |
|---|---|---|
API-Version | The API version used for the request | v1 |
Staying Up to Date
To stay informed about API changes and version updates:
- Check the Changelog section for recent updates
- Subscribe to our API changelog RSS feed (coming soon)
- Monitor the
API-Versionheader in responses - Follow our status page for API availability and incidents
Note: API v1 is stable and actively maintained. We have no plans to deprecate v1 in the near future. When v2 is released, both versions will be supported simultaneously.
Authentication
Every request must be authenticated using a Bearer token. API tokens are long-lived API keys that provide full access to your account.
Token Format
API tokens are prefixed with rt_ followed by 64 hexadecimal characters. Example: rt_abc123def456...
Getting Your Token
Generate API tokens in the API Tokens section of your settings. Tokens are shown only once when created—make sure to save them securely.
Using Your Token
Include your token in the Authorization header with the Bearer prefix:
curl -X GET https://www.renamed.to/api/v1/user \
-H "Authorization: Bearer rt_your_token_here"Token Permissions
API tokens provide access to all API endpoints, including file renaming, user profile information, credit balance, and team information.
Error Responses
If authentication fails, you'll receive a 401 Unauthorized response:
Token Security
- Store tokens securely—never commit them to version control or expose them in client-side code
- Use environment variables or secure secret management systems
- Rotate tokens regularly by creating new tokens and deleting old ones from Settings → API Tokens
- If a token is compromised, delete it immediately from your settings
Endpoint – Rename a file
POST /api/v1/renameRequest
Upload a PDF file using multipart form-data. The service automatically analyzes the document content to extract metadata (vendor names, dates, invoice numbers, amounts, document types) and generates a descriptive filename.
Request fields:
| Field | Type | Required | Description |
|---|---|---|---|
file | File | Yes | Max 25 MB. PDF files only. The service analyzes the PDF content to extract metadata and generate the filename. |
strategy | string | No | Organization strategy for folder structure. See Organization Strategies section below for details. |
templateMode | string | No | Template selection mode. See Template Modes section below for details. Default: auto. |
templateId | string | No | Predefined template ID (required when templateMode=predefined). |
customTemplate | string | No | AI prompt for custom filename generation (required when templateMode=custom). Write natural language instructions describing how filenames should be formatted. Example: "Use format: YYYY-MM-DD_company-name_document-type_number" |
language | string | No | Output language for generated filenames. The service will use the specified language for issuer names and other text. Default: auto. See Language Options section below for all supported languages. |
Language Examples
Here are examples showing how filenames differ based on the language parameter:
// Request
POST /api/v1/rename
language=en
// Result
{
"suggestedFilename": "2025-01-15_AcmeCorp_Invoice_12345.pdf",
"folderPath": "2025/AcmeCorp"
}Common Mistakes
Got code: INVALID_MULTIPART_PAYLOAD?
This error means your request body could not be parsed as multipart/form-data. Common causes:
- Sending JSON body instead of form data (check Content-Type).
- Incorrect field name (must be exactly
file). - Missing filename or content-type in multipart payload (common in Python/Node.js).
- Using a proxy that modifies the request body.
Successful response (200)
The service analyzes your PDF file and returns a response with the generated filename based on extracted metadata:
{
"originalFilename": "invoice.pdf",
"suggestedFilename": "2025-01-15_invoice_1234_acme.pdf",
"folderPath": "2025/AcmeCorp/Invoices"
}Response Fields
originalFilename – The original filename as uploaded.
suggestedFilename – The generated filename with file extension. Created by analyzing the PDF content and extracting metadata like vendor name, date, invoice number, and document type.
folderPath – The suggested folder structure using forward slashes (/) as separators. Examples: 2025/AcmeCorp/Invoices or 2025/Invoices. This field will be an empty string ("") when the organization strategy is root or when no folder structure is needed. Folder names are sanitized to be filesystem-safe (special characters removed, length limited).
Organization Strategies
Organization strategies determine how files are organized into folder structures. The folder path uses forward slashes (/) as separators.
| Strategy | Description | Example Folder Path |
|---|---|---|
by_date | Organize by year | 2025 |
by_issuer | Organize by company/issuer | AcmeCorp |
by_type | Organize by document type | Invoices |
by_date_issuer | Year/Company | 2025/AcmeCorp |
by_date_type | Year/Document Type | 2025/Invoices |
by_issuer_type | Company/Document Type | AcmeCorp/Invoices |
by_all | Year/Company/Document Type | 2025/AcmeCorp/Invoices |
root | No folder structure (flat organization) | "" (empty string) |
follow_custom_prompt | Follow custom template instructions for folder structure | Varies based on custom template |
Template Modes
Template modes control how filenames are generated. Choose the mode that best fits your needs:
auto (Default)
AI automatically selects the best naming pattern based on document content and research-based best practices. Ideal for most use cases.
When to use: General purpose file renaming, when you want professional results without specifying format.
predefined
Use a predefined template with a specific structure. Requires templateId field.
Available templates: standard, date_first, company_first, minimal, detailed, department_focus.
When to use: When you need consistent, structured filenames following a specific pattern.
custom
Provide natural language instructions for filename generation. Requires customTemplate field with your instructions.
Example: "Use format: YYYY-MM-DD_company-name_document-type_number"
When to use: When you need specific formatting that doesn't match predefined templates or want to customize naming rules.
Language Options
Control the language used for generated filenames and folder names. The service will use the specified language for issuer names and other text extracted from documents. Document type names remain in English (e.g., "Invoice", "Receipt"), but company names, vendor names, and other metadata will be formatted in the selected language.
| Code | Language | Notes |
|---|---|---|
auto | Auto-detect | Default |
source | Document's source language | Uses language detected from document |
en | English | — |
de | Deutsch (German) | — |
fr | Français (French) | — |
es | Español (Spanish) | — |
it | Italiano (Italian) | — |
pt | Português (Portuguese) | — |
pt-BR | Português (Brasil) | — |
nl | Nederlands (Dutch) | — |
pl | Polski (Polish) | — |
sv | Svenska (Swedish) | — |
no | Norsk (Norwegian) | — |
da | Dansk (Danish) | — |
fi | Suomi (Finnish) | — |
cs | Čeština (Czech) | — |
tr | Türkçe (Turkish) | — |
zh-Hans | 简体中文 (Simplified Chinese) | — |
zh-Hant | 繁體中文 (Traditional Chinese) | — |
ja | 日本語 (Japanese) | — |
ko | 한국어 (Korean) | — |
ar | العربية (Arabic) | — |
hi | हिन्दी (Hindi) | — |
id | Bahasa Indonesia | — |
Error responses
| Status | Code | Description |
|---|---|---|
| 401 | unauthorized | Missing / invalid credentials or free batch exhausted. |
| 402 | payment_required | Account has 0 credits. |
| 413 | payload_too_large | File exceeds 25 MB limit. |
| 415 | unsupported_media_type | File type not supported. |
| 500 | server_error | Unhandled processing error. |
Error responses follow this format:
Python File Upload Requirements
Important: Python File Upload Format
When using Python's requests library, you must explicitly specify the filename and content-type when uploading files. The server requires this information to properly identify the file type.
Correct:
files = {'file': ('filename.pdf', file_handle, 'application/pdf')}Incorrect (will cause 415 error):
files = {'file': file_handle} # Missing filename and content-typeIf you don't specify the filename and content-type, you'll receive a 415 Unsupported Media Type error with the message: "File type not supported. Only PDF files are accepted."
Code Examples
Production-ready examples with error handling, validation, and timeout support. The service automatically analyzes uploaded PDF files to extract metadata and generate filenames. Choose the example that matches your environment:
Browser vs Node.js: Use browser examples for client-side applications and file uploads from user input. Use Node.js examples for server-side processing, batch operations, and automation scripts.
# Rename a messy invoice file
# The service analyzes the PDF content and extracts metadata (vendor, date, invoice number)
curl -X POST https://www.renamed.to/api/v1/rename \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F file=@"Invoice_scan_IMG_20251215.pdf" \
-F strategy="by_date_issuer" \
-F language="en"
# Response:
# {
# "originalFilename": "Invoice_scan_IMG_20251215.pdf",
# "suggestedFilename": "2025-12-15_invoice_acme_corp_inv-12345.pdf",
# "folderPath": "2025/AcmeCorp/Invoices"
# }
# Use custom AI prompt for filename generation
curl -X POST https://www.renamed.to/api/v1/rename \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F file=@"invoice.pdf" \
-F templateMode="custom" \
-F customTemplate="Use format: YYYY-MM-DD_company-name_document-type_number"Endpoint – Rename a file from URL
POST /api/v1/rename-from-urlRequest
Provide a publicly accessible URL to a PDF file. The service downloads the file, analyzes its content to extract metadata (vendor names, dates, invoice numbers, amounts, document types), and generates a descriptive filename. This endpoint is ideal for automation workflows where files are already hosted online.
Note: This endpoint requires authentication (API token or session). Credits are only deducted after successful processing to avoid charging for failed downloads or invalid files.
Request body (JSON):
| Field | Type | Required | Description |
|---|---|---|---|
fileUrl | string | Yes | Publicly accessible HTTP or HTTPS URL to a PDF file. Max 25 MB. Must not point to localhost or private network addresses. The service downloads and analyzes the PDF content to extract metadata and generate the filename. |
originalFilename | string | No | Optional filename override. If not provided, the filename is derived from the URL pathname. |
strategy | string | No | Organization strategy for folder structure. See Organization Strategies section in the Rename endpoint documentation for details. |
templateMode | string | No | Template selection mode. See Template Modes section in the Rename endpoint documentation for details. Default: auto. |
templateId | string | No | Predefined template ID (required when templateMode=predefined). |
customTemplate | string | No | AI prompt for custom filename generation (required when templateMode=custom). Write natural language instructions describing how filenames should be formatted. Example: "Use format: YYYY-MM-DD_company-name_document-type_number" |
language | string | No | Output language for generated filenames. The service will use the specified language for issuer names and other text. Default: auto. See Language Options section in the Rename endpoint documentation for all supported languages. |
Successful response (200)
The service downloads the PDF file from the provided URL, analyzes its content, and returns a response with the generated filename based on extracted metadata. The response format is identical to the Rename endpoint.
{
"originalFilename": "invoice.pdf",
"suggestedFilename": "2025-01-15_invoice_1234_acme.pdf",
"folderPath": "2025/AcmeCorp/Invoices"
}Error responses
| Status | Code | Description |
|---|---|---|
| 400 | invalid_url | Invalid URL format, URL points to localhost/private network, or URL does not use HTTP/HTTPS. |
| 401 | unauthorized | Missing or invalid credentials. |
| 402 | payment_required | Account has insufficient credits. |
| 413 | payload_too_large | File exceeds 25 MB limit. |
| 415 | unsupported_media_type | File type not supported. Only PDF files are accepted. |
| 429 | rate_limit_exceeded | Daily rename limit exceeded. Check Retry-After header. |
| 502 | bad_gateway | Failed to download file from URL or DNS resolution failed. |
| 500 | server_error | Unhandled processing error. |
Security & URL validation
URL Security Restrictions
For security reasons, the service blocks URLs that point to:
- Localhost addresses (127.0.0.1, ::1, localhost)
- Private network addresses (10.x.x.x, 192.168.x.x, 172.16-31.x.x)
- Link-local addresses (169.254.x.x)
- IPv6 unique local addresses (fc00::/7, fd00::/7)
Only publicly accessible HTTP and HTTPS URLs are accepted. The service performs DNS resolution and IP address validation before downloading files.
Code Examples
Production-ready examples with error handling and validation. The service downloads the PDF from the URL, analyzes its content, and generates a filename:
# Rename a PDF file from a public URL
curl -X POST https://www.renamed.to/api/v1/rename-from-url \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"fileUrl": "https://example.com/invoices/invoice_2025.pdf",
"strategy": "by_date_issuer",
"language": "en"
}'Use Cases
Automation Workflows: Integrate with Zapier, Make, or n8n to automatically rename files from cloud storage URLs or webhook payloads.
Batch Processing: Process multiple files from a list of URLs without manually downloading and uploading each file.
Webhook Integration: Receive file URLs from external services and rename them automatically as part of your workflow.
Cloud Storage: Rename files that are already stored in S3, Google Cloud Storage, or other cloud providers by providing their public URLs.
Endpoint – Get user profile
GET /api/v1/userDescription
Returns basic profile information for the authenticated user (the user to which the API token belongs), including id, email, and name.
Successful response (200)
{
"id": "user_123",
"email": "user@example.com",
"name": "John Doe"
}Error responses
| Status | Description |
|---|---|
| 401 | Unauthorized – missing or invalid credentials. |
| 404 | User not found. |
| 500 | Internal server error. |
Code Examples
curl -X GET https://www.renamed.to/api/v1/user \
-H "Authorization: Bearer rt_your_token_here"Endpoint – Get credit balance
GET /api/v1/creditsDescription
Returns the current credit balance for the authenticated user. Credits are consumed when renaming files via the API.
Successful response (200)
{
"credits": 150
}Error responses
| Status | Description |
|---|---|
| 401 | Not authenticated – missing or invalid credentials. |
| 404 | User not found. |
| 500 | Internal server error. |
Code Examples
curl -X GET https://www.renamed.to/api/v1/credits \
-H "Authorization: Bearer rt_your_token_here"Endpoint – Get team information
GET /api/v1/teamDescription
Returns team information if the authenticated user is part of a team. Returns null if not part of a team.
Note: This endpoint returns null if your account is not part of a team.
Successful response (200)
{
"id": "team_123",
"name": "Acme Corp",
"teamMembers": [
{
"user": {
"id": "user_123",
"name": "John Doe",
"email": "john@example.com"
}
}
]
}Error responses
| Status | Description |
|---|---|
| 401 | Unauthorized – missing or invalid credentials. |
| 500 | Internal server error. |
Code Examples
curl -X GET https://www.renamed.to/api/v1/team \
-H "Authorization: Bearer rt_your_token_here"Use Case Examples
Real-world examples showing how to integrate the Renamed.to API into common workflows. Each example includes complete code samples you can adapt for your needs.
1. Automated Invoice Processing
Process invoices from email attachments or file uploads, automatically organizing them by vendor and date for accounting software integration.
async function processInvoice(file: File) {
const formData = new FormData();
formData.append('file', file);
formData.append('strategy', 'by_date_issuer'); // Organize by year/vendor
formData.append('templateMode', 'predefined');
formData.append('templateId', 'standard'); // YYYY-MM-DD_Vendor_INV-Number.pdf
const response = await fetch('https://www.renamed.to/api/v1/rename', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.RENAMED_TO_API_TOKEN}`
},
body: formData
});
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
const result = await response.json();
// Example result:
// {
// "originalFilename": "invoice.pdf",
// "suggestedFilename": "2025-01-15_AcmeCorp_INV-12345.pdf",
// "folderPath": "2025/AcmeCorp",
// "confidence": 0.96
// }
return result;
}2. Legal Document Organization
Organize legal contracts and discovery documents by matter code, counterparty, and document type for compliance and easy retrieval.
3. Multi-language Filename Generation
Generate filenames in specific languages for international document management. Document types remain in English, but issuer names and other text use the specified language.
async function renameWithLanguage(file: File, language: string) {
const formData = new FormData();
formData.append('file', file);
formData.append('language', language); // 'de', 'fr', 'es', etc.
formData.append('strategy', 'by_date_issuer');
const response = await fetch('https://www.renamed.to/api/v1/rename', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.RENAMED_TO_API_TOKEN}`
},
body: formData
});
const result = await response.json();
// With language='de':
// {
// "originalFilename": "rechnung.pdf",
// "suggestedFilename": "2025-01-15_Musterfirma_Rechnung_12345.pdf",
// "folderPath": "2025/Musterfirma",
// "confidence": 0.95
// }
return result;
}
// Process files for different regions
const files = [
{ file: germanInvoice, language: 'de' },
{ file: frenchInvoice, language: 'fr' },
{ file: spanishInvoice, language: 'es' }
];
for (const { file, language } of files) {
const result = await renameWithLanguage(file, language);
console.log(`Renamed (${language}): ${result.suggestedFilename}`);
}4. Receipt Management for Expense Reports
Automatically rename receipts with date, vendor, and amount for easy expense report preparation and reconciliation.
5. Webhook Integration Pattern
Process files uploaded via webhook from cloud storage services, automatically renaming and organizing them.
Have a specific use case? Check our full documentation or contact support for integration assistance.
Error Handling
The API uses standard HTTP status codes and returns errors in a consistent JSON format. All errors include an error field with a human-readable message.
Standard Error Response Format
All error responses follow this structure:
{
"error": "Error message describing what went wrong"
}HTTP Status Codes
| Status Code | Meaning | Retryable | Example |
|---|---|---|---|
| 400 | Bad Request – Invalid input or malformed request | No | Missing required field, invalid file type |
| 401 | Unauthorized – Missing or invalid authentication | No | Invalid or expired API token |
| 402 | Payment Required – Insufficient credits | No | Account has 0 credits |
| 404 | Not Found – Resource doesn't exist | No | User not found, file not found |
| 413 | Payload Too Large – File exceeds size limit | No | File larger than 25 MB |
| 415 | Unsupported Media Type – Invalid file type | No | Non-PDF file uploaded, or Python requests missing filename/content-type |
| 429 | Too Many Requests – Rate limit exceeded | Yes (with backoff) | Too many requests in time window |
| 500 | Internal Server Error – Server-side error | Yes (with backoff) | Processing failure, external service error |
| 502 | Bad Gateway – External service error | Yes (with backoff) | AI service unavailable, storage service error |
Error Response Examples
{
"error": "No file uploaded."
}Retry Logic
Some errors are transient and can be retried. Follow these guidelines:
Retryable Errors
- 429 (Rate Limited): Retry after the time specified in
Retry-Afterheader orX-RateLimit-Resettimestamp - 500 (Server Error): Retry with exponential backoff (1s, 2s, 4s, 8s, 16s)
- 502 (Bad Gateway): Retry with exponential backoff (1s, 2s, 4s, 8s, 16s)
Non-Retryable Errors
- 400 (Bad Request): Fix the request before retrying
- 401 (Unauthorized): Check authentication credentials
- 402 (Payment Required): Add credits to your account
- 404 (Not Found): Resource doesn't exist, don't retry
- 413 (Payload Too Large): Reduce file size
- 415 (Unsupported Media Type): Use a supported file type (PDF)
Idempotency
API requests are not idempotent by default. Each request consumes credits and processes files. If you need to retry a failed request:
- For 429 (Rate Limited) errors: Wait for the specified time, then retry the same request
- For 500/502 errors: Retry the same request with exponential backoff. Credits are only consumed on successful processing
- For 402 (Insufficient Credits): Add credits before retrying
- Note: If a file processing request fails after credits are deducted, credits are not automatically refunded. Contact support if you believe credits were incorrectly consumed.
Error Handling Best Practices
async function renameFileWithRetry(file: File, maxRetries = 3) {
let lastError: Error | null = null;
for (let attempt = 0; attempt < maxRetries; attempt++) {
try {
const formData = new FormData();
formData.append('file', file);
const response = await fetch('https://www.renamed.to/api/v1/rename', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.RENAMED_TO_TOKEN}`
},
body: formData
});
if (response.ok) {
return await response.json();
}
const error = await response.json();
// Don't retry non-retryable errors
if ([400, 401, 402, 404, 413, 415].includes(response.status)) {
throw new Error(`Non-retryable error: ${error.error}`);
}
// Handle rate limiting
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After');
const waitTime = retryAfter ? parseInt(retryAfter) * 1000 : Math.pow(2, attempt) * 1000;
console.log(`Rate limited. Waiting ${waitTime}ms before retry...`);
await new Promise(resolve => setTimeout(resolve, waitTime));
continue;
}
// Retry server errors with exponential backoff
if ([500, 502].includes(response.status)) {
const waitTime = Math.pow(2, attempt) * 1000; // 1s, 2s, 4s
console.log(`Server error. Waiting ${waitTime}ms before retry...`);
await new Promise(resolve => setTimeout(resolve, waitTime));
continue;
}
throw new Error(`Unexpected error: ${error.error}`);
} catch (error) {
lastError = error instanceof Error ? error : new Error(String(error));
if (attempt === maxRetries - 1) {
throw lastError;
}
}
}
throw lastError || new Error('Max retries exceeded');
}Troubleshooting
Common issues and solutions when working with the Renamed.to API. If you encounter problems not covered here, contact support for assistance.
Common Issues and Solutions
Invalid Multipart Payload (400 Bad Request)
Problem:
Receiving 400 Bad Request with error code INVALID_MULTIPART_PAYLOAD.
Possible Causes:
- Sending JSON payload instead of
multipart/form-data - Using an incorrect field name (must be
file) - Missing filename or content-type in the multipart boundary (common in Python/Node.js)
- Using a proxy or middleware that modifies the request body
Solution:
Ensure your HTTP client is correctly configured to send multipart/form-data. Do not manually set the Content-Type header unless you know the correct boundary string; most clients set this automatically when you provide a file object.
415 Unsupported Media Type (Python)
Problem:
Receiving 415 Unsupported Media Type error when uploading files with Python.
Solution:
Ensure you're including the filename and content-type when uploading files:
import requests
import os
with open('document.pdf', 'rb') as f:
# Include filename and content-type
files = {'file': ('document.pdf', f, 'application/pdf')}
headers = {'Authorization': f'Bearer {os.getenv("RENAMED_TO_TOKEN")}'}
response = requests.post(
'https://www.renamed.to/api/v1/rename',
files=files,
headers=headers
)
response.raise_for_status()See the Python File Upload Requirements section for more details.
401 Unauthorized on User/Credits/Team Endpoints
Problem:
Receiving 401 Unauthorized errors on /api/v1/user, /api/v1/credits, or /api/v1/team endpoints.
Possible Causes:
- Invalid or expired API token
- Missing Authorization header
- Incorrect token format (should be
Bearer <token>) - For team endpoint: Account may not be part of a team (endpoint returns
nullif not in a team)
Solution:
- Verify your API token is correct and not expired
- Ensure the Authorization header is included:
Authorization: Bearer rt_your_token_here - For team endpoint: Verify your account is part of a team (endpoint returns
nullif not in a team, not a 401 error)
File Upload Not Working
Problem:
File uploads fail or return unexpected errors.
Checklist:
- ✅File is a PDF (not other formats)
- ✅File size is under 25 MB
- ✅Using multipart/form-data encoding
- ✅For Python: Including filename and content-type in file upload (see Python File Upload Requirements)
- ✅API token is correct and not expired
- ✅Request includes
Authorization: Bearer <token>header
Rate Limit Errors
Problem:
Receiving 429 Too Many Requests errors.
Solution:
- Wait for the rate limit window to reset (check the Retry-After header)
- Implement exponential backoff in your retry logic
- Consider batching requests or reducing request frequency
- Contact support if you need higher rate limits
See the Error Handling section for retry logic examples.
Insufficient Credits
Problem:
Receiving 402 Payment Required errors, or cloud integration jobs are paused due to insufficient credits.
Solution:
- Check your credit balance using the
/api/v1/creditsendpoint - Purchase additional credits through your account settings
- Automatic retry: For cloud integrations (OneDrive, Dropbox, Google Drive), jobs that were paused due to insufficient credits will automatically resume processing when you add credits. No manual intervention needed.
- Note: Jobs older than 30 days will not be automatically retried. You can manually retry these if needed.
- Monitor credit usage to avoid running out
Still having issues? Contact support with details about your error, including the HTTP status code, error message, and your request details (without sensitive information like API tokens).
Limits & Quotas
The following limits apply to all API requests. Limits are enforced per account and reset on a rolling 24-hour window.
| Limit Type | Value | Notes |
|---|---|---|
| Daily Renames | 10,000 / 24h | Soft limit per account. Contact us for higher limits. |
| File Size | 25 MB | Maximum file size per upload. |
| Concurrent Requests | 20 | Maximum simultaneous requests per account. |
| Rate Limit Burst | 200 / minute | Maximum requests per minute before throttling. |
Rate Limiting
Rate limits use rolling windows, not fixed daily limits. This means limits reset continuously based on when requests are made, not at midnight UTC.
Rate Limit Headers
All API responses include rate limit information in headers. Check these headers to monitor your usage and handle rate limits gracefully:
| Header | Description | Example |
|---|---|---|
X-RateLimit-Limit | Maximum number of requests allowed in the current window | 200 |
X-RateLimit-Remaining | Number of requests remaining in the current window | 150 |
X-RateLimit-Reset | Unix timestamp (milliseconds) when the current rate limit window resets | 1733925600000 |
Retry-After | Number of seconds to wait before retrying (only present on 429 responses) | 60 |
Handling Rate Limits
When you receive a 429 Too Many Requests response:
- Check the
Retry-Afterheader for the number of seconds to wait - Alternatively, calculate wait time from
X-RateLimit-Resettimestamp - Wait for the specified duration before retrying
- Implement exponential backoff if you continue to hit rate limits
Rate Limit Examples
const response = await fetch('https://www.renamed.to/api/v1/rename', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.RENAMED_TO_TOKEN}`
},
body: formData
});
// Read rate limit headers
const limit = response.headers.get('X-RateLimit-Limit');
const remaining = response.headers.get('X-RateLimit-Remaining');
const reset = response.headers.get('X-RateLimit-Reset');
console.log(`Rate limit: ${remaining}/${limit} remaining`);
console.log(`Resets at: ${new Date(parseInt(reset || '0')).toISOString()}`);
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After');
const waitSeconds = retryAfter ? parseInt(retryAfter) : 60;
console.log(`Rate limited. Wait ${waitSeconds} seconds before retrying.`);
}Need higher limits? Contact us to discuss custom rate limits for your use case.
Frequently Asked Questions
Common questions about the Renamed.to REST API for programmatic file renaming.
- How do I rename PDF files using the API?
- Upload a PDF file via POST /api/v1/rename endpoint with Bearer token authentication. The service extracts metadata and returns a suggested filename with vendor, date, invoice number, and other relevant information.
- What file formats does the API support?
- The API currently supports PDF files up to 25 MB in size. Metadata extraction works with both native PDFs and scanned documents.
- How many API calls can I make per day?
- The API is rate-limited to 10,000 renames per day per account. Rate limits reset daily at midnight UTC. See the Limits section for more details.
- Does the API support multiple languages?
- Yes, the API supports 20+ languages for filename generation, including English, German, French, Spanish, Japanese, Chinese, Arabic, and more. Document types remain in English (e.g., "Invoice", "Receipt"), but issuer names and other text use the specified language. See the Language Options section for the complete list.
- How do I get an API token?
- Generate API tokens in Settings → API Tokens. Tokens are shown only once when created—make sure to save them securely. See the Authentication section for details.
- How does automated file renaming work?
- Automated file renaming extracts metadata from PDF documents (like vendor names, dates, invoice numbers, amounts, document types) and generates descriptive, consistent filenames. The service analyzes document content, structure, and context to identify key information without manual configuration.
- Can I customize the filename format?
- Yes, you can use predefined templates or provide custom prompts to control filename generation. The API supports three template modes: auto (service selects best pattern), predefined (use standard templates), and custom (provide natural language instructions). See the Template Modes section for details.
- How accurate is the metadata extraction?
- The service achieves high accuracy for most document types. Each response includes a confidence score so you can validate results before applying them. The API processes millions of documents including invoices, receipts, contracts, and legal documents.
- What happens if I run out of credits?
If your account has 0 credits, API requests will return a
402 Payment Requirederror. You can check your credit balance using the Credits endpoint or purchase additional credits through your account settings.Cloud integrations (OneDrive, Dropbox, Google Drive): If you run out of credits while files are being processed, those jobs will be automatically paused and marked as "pending credits." When you add credits to your account (via purchase or admin grant), processing will automatically resume for all pending jobs. Jobs older than 30 days will not be automatically retried to avoid processing outdated files.
Have more questions? Check our Troubleshooting section or contact support for assistance.
Changelog
2025-11-11 – v1
- Changed configuration options from query parameters to POST body form fields (breaking change).
- Added
folderPathto rename response. - Added endpoints: GET /api/v1/user, GET /api/v1/credits, GET /api/v1/team. All endpoints support API token authentication.
- Enhanced documentation with examples for custom AI prompts and form fields.
2025-06-14 – v1 Initial Release
- Initial release – single
renameendpoint.
Continue exploring
Discover related documentation, integrations, and use cases