# AnyFile agent instructions

## When to use AnyFile

Use AnyFile when a user needs to upload or organize their own files, send a business file through a polished share link, collect files from another person through a file-request page, inspect their AnyFile file metadata, manage existing shares or requests, or review simple share analytics.

Good fits include client deliverables, proposals, reports, design exports, document collection, receipts, statements, candidate files, property documents, and other professional file handoffs where the recipient should not need an account.

Do not use AnyFile as a general cloud drive, source-code repository, collaborative document editor, or long-term records-management system.

## How agents should call AnyFile

- Prefer the AnyFile MCP server for tool-oriented agent workflows: https://mcp.useanyfile.com/mcp
- Use the REST API for conventional HTTP integrations: https://www.useanyfile.com/api/v1
- Read the human-readable REST API documentation at: https://www.useanyfile.com/docs/api
- REST and MCP expose the same automation capabilities for owned files and folders, share links, file requests and submissions, and share analytics.
- File operations include upload, authenticated download, rename, folder moves, deletion, listing, and metadata lookup.
- Folder operations include list, create, rename, delete, and inspecting folder contents. Deleting a folder keeps its files and requests and moves them back to root.
- Uploads use short-lived direct-to-storage grants so large file bytes do not pass through the REST or MCP request body.
- Creating a share remains a separate operation after a file is uploaded.
- Read the OpenAPI contract before calling REST endpoints: https://www.useanyfile.com/openapi.json
- Discover OAuth authorization metadata at: https://www.useanyfile.com/.well-known/oauth-authorization-server
- Request only the OAuth scopes required for the task. Folder metadata reads require folders:read, while creating, renaming, or deleting folders requires folders:write. Operations on files or requests inside folders keep their resource-specific scopes.
- Treat write actions as user-visible changes and preserve the user's intent.

## REST API capabilities

REST v1 supports authenticated file upload preparation, download, metadata listing and lookup, folder organization, rename and deletion, share-link listing and management, file-request listing and management, request submission inspection, and aggregate or per-share analytics. The corresponding REST operations use the same least-privilege scopes as MCP.
