
Knowledge Base
Articles In This Section
How to Set Up API_DoQuery in QuickbaseAPI EditRecord | ADVANCEDHow to use API ImportFromCSV in QuickbaseHow to Use API_PurgeRecords in QuickbaseHow to Utilize API AddRecord in Quickbase (Guide) How to Set Up a API_DoQuery in QuickbaseSections
API_CopyMasterDetail is a Quickbase XML API call used to copy a master-detail record relationship, including the parent record and its related child records, in one operation.
So instead of manually duplicating a parent record and then recreating all its related children, this API does it in one request.
You’d use API_CopyMasterDetail when you want to:
Some important parameters include:
dbid – the table ID of the parent tablerid – the Record ID of the parent record you want to copycopy_fields (optional) – specify which fields to copyexclude_fields (optional) – fields you don’t want copiedudata (optional) – for tracking/loggingAPI_CopyMasterDetailUse it when your data is organized in a true master-detail relationship and you want a full copy.
Examples:
If you have “template” records that serve as a starting point:
In Quickbase, if you're building one of the following:
This type of API avoids:
If maintaining correct parent-child links is critical, this API is safer because:
API_CopyMasterDetailAvoid it if you only want:
This API copies everything in the relationship.
API_CopyMasterDetail is part of the legacy XML API.
If you're:
You may want to do: Query → transform → recreate records manually (or use Quickbase Pipelines) instead.
This API does a straight duplication and is not ideal to use if you need to:
API_CopyMasterDetail only works with a Proper parent-child relationships in Quickbase
Do not use API_CopyMasterDetail for:
API_CopyMasterDetail when: “I want an exact structural clone of a record and everything under it, fast and with minimal logic.” and Avoid using API_CopyMasterDetail when: “I need control, filtering, or transformation during the copy.”Quickbase is a relational database, meaning data is structured in parent-child relationships such as:
When using the standard “Copy Record” option in Quickbase, only the parent record is duplicated. Child records are not copied.
Example: Copying an Invoice results in a new Invoice with no Line Items.
The API_CopyMasterDetail call solves this by allowing you to:
This enables true record duplication with full data integrity. Below are the two options to using the API_CopyMasterDetail in Quickbase
Quickbase provides a built-in configuration tool to generate a button that runs the API_CopyMasterDetail call.
Step 1: Navigate to: Settings → App Management → Copy master & detail records
Step 2: Select the parent table (top of your hierarchy)
Example: Choose Projects if copying Projects with Tasks and Activities
Step 3: Choose what to Copy and in Quickbase, you have several options:
Step 4: Copy all descendants (recursive copy)
Step 5: Final step is to name your button field
You can delete and recreate the button anytime if changes are needed.
API_CopyMasterDetail does not support circular relationships. If your schema includes loops (where a child indirectly becomes a parent of the original table), the API call will fail.For advanced use cases, you can call API_CopyMasterDetail via:
Use this approach when you need to:
API_EditRecordExample: Copy an Invoice with Line Items and then reset all dollar amounts via a follow-up API call
(see image below)

relfids to avoid copying unnecessary dataAPI_EditRecord for post-copy cleanupThe Quickbase API_CopyMasterDetail call is a powerful tool for:
Use the built-in button for simplicity, or a custom API call for flexibility and automation.
The Quickbase API_CopyMasterDetail call includes several unique parameters that control how parent and child records are copied. Understanding these parameters is essential for successfully duplicating records and their relationships in Quickbase.
The destrid (destination record ID) determines where the copied detail records will go.
You have two primary options:
destrid = 0destrid = [existing Record ID]destrid = 5 will copy detail records into Project ID #5.Best Practice:Use destrid=0 when cloning full records. Use a specific Record ID when merging or reusing detail data.
The sourcerid (source record ID) specifies the record you want to copy from.
sourcerid to the current recordsourcerid to the template’s Record IDExample: If you maintain a “Template Project,” set sourcerid to that record to copy its structure and details.
Common Use Case: Creating standardized records from templates in Quickbase apps.
The copyfid (field ID) determines which field will store the new record’s name.
Quickbase automatically prefixes the value with: “Copy of …”
Example: If copyfid points to Project Name:
Tip: Use a primary or descriptive field (like Name or Title) for better data clarity.
The recurse parameter controls whether nested child records are also copied.
recurse = 1 (default) → Copies all levels of relationshipsrecurse = 0 → Copies only the first level of child recordsExample hierarchy: Project → Tasks → Activities
recurse=1 → Copies Projects, Tasks, and Activitiesrecurse=0 → Copies Projects and Tasks onlyDefault Behavior: Recursive copying is enabled.
relfids (OPTIONAL)The relfids parameter lets you control which relationships are copied.
Example: Copy Projects and Tasks, but exclude Documents
How it works:
relfids to include only those relationshipsIf omitted: Quickbase copies all related child records by default
destRID – Destination record (0 = create new)sourcerid – Record to copy fromcopyfid – Field to store “Copy of…” namerecurse – Include nested child recordsrelfids – Specify which relationships to copyEach Quickbase relationship includes a Report Link field, which:
To control which child records are copied:
relfids parameterBy combining these parameters, you can:
This makes API_CopyMasterDetail one of the most powerful tools for automating record duplication in Quickbase.
API_CopyMasterDetail If you're new to this API:
This is a great way to understand how Quickbase structures the request.
API_CopyMasterDetail is a Quickbase XML API that allows you to copy a parent record along with its related child and grandchild records in a single request. Unlike the standard “Copy Record” feature, it preserves master-detail relationships, making it ideal for duplicating structured data such as projects with tasks or invoices with line items.
Use API_CopyMasterDetail when you need to duplicate a record and all its related data while maintaining relationships. Common use cases include:
It is especially useful for automation, templates, and relational data replication in Quickbase.
The standard “Copy Record” feature only duplicates the parent record and does not copy child records. In contrast, API_CopyMasterDetail:
This makes it the preferred method for complete data duplication in relational Quickbase apps.
Yes. You can control which related records are copied using the relfids parameter, which specifies the relationships to include. You can also:
recurse=0 to prevent copying nested child recordsThis gives you flexibility to customize how data is duplicated in Quickbase.
No. API_CopyMasterDetail is part of the legacy Quickbase XML API and is not currently available in the REST API.
If you are using REST-based integrations, you will need to:
Alternatively, you can use Quickbase Pipelines or XML API calls for easier implementation.
Resources


© 2026 Quandary Consulting Group. All Rights Reserved.
Privacy Policy