Every API here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for apis
7 MCP tools reach this
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.
All 92 tools →
Call it yourself
curl for this page
This API
curl "https://apis.io/api/v1/apis/box:box-file-versions-api"
All apis
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.
Get an API 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. 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: Box Platform File versions API
description: Box Platform provides functionality to provide access to content stored within Box. It provides endpoints for basic manipulation of files and folders, management of users within an enterprise, as well as more complex topics such as legal holds and retention policies.
termsOfService: https://cloud.app.box.com/s/rmwxu64h1ipr41u49w3bbuvbsa29wku9
contact:
name: Box, Inc
url: https://developer.box.com
email: devrel@box.com
license:
name: Apache-2.0
url: https://www.apache.org/licenses/LICENSE-2.0
version: '2024.0'
x-box-commit-hash: 53bdced3cd
servers:
- url: https://api.box.com/2.0
description: Box Platform API server.
security:
- OAuth2Security: []
tags:
- name: File versions
description: A set of endpoints used to manage specific versions of a file.
x-box-tag: file_versions
paths:
/files/{file_id}/versions:
get:
operationId: get_files_id_versions
summary: List all file versions
description: 'Retrieve a list of the past versions for a file.
Versions are only tracked by Box users with premium accounts. To fetch the ID of the current version of a file, use the `GET /file/:id` API.'
parameters:
- name: file_id
in: path
description: 'The unique identifier that represents a file.
The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`.'
required: true
schema:
type: string
example: '12345'
- name: fields
in: query
description: 'A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response.
Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.'
required: false
schema:
type: array
items:
type: string
example:
- id
- type
- name
explode: false
- name: limit
in: query
description: The maximum number of items to return per page.
required: false
schema:
type: integer
format: int64
maximum: 1000
example: 1000
- name: offset
in: query
description: 'The offset of the item at which to begin the response.
Queries with offset parameter value exceeding 10000 will be rejected with a 400 response.'
required: false
schema:
type: integer
format: int64
default: 0
example: 1000
responses:
'200':
description: Returns an array of past versions for this file.
content:
application/json:
schema:
$ref: '#/components/schemas/FileVersions'
default:
description: An unexpected client error.
content:
application/json:
schema:
$ref: '#/components/schemas/ClientError'
x-box-tag: file_versions
tags:
- File versions
x-codeSamples:
- lang: curl
label: List all file versions
source: "curl -i -X GET \"https://api.box.com/2.0/files/12345/versions\" \\\n -H \"authorization: Bearer <ACCESS_TOKEN>\""
- lang: dotnet
label: List all file versions
source: 'await client.FileVersions.GetFileVersionsAsync(fileId: file.Id);'
- lang: swift
label: List all file versions
source: 'try await client.fileVersions.getFileVersions(fileId: file.id)'
- lang: java
label: List all file versions
source: client.getFileVersions().getFileVersions(file.getId())
- lang: node
label: List all file versions
source: await client.fileVersions.getFileVersions(file.id);
- lang: python
label: List all file versions
source: client.file_versions.get_file_versions(file.id)
/files/{file_id}/versions/{file_version_id}:
get:
operationId: get_files_id_versions_id
summary: Get file version
description: 'Retrieve a specific version of a file.
Versions are only tracked for Box users with premium accounts.'
parameters:
- name: file_id
in: path
description: 'The unique identifier that represents a file.
The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`.'
required: true
schema:
type: string
example: '12345'
- name: fields
in: query
description: 'A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response.
Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.'
required: false
schema:
type: array
items:
type: string
example:
- id
- type
- name
explode: false
- name: file_version_id
in: path
description: The ID of the file version.
required: true
schema:
type: string
example: '1234'
responses:
'200':
description: 'Returns a specific version of a file.
Not all available fields are returned by default. Use the [fields](#parameter-fields) query parameter to explicitly request any specific fields.'
content:
application/json:
schema:
$ref: '#/components/schemas/FileVersion--Full'
default:
description: An unexpected client error.
content:
application/json:
schema:
$ref: '#/components/schemas/ClientError'
x-box-tag: file_versions
tags:
- File versions
x-codeSamples:
- lang: curl
label: Get file version
source: "curl -i -X GET \"https://api.box.com/2.0/files/12345/versions/456456\" \\\n -H \"authorization: Bearer <ACCESS_TOKEN>\""
- lang: dotnet
label: Get file version
source: 'await client.FileVersions.GetFileVersionByIdAsync(fileId: file.Id, fileVersionId: NullableUtils.Unwrap(fileVersions.Entries)[0].Id);'
- lang: swift
label: Get file version
source: 'try await client.fileVersions.getFileVersionById(fileId: file.id, fileVersionId: fileVersions.entries![0].id)'
- lang: java
label: Get file version
source: client.getFileVersions().getFileVersionById(file.getId(), fileVersions.getEntries().get(0).getId())
- lang: node
label: Get file version
source: "await client.fileVersions.getFileVersionById(\n file.id,\n fileVersions.entries![0].id,\n);"
- lang: python
label: Get file version
source: client.file_versions.get_file_version_by_id(file.id, file_versions.entries[0].id)
delete:
operationId: delete_files_id_versions_id
summary: Remove file version
description: 'Move a file version to the trash.
Versions are only tracked for Box users with premium accounts.'
parameters:
- name: file_id
in: path
description: 'The unique identifier that represents a file.
The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`.'
required: true
schema:
type: string
example: '12345'
- name: file_version_id
in: path
description: The ID of the file version.
required: true
schema:
type: string
example: '1234'
- name: if-match
in: header
description: 'Ensures this item hasn''t recently changed before making changes.
Pass in the item''s last observed `etag` value into this header and the endpoint will fail with a `412 Precondition Failed` if it has changed since.'
required: false
schema:
type: string
example: '1'
responses:
'204':
description: Returns an empty response when the file has been successfully deleted.
default:
description: An unexpected client error.
content:
application/json:
schema:
$ref: '#/components/schemas/ClientError'
x-box-tag: file_versions
tags:
- File versions
x-codeSamples:
- lang: curl
label: Remove file version
source: "curl -i -X DELETE \"https://api.box.com/2.0/files/12345/versions/456456\" \\\n -H \"authorization: Bearer <ACCESS_TOKEN>\""
- lang: dotnet
label: Remove file version
source: 'await client.FileVersions.DeleteFileVersionByIdAsync(fileId: file.Id, fileVersionId: fileVersion.Id);'
- lang: swift
label: Remove file version
source: 'try await client.fileVersions.deleteFileVersionById(fileId: file.id, fileVersionId: fileVersion.id)'
- lang: java
label: Remove file version
source: client.getFileVersions().deleteFileVersionById(file.getId(), fileVersion.getId())
- lang: node
label: Remove file version
source: await client.fileVersions.deleteFileVersionById(file.id, fileVersion.id);
- lang: python
label: Remove file version
source: client.file_versions.delete_file_version_by_id(file.id, file_version.id)
put:
operationId: put_files_id_versions_id
summary: Restore file version
description: Restores a specific version of a file after it was deleted. Don't use this endpoint to restore Box Notes, as it works with file formats such as PDF, DOC, PPTX or similar.
parameters:
- name: file_id
in: path
description: 'The unique identifier that represents a file.
The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`.'
required: true
schema:
type: string
example: '12345'
- name: file_version_id
in: path
description: The ID of the file version.
required: true
schema:
type: string
example: '1234'
requestBody:
content:
application/json:
schema:
description: The file version to be restored.
type: object
properties:
trashed_at:
description: Set this to `null` to clear the date and restore the file.
type:
- string
- 'null'
example: null
responses:
'200':
description: Returns a restored file version object.
content:
application/json:
schema:
$ref: '#/components/schemas/FileVersion--Full'
default:
description: An unexpected client error.
content:
application/json:
schema:
$ref: '#/components/schemas/ClientError'
x-box-tag: file_versions
tags:
- File versions
x-codeSamples:
- lang: curl
label: Restore file version
source: "curl -i -X PUT \"https://api.box.com/2.0/files/12345/versions/456456\" \\\n -H \"authorization: Bearer <ACCESS_TOKEN>\" \\\n -H \"content-type: application/json\" \\\n -d '{\n \"trashed_at\": null\n }'"
- lang: dotnet
label: Restore file version
source: 'await client.FileVersions.UpdateFileVersionByIdAsync(fileId: file.Id, fileVersionId: fileVersion.Id, requestBody: new UpdateFileVersionByIdRequestBody() { TrashedAt = null });'
- lang: java
label: Restore file version
source: client.getFileVersions().updateFileVersionById(file.getId(), fileVersion.getId(), new UpdateFileVersionByIdRequestBody.Builder().trashedAt(null).build())
- lang: node
label: Restore file version
source: "await client.fileVersions.updateFileVersionById(file.id, fileVersion.id, {\n requestBody: {\n trashedAt: createNull(),\n } satisfies UpdateFileVersionByIdRequestBody,\n} satisfies UpdateFileVersionByIdOptionalsInput);"
- lang: python
label: Restore file version
source: "client.file_versions.update_file_version_by_id(\n file.id, file_version.id, trashed_at=create_null()\n)"
/files/{file_id}/versions/current:
post:
operationId: post_files_id_versions_current
summary: Promote file version
description: 'Promote a specific version of a file.
If previous versions exist, this method can be used to promote one of the older versions to the top of the version history.
This creates a new copy of the old version and puts it at the top of the versions history. The file will have the exact same contents as the older version, with the same hash digest, `etag`, and name as the original.
Other properties such as comments do not get updated to their former values.
Don''t use this endpoint to restore Box Notes, as it works with file formats such as PDF, DOC, PPTX or similar.'
parameters:
- name: file_id
in: path
description: 'The unique identifier that represents a file.
The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`.'
required: true
schema:
type: string
example: '12345'
- name: fields
in: query
description: 'A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response.
Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.'
required: false
schema:
type: array
items:
type: string
example:
- id
- type
- name
explode: false
requestBody:
content:
application/json:
schema:
description: The file version to promote.
type: object
properties:
id:
description: The file version ID.
type: string
example: '11446498'
type:
description: The type to promote.
type: string
example: file_version
enum:
- file_version
responses:
'201':
description: Returns a newly created file version object.
content:
application/json:
schema:
$ref: '#/components/schemas/FileVersion--Full'
default:
description: An unexpected client error.
content:
application/json:
schema:
$ref: '#/components/schemas/ClientError'
x-box-tag: file_versions
tags:
- File versions
x-codeSamples:
- lang: curl
label: Promote file version
source: "curl -i -X POST \"https://api.box.com/2.0/files/12345/versions/current\" \\\n -H \"authorization: Bearer <ACCESS_TOKEN>\" \\\n -H \"content-type: application/json\" \\\n -d '{\n \"type\": \"file_version\",\n \"id\": \"456456\"\n }'"
- lang: dotnet
label: Promote file version
source: 'await client.FileVersions.PromoteFileVersionAsync(fileId: file.Id, requestBody: new PromoteFileVersionRequestBody() { Id = NullableUtils.Unwrap(fileVersions.Entries)[0].Id, Type = PromoteFileVersionRequestBodyTypeField.FileVersion });'
- lang: swift
label: Promote file version
source: 'try await client.fileVersions.promoteFileVersion(fileId: file.id, requestBody: PromoteFileVersionRequestBody(id: fileVersions.entries![0].id, type: PromoteFileVersionRequestBodyTypeField.fileVersion))'
- lang: java
label: Promote file version
source: client.getFileVersions().promoteFileVersion(file.getId(), new PromoteFileVersionRequestBody.Builder().id(fileVersions.getEntries().get(0).getId()).type(PromoteFileVersionRequestBodyTypeField.FILE_VERSION).build())
- lang: node
label: Promote file version
source: "await client.fileVersions.promoteFileVersion(file.id, {\n requestBody: {\n id: fileVersions.entries![0].id,\n type: 'file_version' as PromoteFileVersionRequestBodyTypeField,\n } satisfies PromoteFileVersionRequestBody,\n} satisfies PromoteFileVersionOptionalsInput);"
- lang: python
label: Promote file version
source: "client.file_versions.promote_file_version(\n file.id, id=file_versions.entries[0].id, type=PromoteFileVersionType.FILE_VERSION\n)"
components:
schemas:
FileVersion--Full:
description: A full representation of a file version, as can be returned from any file version API endpoints by default.
type: object
allOf:
- $ref: '#/components/schemas/FileVersion'
- properties:
version_number:
description: The version number of this file version.
type: string
example: '1'
title: File version (Full)
x-box-resource-id: file_version--full
x-box-variant: full
FileVersion--Base:
description: The bare basic representation of a file version, the minimal amount of fields returned when using the `fields` query parameter.
type: object
properties:
id:
description: The unique identifier that represent a file version.
type: string
example: '12345'
type:
description: The value will always be `file_version`.
type: string
example: file_version
enum:
- file_version
required:
- id
- type
title: File version (Base)
x-box-resource-id: file_version--base
x-box-variant: base
x-box-variants:
- base
- mini
- standard
- full
ClientError:
description: A generic error.
type: object
properties:
type:
description: The value will always be `error`.
type: string
example: error
enum:
- error
status:
description: The HTTP status of the response.
type: integer
format: int32
example: 400
code:
description: A Box-specific error code.
type: string
example: item_name_invalid
enum:
- created
- accepted
- no_content
- redirect
- not_modified
- bad_request
- unauthorized
- forbidden
- not_found
- method_not_allowed
- conflict
- precondition_failed
- unprocessable_entity
- too_many_requests
- internal_server_error
- unavailable
- item_name_invalid
- insufficient_scope
message:
description: A short message describing the error.
type: string
example: Method Not Allowed
context_info:
description: A free-form object that contains additional context about the error. The possible fields are defined on a per-endpoint basis. `message` is only one example.
type:
- object
- 'null'
example:
message: Something went wrong
additionalProperties: {}
help_url:
description: A URL that links to more information about why this error occurred.
type: string
example: https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/
request_id:
description: A unique identifier for this response, which can be used when contacting Box support.
type: string
example: abcdef123456
title: Client error
x-box-resource-id: client_error
User--Mini:
description: A mini representation of a user, as can be returned when nested within other resources.
type: object
allOf:
- $ref: '#/components/schemas/User--Base'
- properties:
name:
description: The display name of this user.
type: string
example: Aaron Levie
maxLength: 50
login:
description: The primary email address of this user.
type: string
format: email
example: ceo@example.com
title: User (Mini)
x-box-resource-id: user--mini
x-box-tag: users
x-box-variant: mini
FileVersions:
description: A list of file versions.
type: object
allOf:
- type: object
description: The part of an API response that describes pagination.
properties:
total_count:
description: 'One greater than the offset of the last entry in the entire collection. The total number of entries in the collection may be less than `total_count`.
This field is only returned for calls that use offset-based pagination. For marker-based paginated APIs, this field will be omitted.'
type: integer
format: int64
example: 5000
limit:
description: The limit that was used for these entries. This will be the same as the `limit` query parameter unless that value exceeded the maximum value allowed. The maximum value varies by API.
type: integer
format: int64
example: 1000
offset:
description: 'The 0-based offset of the first entry in this set. This will be the same as the `offset` query parameter.
This field is only returned for calls that use offset-based pagination. For marker-based paginated APIs, this field will be omitted.'
type: integer
format: int64
example: 2000
order:
description: 'The order by which items are returned.
This field is only returned for calls that use offset-based pagination. For marker-based paginated APIs, this field will be omitted.'
type: array
items:
type: object
description: The order in which a pagination is ordered.
properties:
by:
description: The field to order by.
type: string
example: type
direction:
description: The direction to order by, either ascending or descending.
type: string
example: ASC
enum:
- ASC
- DESC
- properties:
entries:
description: A list of file versions.
type: array
items:
$ref: '#/components/schemas/FileVersion--Full'
title: File versions
x-box-resource-id: file_versions
x-box-tag: file_versions
FileVersion--Mini:
description: A mini representation of a file version, used when nested within another resource.
type: object
allOf:
- $ref: '#/components/schemas/FileVersion--Base'
- properties:
sha1:
description: The SHA1 hash of this version of the file.
type: string
example: 134b65991ed521fcfe4724b7d814ab8ded5185dc
title: File version (Mini)
x-box-resource-id: file_version--mini
x-box-variant: mini
FileVersion:
description: A standard representation of a file version.
type: object
allOf:
- $ref: '#/components/schemas/FileVersion--Mini'
- properties:
name:
description: The name of the file version.
type: string
example: tigers.jpeg
size:
description: Size of the file version in bytes.
type: integer
format: int64
example: 629644
created_at:
description: When the file version object was created.
type: string
format: date-time
example: '2012-12-12T10:53:43-08:00'
modified_at:
description: When the file version object was last updated.
type: string
format: date-time
example: '2012-12-12T10:53:43-08:00'
modified_by:
allOf:
- $ref: '#/components/schemas/User--Mini'
- description: The user who last updated the file version.
trashed_at:
description: When the file version object was trashed.
type:
- string
- 'null'
format: date-time
example: '2012-12-12T10:53:43-08:00'
trashed_by:
allOf:
- $ref: '#/components/schemas/User--Mini'
- description: The user who trashed the file version.
restored_at:
description: When the file version was restored from the trash.
type:
- string
- 'null'
format: date-time
example: '2012-12-12T10:53:43-08:00'
restored_by:
allOf:
- $ref: '#/components/schemas/User--Mini'
- description: The user who restored the file version from the trash.
purged_at:
description: When the file version object will be permanently deleted.
type:
- string
- 'null'
format: date-time
example: '2012-12-12T10:53:43-08:00'
uploader_display_name:
allOf:
- title: Uploader display name
type: string
example: Ellis Wiggins
description: 'The display name of the user that uploaded the file. In most cases this is the name of the user logged in at the time of the upload.
If the file was uploaded using a File Request form that requires the user to provide an email address, this field is populated with that email address. If an email address was not required in the File Request form, this field is set to return a value of `File Request`.
In all other anonymous cases where no email was provided this field will default to a value of `Someone`.'
title: File version
x-box-resource-id: file_version
x-box-variant: standard
User--Base:
description: A mini representation of a user, used when nested within another resource.
type: object
properties:
id:
description: The unique identifier for this user.
type: string
example: '11446498'
type:
description: The value will always be `user`.
type: string
example: user
enum:
- user
required:
- type
- id
title: User (Base)
x-box-resource-id: user--base
x-box-tag: users
x-box-variant: base
x-box-variants:
- base
- mini
- standard
- full
securitySchemes:
OAuth2Security:
type: oauth2
description: The access token received from the authorization server in the OAuth 2.0 flow.
flows:
authorizationCode:
authorizationUrl: https://account.box.com/api/oauth2/authorize
tokenUrl: https://api.box.com/oauth2/token
scopes:
root_readonly: Read all files and folders stored in Box
root_readwrite: Read and write all files and folders stored in Box
manage_app_users: Provision and manage app users
manage_managed_users: Provision and manage managed users
manage_groups: Manage an enterprise's groups
manage_webhook: Create webhooks programmatically through the API
manage_enterprise_properties: Manage enterprise properties
manage_data_retention: Manage data retention polices
manage_legal_hold: Manage Legal Holds
externalDocs:
description: Box Developer Documentation.
url: https://developer.box.com
x-mint:
mcp:
enabled: true
x-provenance:
method: harvested
publisher: Box
source: https://developer.box.com/box-openapi.json
note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
stamped by stamp-openapi-provenance.py (roadmap#793)