openapi: 3.1.0 info: title: Box Authorize Authorization File Versions API description: Needs a description. 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: Box List all file versions tags: - File Versions x-box-tag: 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 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`.' example: '12345' in: path required: true schema: type: string - name: fields 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.' in: query example: - id - type - name required: false explode: false schema: type: array items: type: string - name: limit description: The maximum number of items to return per page. in: query required: false example: 1000 schema: type: integer format: int64 maximum: 1000 - name: offset 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.' in: query required: false example: 1000 schema: type: integer format: int64 default: 0 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' /files/{file_id}/versions/{file_version_id}: get: operationId: get_files_id_versions_id summary: Box Get file version tags: - File Versions x-box-tag: file_versions description: 'Retrieve a specific version of a file. Versions are only tracked for Box users with premium accounts.' parameters: - name: file_id 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`.' example: '12345' in: path required: true schema: type: string - name: fields 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.' in: query example: - id - type - name required: false explode: false schema: type: array items: type: string - name: file_version_id description: The ID of the file version in: path required: true example: '1234' schema: type: string responses: '200': description: 'Returns a specific version of a file. Not all available fields are returned by default. Use the [fields](#param-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' delete: operationId: delete_files_id_versions_id summary: Box Remove file version tags: - File Versions x-box-tag: file_versions description: 'Move a file version to the trash. Versions are only tracked for Box users with premium accounts.' parameters: - name: file_id 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`.' example: '12345' in: path required: true schema: type: string - name: file_version_id description: The ID of the file version in: path required: true example: '1234' schema: type: string - name: if-match 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.' in: header required: false example: '1' schema: type: string 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' put: operationId: put_files_id_versions_id summary: Box Restore file version tags: - File Versions x-box-tag: file_versions 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 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`.' example: '12345' in: path required: true schema: type: string - name: file_version_id description: The ID of the file version in: path required: true example: '1234' schema: type: string requestBody: content: application/json: schema: type: object description: 'The file version to be restored' properties: trashed_at: type: string description: 'Set this to `null` to clear the date and restore the file.' 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' /files/{file_id}/versions/current: post: operationId: post_files_id_versions_current summary: Box Promote file version tags: - File Versions x-box-tag: file_versions 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 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 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`.' example: '12345' in: path required: true schema: type: string - name: fields 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.' in: query example: - id - type - name required: false explode: false schema: type: array items: type: string requestBody: content: application/json: schema: type: object description: The file version to promote properties: id: type: string description: The file version ID example: '11446498' type: type: string description: The type to promote 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' components: schemas: User--Base: title: User (Base) type: object x-box-resource-id: user--base x-box-tag: users x-box-variants: - base - mini - standard - full x-box-variant: base description: 'A mini representation of a user, used when nested within another resource.' required: - type - id properties: id: type: string description: The unique identifier for this user example: '11446498' type: type: string description: '`user`' example: user nullable: false enum: - user FileVersion: title: File version type: object x-box-resource-id: file_version x-box-variant: standard description: A standard representation of a file version allOf: - $ref: '#/components/schemas/FileVersion--Mini' - properties: name: type: string description: The name of the file version example: tigers.jpeg size: type: integer format: int64 description: Size of the file version in bytes example: 629644 created_at: type: string format: date-time description: When the file version object was created example: '2012-12-12T10:53:43-08:00' modified_at: type: string format: date-time description: When the file version object was last updated 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: type: string description: When the file version object was trashed. format: date-time nullable: true 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: type: string description: When the file version was restored from the trash. format: date-time nullable: true 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: type: string description: When the file version object will be permanently deleted. format: date-time nullable: true example: '2012-12-12T10:53:43-08:00' uploader_display_name: allOf: - title: Uploader display name type: string example: Ellis Wiggins nullable: false 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`.' FileVersion--Full: title: File version (Full) type: object x-box-resource-id: file_version--full x-box-variant: full description: 'A full representation of a file version, as can be returned from any file version API endpoints by default' allOf: - $ref: '#/components/schemas/FileVersion' - properties: version_number: type: string example: '1' description: The version number of this file version FileVersion--Mini: title: File version (Mini) type: object x-box-resource-id: file_version--mini x-box-variant: mini description: 'A mini representation of a file version, used when nested within another resource.' allOf: - $ref: '#/components/schemas/FileVersion--Base' - properties: sha1: type: string description: The SHA1 hash of this version of the file. example: 134b65991ed521fcfe4724b7d814ab8ded5185dc User--Mini: title: User (Mini) type: object x-box-resource-id: user--mini x-box-variant: mini description: 'A mini representation of a user, as can be returned when nested within other resources.' allOf: - $ref: '#/components/schemas/User--Base' - properties: name: type: string description: The display name of this user example: Aaron Levie maxLength: 50 nullable: false login: type: string format: email description: The primary email address of this user example: ceo@example.com nullable: false FileVersion--Base: title: File version (Base) type: object x-box-resource-id: file_version--base x-box-sanitized: true x-box-variants: - base - mini - standard - full x-box-variant: base description: 'The bare basic representation of a file version, the minimal amount of fields returned when using the `fields` query parameter.' required: - id - type properties: id: type: string nullable: false description: The unique identifier that represent a file version. example: '12345' type: type: string description: '`file_version`' example: file_version enum: - file_version nullable: false FileVersions: title: File versions type: object x-box-resource-id: file_versions x-box-tag: file_versions description: A list of file versions 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.' example: 5000 type: integer format: int64 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.' example: 1000 type: integer format: int64 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.' example: 2000 type: integer format: int64 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 example: type type: string direction: type: string description: The direction to order by, either ascending or descending example: ASC enum: - ASC - DESC - properties: entries: type: array description: A list of file versions items: $ref: '#/components/schemas/FileVersion--Full' ClientError: title: Client error type: object x-box-resource-id: client_error description: A generic error properties: type: description: error example: error type: string enum: - error nullable: false status: description: The HTTP status of the response. example: 400 type: integer format: int32 nullable: false code: description: A Box-specific error code example: item_name_invalid type: string enum: - created - accepted - no_content - redirect - not_modified - bad_request - unauthorized - forbidden - not_found - method_not_allowed - conflict - precondition_failed - too_many_requests - internal_server_error - unavailable - item_name_invalid - insufficient_scope message: description: A short message describing the error. example: Method Not Allowed type: string nullable: false 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 nullable: true properties: message: type: string description: More details on the error. example: Something went wrong. help_url: description: A URL that links to more information about why this error occurred. example: https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/ type: string nullable: false request_id: description: 'A unique identifier for this response, which can be used when contacting Box support.' type: string example: abcdef123456 nullable: false