--- title: "Add-Volume" slug: "scripting-add-volume" updated: 2025-07-15T18:53:37Z published: 2025-07-15T18:53:37Z canonical: "help.agilityblue.com/scripting-add-volume" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.agilityblue.com/llms.txt > Use this file to discover all available pages before exploring further. # Add-Volume ## Summary Creates a new volume. ```powershell Add-Volume    -Entry ``` Returns a [volume](https://apidocs.agilityblue.com/#ee58c718-6eff-43a5-b23c-106ae336400d) object. ## Parameters | Parameter | Type | Required? | Notes | | --- | --- | --- | --- | | Entry | [Volume](https://apidocs.agilityblue.com/#ee58c718-6eff-43a5-b23c-106ae336400d) Object | Yes | | ## Examples ### Create a new volume (no custom fields) ```powershell # Create a new volume (no custom fields) # Create an object with the necessary fields to create the volume # Note: To reference a volume with a client, set the ClientId property #       To reference a volume with a matter, set the MatterId property #       To reference a volume with a project, set the ProjectId property #       To reference a volume with a task, set the TaskId property $entry = @{    Name        = "AGM002"    TaskId      = 284    DocCount    = 5000    NativeCount = 2166    PageCount   = 0    Notes       = "Was previously collected from vault 3 and removed for processing." } # Create the volume. The created entry will be returned back. $data = Add-Volume -Entry $entry # Output some information to help indicate that the volume was created Write-Output "Volume $($data.VolumeId) ($($data.Name)) was created" # For debug purposes, convert the data to output as JSON so we can see all the fields Write-Output "" Write-Output "JSON Results:" $jsonOutput = $data | ConvertTo-Json -Depth 10 # Output the data Write-Output $jsonOutput ``` Execution results: ```plaintext Volume 40 (AGM002) was created JSON Results: {  "VolumeId": 40,  "ProjectId": 2016100000006,  "Project": null,  "ProjectDescription": "Load Data",  "Name": "AGM002",  "TaskId": 284,  "Task": null,  "TaskName": "Process and Load Data",  "MatterId": 51,  "Matter": null,  "MatterName": "AGM Widget v. XYZ Sprocket",  "MatterReference": "0002",  "ClientId": 29,  "Client": null,  "ClientName": "AGM Widget Corporation",  "ClientReference": "1024",  "DocCount": 5000,  "PageCount": 0,  "NativeCount": 2166,  "Notes": "Was previously collected from vault 3 and removed for processing.",  "VolumeRangeBeg": null,  "VolumeRangeEnd": null,  "NumberOfVolumeRanges": 0,  "VolumeDate": "2024-04-18T13:11:02.4020356+00:00",  "VolumeRanges": [],  "BatesRanges": [],  "Fields": [    {      "FieldId": 77,      "ObjectId": 4,      "DataTypeId": 8,      "DataTypeName": "Single Choice",      "Label": "Volume Type",      "IsRequired": false,      "Position": 0,      "Guid": 8232606313213,      "IsSystemField": false,      "IsReferenceValue": false,      "DefaultValue": "Processing Volume\nProduced From Opposing Counsel\nProduced To Opposing Counsel",      "CopyPreviousValueOnSaveAndNew": false,      "Value": null,      "ReferenceObject": null    },    {      "FieldId": 78,      "ObjectId": 4,      "DataTypeId": 10,      "DataTypeName": "Reference",      "Label": "Requesting Party",      "IsRequired": false,      "Position": 1,      "Guid": 7456561091592,      "IsSystemField": false,      "IsReferenceValue": false,      "DefaultValue": null,      "CopyPreviousValueOnSaveAndNew": false,      "Value": null,      "ReferenceObject": null    }  ],  "CreatedByFullName": "Max Miller",  "CreatedById": "25a34a2f-e3d8-4690-88f5-6b399cf88c4c",  "CreatedOn": "2024-04-18T13:11:03.2707803+00:00",  "CreatedBy": null,  "LastUpdatedByFullName": "Max Miller",  "LastUpdatedById": "25a34a2f-e3d8-4690-88f5-6b399cf88c4c",  "LastUpdatedOn": "2024-04-18T13:11:03.2707803+00:00",  "LastUpdatedBy": null,  "IsFavorite": false } ``` ### Create a volume (with custom fields) ```powershell # Create a new volume (with custom fields) # Create an object with the necessary fields to create the volume # Note: Required fields: #       * MediaTypeId # Note: To reference a volume with a client, set the ClientId property #       To reference a volume with a matter, set the MatterId property #       To reference a volume with a project, set the ProjectId property #       To reference a volume with a task, set the TaskId property $entry = @{    Name        = "AGM003"    TaskId      = 284    DocCount    = 3600    NativeCount = 150    PageCount   = 10756    Notes       = "Was previously collected from vault 3 and removed for processing."    Fields      = @(        @{            FieldId = 77            Label   = "Volume Type"            Value   = @{                ValueAsString = "Processing Volume"            }        }        @{            FieldId = 78            Label   = "Requesting Party"            Value   = @{                ReferenceObject = @{                    Values  = @(                        @{                            KeyAsInteger    = 12                            Value           = "Adele Butler "                        }                    )                }            }        }    ) } # Create the volume. The created entry will be returned back. $data = Add-Volume -Entry $entry # Output some information to help indicate that the volume was created Write-Output "Volume $($data.VolumeId) ($($data.Name)) was created" # For debug purposes, convert the data to output as JSON so we can see all the fields Write-Output "" Write-Output "JSON Results:" $jsonOutput = $data | ConvertTo-Json -Depth 10 # Output the data Write-Output $jsonOutput ``` Execution results: ```powershell Volume 41 (AGM003) was created JSON Results: {  "VolumeId": 41,  "ProjectId": 2016100000006,  "Project": null,  "ProjectDescription": "Load Data",  "Name": "AGM003",  "TaskId": 284,  "Task": null,  "TaskName": "Process and Load Data",  "MatterId": 51,  "Matter": null,  "MatterName": "AGM Widget v. XYZ Sprocket",  "MatterReference": "0002",  "ClientId": 29,  "Client": null,  "ClientName": "AGM Widget Corporation",  "ClientReference": "1024",  "DocCount": 3600,  "PageCount": 10756,  "NativeCount": 150,  "Notes": "Was previously collected from vault 3 and removed for processing.",  "VolumeRangeBeg": null,  "VolumeRangeEnd": null,  "NumberOfVolumeRanges": 0,  "VolumeDate": "2024-04-18T13:15:39.4525183+00:00",  "VolumeRanges": [],  "BatesRanges": [],  "Fields": [    {      "FieldId": 77,      "ObjectId": 4,      "DataTypeId": 8,      "DataTypeName": "Single Choice",      "Label": "Volume Type",      "IsRequired": false,      "Position": 0,      "Guid": 8232606313213,      "IsSystemField": false,      "IsReferenceValue": false,      "DefaultValue": "Processing Volume\nProduced From Opposing Counsel\nProduced To Opposing Counsel",      "CopyPreviousValueOnSaveAndNew": false,      "Value": {        "ObjectFieldValueId": 2185,        "ObjectFieldId": 77,        "ObjectId": 4,        "PrimaryKeyId": 41,        "ValueAsString": "Processing Volume",        "ValueAsBoolean": null,        "ValueAsNumber": null,        "ValueAsDecimal": null,        "ValueAsDate": null,        "ReferenceObject": null      },      "ReferenceObject": null    },    {      "FieldId": 78,      "ObjectId": 4,      "DataTypeId": 10,      "DataTypeName": "Reference",      "Label": "Requesting Party",      "IsRequired": false,      "Position": 1,      "Guid": 7456561091592,      "IsSystemField": false,      "IsReferenceValue": false,      "DefaultValue": null,      "CopyPreviousValueOnSaveAndNew": false,      "Value": {        "ObjectFieldValueId": 2186,        "ObjectFieldId": 78,        "ObjectId": 4,        "PrimaryKeyId": 41,        "ValueAsString": null,        "ValueAsBoolean": null,        "ValueAsNumber": null,        "ValueAsDecimal": null,        "ValueAsDate": null,        "ReferenceObject": {          "ObjectFieldReferenceObjectInstanceId": 330,          "ObjectFieldValueId": 2186,          "ObjectId": 7,          "Object": null,          "PrimaryObjectId": 4,          "PrimaryKeyId": 41,          "KeyType": "Int32",          "DisplayFormat": "%Val%",          "IsSystemObject": true,          "Name": null,          "NumberOfValues": 1,          "Values": [            {              "ObjectFieldReferenceObjectInstanceValueId": 249,              "ObjectFieldReferenceObjectInstanceId": 330,              "KeyAsString": null,              "KeyAsInteger": 12,              "KeyAsLong": null,              "Value": "Adele Butler "            }          ]        }      },      "ReferenceObject": null    }  ],  "CreatedByFullName": "Max Miller",  "CreatedById": "25a34a2f-e3d8-4690-88f5-6b399cf88c4c",  "CreatedOn": "2024-04-18T13:15:39.6471961+00:00",  "CreatedBy": null,  "LastUpdatedByFullName": "Max Miller",  "LastUpdatedById": "25a34a2f-e3d8-4690-88f5-6b399cf88c4c",  "LastUpdatedOn": "2024-04-18T13:15:39.6471961+00:00",  "LastUpdatedBy": null,  "IsFavorite": false } ```