Documents

Migrate a Document's Assets to the Storage in the Configuration

This endpoint allows you to migrate all the assets that are associated with a document to a new storage backend.

With this endpoint, you can migrate assets from one s3 compatible storage bucket, to another s3 compatible storage bucket. You can also use this endpoint to migrate assets from the built_in storage to s3 or Azure and vice versa.

This endpoint triggers an asynchronous migration operation. If the request parameters are valid will return immediately with a 202 Accepted response with a jobId that you can use to track the status of the migration operation.

You can track the status of the migration operation at /api/async/jobs/{jobId}

⚠️ NOTE: The backend set in storage must be enabled as either the main storage backend or as a fallback otherwise migration will fail Learn more about configuring Asset Storage backends for Document Engine here

post/api/documents/{documentId}/migrate_assets

Request

  • Base URL: http://localhost:5000
  • URL: http://localhost:5000/api/documents/{documentId}/migrate_assets
  • Auth: one of:
    • API key in header Authorization
    • HTTP bearer

Path parameters

documentIdstring required

The document ID

Headers

pspdfkit-pdf-passwordstring

The PDF document password.

The value can be either a plain-text password or a base64 encoded password in a form base64:<encoded-password>. Use the Base64 encoding if your password contains characters that are not allowed in HTTP header or would be otherwise mangled (e.g. trailing or leading spaces)

If the document is password protected, any operations performed on it require supplying a password.

Request body

copy_remote_files_to_new_storageboolean

If set to true, all remote files will be copied to the new storage backend. If set to false, only assets that are already present in the old storage backend i.e non-remote assets will be moved to the new storage.

Regardless of if remote assets are copied to the storage or not, The storage configuration in storage will be set as the default storage for any new assets associated with the document (or layer) in the future.

For example, any image annotation attachments uploaded and associated with the document after migrating the document to the new storage will be stored in the new storage backend.

Response

The migration job was successfully scheduled

Changes

No recorded changes to this operation across all 1 revision of this API.