Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions reference/ATTACHMENTS/_order.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
- get-single-attachment
- create-attachment
- finalize-attachment
- copy-all-attachments
- delete-attachment
45 changes: 45 additions & 0 deletions reference/ATTACHMENTS/copy-all-attachments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: Copy All Reference Files
excerpt: >-
Copy all reference files from one form to another.
api:
file: rest-api.json
operationId: copy-all-attachments
deprecated: false
hidden: false
metadata:
title: ''
description: ''
robots: noindex
next:
description: ''
---

This endpoint allows you to copy all reference files from a source form to a destination form. This is useful when cloning a form or moving reference data between applications.

# Request Payload

```json
{
"source_parent_id": "93eb5194-472e-436f-8769-6554b5f8845c",
"destination_parent_id": "842d5194-472e-436f-8769-6554b5f8845c",
"parent_type": "form"
}
```

# Response

The response includes a mapping of the original attachment IDs to the new attachment IDs created during the copy process.

```json
{
"ref_file_mapping": {
"ef9bc6b0-cfd2-4c3a-8189-316f1335126a": "694e1ea7-f847-4fe3-a8bb-299c50e0e6ed"
}
}
```

# Limits

- **100 reference files** per form.
- **1GB** total reference file size per form.
120 changes: 120 additions & 0 deletions reference/rest-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,44 @@
},
"description": "Location metadata captured at creation or update time."
},
"AttachmentCopyAllRequest": {
"type": "object",
"required": [
"source_parent_id",
"destination_parent_id",
"parent_type"
],
"additionalProperties": false,
"properties": {
"source_parent_id": {
"type": "string",
"description": "The ID of the source parent (e.g. form ID) to copy reference files from"
},
"destination_parent_id": {
"type": "string",
"description": "The ID of the destination parent (e.g. form ID) to copy reference files to"
},
"parent_type": {
"type": "string",
"description": "The type of the parent resource",
"enum": [
"form"
]
}
}
},
"AttachmentCopyAllResponse": {
"type": "object",
"properties": {
"ref_file_mapping": {
"type": "object",
"description": "A mapping of original reference file attachment IDs to their new copies",
"additionalProperties": {
"type": "string"
}
}
}
},
"AttachmentCreateRequest": {
"type": "object",
"required": [
Expand Down Expand Up @@ -10211,6 +10249,88 @@
"deprecated": false
}
},
"/v2/attachments/copy_all": {
"post": {
"summary": "Copy all reference files",
"description": "Copy all reference files from one form to another. Limits: 100 reference files per form, 1GB total per form.",
"operationId": "copy-all-attachments",
"parameters": [
{
"name": "x-apitoken",
"in": "header",
"description": "API Token. Required to authenticate the request.",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AttachmentCopyAllRequest"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AttachmentCopyAllResponse"
}
}
}
},
"400": {
"description": "400",
"content": {
"application/json": {
"examples": {
"Result": {
"value": "{\n \"error\": \"Bad Request\"\n}"
}
},
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Bad Request"
}
}
}
}
}
},
"401": {
"description": "401",
"content": {
"application/json": {
"examples": {
"Result": {
"value": "{\n \"error\": \"Unauthorized\"\n}"
}
},
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Unauthorized"
}
}
}
}
}
}
},
"deprecated": false
}
},
"/v2/attachments/finalize": {
"post": {
"summary": "Finalize Attachment",
Expand Down