Copy documents to another project

Copy selected processed documents to another live project.

On this page

HTTP request

POST https://api.parsewise.ai/api/v1/projects/{project_id}/documents/copy/

URI Parameters

Name In Required Type Description
project_id path Yes string (uuid)  

Request Header

Name Required Type Description
X-API-Key Yes string API key with the pw_live_ prefix. See Authentication.

Request Body

Supported content types: multipart/form-data, application/x-www-form-urlencoded, application/json.

Name Required Type Description
target_project_id Yes string (uuid) Destination project UUID. The project must be live and different from the source project.
document_ids Yes array<string (uuid)> Processed source document UUIDs to copy.

Responses

Status Type Description
201 V1DocumentCopyResponse

Security

  • ApiKeyAuth — apiKey — in X-API-Key header. API key with pw_live_ prefix.

Python example

import os
import requests

API_KEY = os.environ["PARSEWISE_API_KEY"]
BASE_URL = "https://api.parsewise.ai/api/v1"

project_id = "<uuid>"

body = {
    "target_project_id": "<uuid>",
    "document_ids": [],
}

resp = requests.post(
    f"{BASE_URL}/projects/{project_id}/documents/copy/",
    headers={"X-API-Key": API_KEY},
    json=body,
)
resp.raise_for_status()
print(resp.json() if resp.content else None)

Definitions

V1DocumentCopyIdMapping

Name Required Type Description
source_document_id Yes string (uuid) UUID of the original document in the source project.
copied_document_id Yes string (uuid) UUID assigned to the copied document in the destination project.

V1DocumentCopyRequestRequest

Name Required Type Description
target_project_id Yes string (uuid) Destination project UUID. The project must be live and different from the source project.
document_ids Yes array<string (uuid)> Processed source document UUIDs to copy.

V1DocumentCopyResponse

Name Required Type Description
copied_count Yes integer Number of documents copied.
document_id_mappings Yes array<V1DocumentCopyIdMapping> Mapping from each source document UUID to its copied document UUID.