AnyFile Files API
The Files API from AnyFile — 4 operation(s) for files.
The Files API from AnyFile — 4 operation(s) for files.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/useanyfile-com:useanyfile-com-files-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: AnyFile REST Files API
version: 1.0.0
description: 'Public REST API for AnyFile: upload, download and organize owned files in folders, manage share links and file requests, inspect submissions, and read share analytics. Authenticate with an AnyFile API key or OAuth 2.0 bearer token and request only the scopes required for the task.'
servers:
- url: https://www.useanyfile.com/api/v1
tags:
- name: Files
paths:
/files:
get:
operationId: files_list
summary: List file metadata
x-required-scope: files:read
security:
- bearerAuth: []
parameters:
- name: query
in: query
schema:
type: string
minLength: 1
maxLength: 200
- name: cursor
in: query
schema:
type: string
maxLength: 128
- name: limit
in: query
schema:
type: integer
minimum: 1
maximum: 100
default: 50
- name: folderId
in: query
description: Return resources assigned to this owned folder.
schema:
type: string
minLength: 1
maxLength: 100
responses:
'200':
description: A page of file metadata
content:
application/json:
schema:
type: object
required:
- data
- pagination
properties:
data:
type: array
items:
$ref: '#/components/schemas/File'
pagination:
$ref: '#/components/schemas/Pagination'
'400':
$ref: '#/components/responses/ApiError'
'401':
$ref: '#/components/responses/ApiError'
'403':
$ref: '#/components/responses/ApiError'
'404':
$ref: '#/components/responses/ApiError'
'409':
$ref: '#/components/responses/ApiError'
'429':
$ref: '#/components/responses/ApiError'
tags:
- Files
post:
operationId: files_upload
summary: Prepare one or more file uploads
description: Creates short-lived upload intents for direct-to-Blob transfer. Use each returned pathname, handleUploadUrl, and clientPayload with @vercel/blob/client. The clientPayload contains an intent-scoped secret for the Blob handshake, so the long-lived API credential is not sent to Blob. Poll statusUrl with the AnyFile bearer credential until the resulting file ID is available.
x-required-scope: files:write
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- files
additionalProperties: false
properties:
files:
type: array
minItems: 1
maxItems: 100
items:
type: object
required:
- name
- type
- size
additionalProperties: false
properties:
name:
type: string
minLength: 1
maxLength: 255
type:
type: string
minLength: 1
maxLength: 255
size:
type: integer
minimum: 1
folderId:
description: Owned folder ID. Pass null on update to move the resource back to root.
type:
- string
- 'null'
minLength: 1
maxLength: 100
responses:
'201':
description: Short-lived direct upload grants
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: object
required:
- uploads
properties:
uploads:
type: array
items:
type: object
required:
- intentId
- name
- contentType
- size
- pathname
- handleUploadUrl
- statusUrl
- clientPayload
- expiresAt
properties:
intentId:
type: string
name:
type: string
contentType:
type: string
size:
type: integer
pathname:
type: string
handleUploadUrl:
type: string
format: uri
statusUrl:
type: string
format: uri
clientPayload:
type: object
required:
- intentId
- name
- grant
additionalProperties: false
description: Short-lived presigned payload for the Blob token handshake. Pass it exactly as returned and do not log or persist the grant secret.
properties:
intentId:
type: string
name:
type: string
grant:
type: string
minLength: 32
expiresAt:
type: string
format: date-time
'400':
$ref: '#/components/responses/ApiError'
'401':
$ref: '#/components/responses/ApiError'
'403':
$ref: '#/components/responses/ApiError'
'404':
$ref: '#/components/responses/ApiError'
'409':
$ref: '#/components/responses/ApiError'
'429':
$ref: '#/components/responses/ApiError'
tags:
- Files
delete:
operationId: files_delete_bulk
summary: Delete one or more files
x-required-scope: files:write
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- fileIds
additionalProperties: false
properties:
fileIds:
type: array
minItems: 1
maxItems: 100
items:
type: string
minLength: 1
maxLength: 128
responses:
'200':
description: Deleted file IDs
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: object
required:
- deletedIds
properties:
deletedIds:
type: array
items:
type: string
'400':
$ref: '#/components/responses/ApiError'
'401':
$ref: '#/components/responses/ApiError'
'403':
$ref: '#/components/responses/ApiError'
'404':
$ref: '#/components/responses/ApiError'
'409':
$ref: '#/components/responses/ApiError'
'429':
$ref: '#/components/responses/ApiError'
tags:
- Files
/files/{fileId}:
get:
operationId: files_get
summary: Get file metadata
x-required-scope: files:read
security:
- bearerAuth: []
parameters:
- name: fileId
in: path
required: true
schema:
type: string
minLength: 1
maxLength: 128
responses:
'200':
description: File metadata
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/File'
'400':
$ref: '#/components/responses/ApiError'
'401':
$ref: '#/components/responses/ApiError'
'403':
$ref: '#/components/responses/ApiError'
'404':
$ref: '#/components/responses/ApiError'
'409':
$ref: '#/components/responses/ApiError'
'429':
$ref: '#/components/responses/ApiError'
tags:
- Files
patch:
operationId: files_update
summary: Update file metadata
description: Rename and/or move an owned file. Set folderId to null to move it back to root.
x-required-scope: files:write
security:
- bearerAuth: []
parameters:
- name: fileId
in: path
required: true
schema:
type: string
minLength: 1
maxLength: 128
requestBody:
required: true
content:
application/json:
schema:
type: object
minProperties: 1
additionalProperties: false
properties:
name:
type: string
minLength: 1
maxLength: 255
folderId:
description: Owned folder ID. Pass null on update to move the resource back to root.
type:
- string
- 'null'
minLength: 1
maxLength: 100
responses:
'200':
description: Updated file metadata
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/File'
'400':
$ref: '#/components/responses/ApiError'
'401':
$ref: '#/components/responses/ApiError'
'403':
$ref: '#/components/responses/ApiError'
'404':
$ref: '#/components/responses/ApiError'
'409':
$ref: '#/components/responses/ApiError'
'429':
$ref: '#/components/responses/ApiError'
tags:
- Files
delete:
operationId: files_delete
summary: Delete a file
x-required-scope: files:write
security:
- bearerAuth: []
parameters:
- name: fileId
in: path
required: true
schema:
type: string
minLength: 1
maxLength: 128
responses:
'200':
description: Deleted file
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: object
required:
- id
properties:
id:
type: string
'400':
$ref: '#/components/responses/ApiError'
'401':
$ref: '#/components/responses/ApiError'
'403':
$ref: '#/components/responses/ApiError'
'404':
$ref: '#/components/responses/ApiError'
'409':
$ref: '#/components/responses/ApiError'
'429':
$ref: '#/components/responses/ApiError'
tags:
- Files
/files/uploads/{intentId}:
get:
operationId: files_upload_status
summary: Get file upload status
description: Poll after the direct Blob transfer until status is complete. The complete response returns the created AnyFile file ID.
x-required-scope: files:write
security:
- bearerAuth: []
parameters:
- name: intentId
in: path
required: true
schema:
type: string
minLength: 1
maxLength: 128
responses:
'200':
description: Upload status
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
oneOf:
- type: object
required:
- status
- phase
properties:
status:
const: pending
phase:
enum:
- uploading
- processing
- type: object
required:
- status
- result
properties:
status:
const: complete
result:
type: object
required:
- id
properties:
id:
type: string
- type: object
required:
- status
- error
properties:
status:
const: error
error:
type: string
'400':
$ref: '#/components/responses/ApiError'
'401':
$ref: '#/components/responses/ApiError'
'403':
$ref: '#/components/responses/ApiError'
'404':
$ref: '#/components/responses/ApiError'
'409':
$ref: '#/components/responses/ApiError'
'429':
$ref: '#/components/responses/ApiError'
tags:
- Files
/files/{fileId}/download:
get:
operationId: files_download
summary: Download a file
x-required-scope: files:read
security:
- bearerAuth: []
parameters:
- name: fileId
in: path
required: true
schema:
type: string
minLength: 1
maxLength: 128
- name: disposition
in: query
schema:
type: string
enum:
- attachment
- inline
responses:
'200':
description: File contents
content:
application/octet-stream:
schema:
type: string
format: binary
'400':
$ref: '#/components/responses/ApiError'
'401':
$ref: '#/components/responses/ApiError'
'403':
$ref: '#/components/responses/ApiError'
'404':
$ref: '#/components/responses/ApiError'
'409':
$ref: '#/components/responses/ApiError'
'429':
$ref: '#/components/responses/ApiError'
tags:
- Files
components:
schemas:
FileSummary:
type: object
required:
- id
- name
- contentType
- size
properties:
id:
type: string
name:
type: string
contentType:
type: string
size:
type: integer
minimum: 0
Folder:
type: object
required:
- id
- name
- fileCount
- requestCount
properties:
id:
type: string
name:
type: string
createdAt:
type: string
format: date-time
fileCount:
type: integer
minimum: 0
requestCount:
type: integer
minimum: 0
Pagination:
type: object
required:
- nextCursor
properties:
nextCursor:
type:
- string
- 'null'
FileShareSummary:
type:
- object
- 'null'
properties:
id:
type: string
publicId:
type: string
publicUrl:
type: string
format: uri
isActive:
type: boolean
expiresAt:
type:
- string
- 'null'
format: date-time
viewCount:
type: integer
minimum: 0
downloadCount:
type: integer
minimum: 0
File:
allOf:
- allOf:
- $ref: '#/components/schemas/FileSummary'
- type: object
required:
- createdAt
- share
properties:
createdAt:
type: string
format: date-time
share:
$ref: '#/components/schemas/FileShareSummary'
- type: object
required:
- folderId
- folder
properties:
folderId:
type:
- string
- 'null'
minLength: 1
maxLength: 100
folder:
anyOf:
- $ref: '#/components/schemas/Folder'
- type: 'null'
ApiError:
type: object
required:
- error
properties:
error:
type: object
required:
- code
- message
- hint
properties:
code:
type: string
message:
type: string
hint:
type: string
responses:
ApiError:
description: Structured AnyFile API error
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: AnyFile API key or OAuth 2.0 access token
description: 'Send an AnyFile API key or OAuth 2.0 access token in Authorization: Bearer. OAuth tokens must target https://www.useanyfile.com/api/v1.'
externalDocs:
description: AnyFile developer resources
url: https://www.useanyfile.com/developers