--- title: "Get-Matter" slug: "scripting-get-matter" updated: 2026-01-18T13:26:14Z published: 2026-01-18T13:26:14Z canonical: "help.agilityblue.com/scripting-get-matter" --- > ## 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. # Get-Matter ## Summary Retrieves an existing matter. ```powershell Get-Matter    -Id ``` Returns a [matter](https://apidocs.agilityblue.com/#788f3287-6ef8-446e-a192-05652d583944) object. ## Parameters | Parameter | Type | Required? | Notes | | --- | --- | --- | --- | | Id | Int32 | Yes | The matter id. | ## Examples ### Get an existing matter This example retrieves a specific matter and outputs it as JSON. ```powershell # Retrieve a specific matter by id $entity = Get-Matter -Id 39 Write-Output "Retrieved matter $($entity.MatterId): $($entity.Name) (Reference: $($entity.Reference ?? "N/A"))" # For debug purposes, convert the matter to output as JSON so we can see the available fields Write-Output "" Write-Output "JSON Results:" $jsonOutput = $entity | ConvertTo-Json -Depth 10 # Output the entity Write-Output $jsonOutput ``` Execution results (note that our matter object example here contains 5 custom fields): ```json Retrieved matter 39: AGM Widget Corp. vs. MGM Manufacturing Inc. (Reference: 1024-0002) JSON Results: {  "MatterId": 39,  "Name": "AGM Widget Corp. vs. MGM Manufacturing Inc.",  "Reference": "1024-0002",  "Active": true,  "AccessStateId": 3,  "AccessStateName": "All Organization Users",  "ClientId": 29,  "Client": null,  "ClientName": "AGM Widget Corporation",  "ClientReference": "1024",  "DefaultContactId": null,  "DefaultContact": null,  "DefaultContactFullName": null,  "IsFavorite": false,  "NumberOfProjects": 113,  "NumberOfTasks": 153,  "NumberOfMediaLogEntries": 28,  "NumberOfVolumes": 4,  "NumberOfBillingEntries": 127,  "NumberOfComments": 0,  "FirstProjectCreatedOnDate": "2016-05-06T09:16:24.7547481-05:00",  "LastProjectCreatedOnDate": "2025-09-16T14:54:33.328748+00:00",  "CreatedByFullName": "Max Miller",  "CreatedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",  "CreatedOn": "2016-04-20T20:46:30.9445059-05:00",  "CreatedBy": null,  "LastUpdatedByFullName": "Max Miller",  "LastUpdatedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",  "LastUpdatedOn": "2026-01-18T13:19:28.5548677+00:00",  "LastUpdatedBy": null,  "Fields": [    {      "FieldId": 19,      "ObjectId": 2,      "DataTypeId": 5,      "DataTypeName": "Yes or No Choice",      "Label": "ESI Protocol Attached",      "IsRequired": false,      "Position": 1,      "Guid": 1492029172604,      "IsSystemField": false,      "IsReferenceValue": false,      "DefaultValue": "false",      "CopyPreviousValueOnSaveAndNew": false,      "Value": {        "ObjectFieldValueId": 78,        "ObjectFieldId": 19,        "ObjectId": 2,        "PrimaryKeyId": 39,        "ValueAsString": null,        "ValueAsBoolean": true,        "ValueAsNumber": null,        "ValueAsDecimal": null,        "ValueAsDate": null,        "ReferenceObject": null      },      "ReferenceObject": null    },    {      "FieldId": 28,      "ObjectId": 2,      "DataTypeId": 2,      "DataTypeName": "Rich Text",      "Label": "Notes & Misc",      "IsRequired": false,      "Position": 4,      "Guid": 1531229623985,      "IsSystemField": false,      "IsReferenceValue": false,      "DefaultValue": null,      "CopyPreviousValueOnSaveAndNew": false,      "Value": {        "ObjectFieldValueId": 188,        "ObjectFieldId": 28,        "ObjectId": 2,        "PrimaryKeyId": 39,        "ValueAsString": "

This case will involve collections from multiple custodians across six offices in the U.S.

",        "ValueAsBoolean": null,        "ValueAsNumber": null,        "ValueAsDecimal": null,        "ValueAsDate": null,        "ReferenceObject": null      },      "ReferenceObject": null    },    {      "FieldId": 114,      "ObjectId": 2,      "DataTypeId": 10,      "DataTypeName": "Reference",      "Label": "Case Team",      "IsRequired": false,      "Position": 3,      "Guid": 5520776673362,      "IsSystemField": false,      "IsReferenceValue": false,      "DefaultValue": null,      "CopyPreviousValueOnSaveAndNew": false,      "Value": {        "ObjectFieldValueId": 2672,        "ObjectFieldId": 114,        "ObjectId": 2,        "PrimaryKeyId": 39,        "ValueAsString": null,        "ValueAsBoolean": null,        "ValueAsNumber": null,        "ValueAsDecimal": null,        "ValueAsDate": null,        "ReferenceObject": {          "ObjectFieldReferenceObjectInstanceId": 394,          "ObjectFieldValueId": 2672,          "ObjectId": 7,          "Object": null,          "PrimaryObjectId": 2,          "PrimaryKeyId": 39,          "KeyType": "Int32",          "DisplayFormat": "%Val%",          "IsSystemObject": true,          "Name": "Contact",          "NumberOfValues": 3,          "Values": [            {              "ObjectFieldReferenceObjectInstanceValueId": 260,              "ObjectFieldReferenceObjectInstanceId": 394,              "KeyAsString": null,              "KeyAsInteger": 3,              "KeyAsLong": null,              "Value": "Angela Baker "            },            {              "ObjectFieldReferenceObjectInstanceValueId": 261,              "ObjectFieldReferenceObjectInstanceId": 394,              "KeyAsString": null,              "KeyAsInteger": 12,              "KeyAsLong": null,              "Value": "Adele Butler "            },            {              "ObjectFieldReferenceObjectInstanceValueId": 262,              "ObjectFieldReferenceObjectInstanceId": 394,              "KeyAsString": null,              "KeyAsInteger": 31,              "KeyAsLong": null,              "Value": "Charlie Portal "            }          ]        }      },      "ReferenceObject": null    },    {      "FieldId": 121,      "ObjectId": 2,      "DataTypeId": 10,      "DataTypeName": "Reference",      "Label": "Production Specs",      "IsRequired": false,      "Position": 2,      "Guid": 9560134053881,      "IsSystemField": false,      "IsReferenceValue": false,      "DefaultValue": null,      "CopyPreviousValueOnSaveAndNew": false,      "Value": {        "ObjectFieldValueId": 2673,        "ObjectFieldId": 121,        "ObjectId": 2,        "PrimaryKeyId": 39,        "ValueAsString": null,        "ValueAsBoolean": null,        "ValueAsNumber": null,        "ValueAsDecimal": null,        "ValueAsDate": null,        "ReferenceObject": {          "ObjectFieldReferenceObjectInstanceId": 395,          "ObjectFieldValueId": 2673,          "ObjectId": 18,          "Object": null,          "PrimaryObjectId": 2,          "PrimaryKeyId": 39,          "KeyType": "Int32",          "DisplayFormat": "%Name%",          "IsSystemObject": false,          "Name": "Production Spec List",          "NumberOfValues": 1,          "Values": [            {              "ObjectFieldReferenceObjectInstanceValueId": 263,              "ObjectFieldReferenceObjectInstanceId": 395,              "KeyAsString": null,              "KeyAsInteger": 2,              "KeyAsLong": null,              "Value": "AGM v. MGM ESI Protocol"            }          ]        }      },      "ReferenceObject": null    },    {      "FieldId": 123,      "ObjectId": 2,      "DataTypeId": 10,      "DataTypeName": "Reference",      "Label": "Billing Attorney",      "IsRequired": false,      "Position": 0,      "Guid": 7396996255432,      "IsSystemField": false,      "IsReferenceValue": false,      "DefaultValue": null,      "CopyPreviousValueOnSaveAndNew": false,      "Value": {        "ObjectFieldValueId": 2675,        "ObjectFieldId": 123,        "ObjectId": 2,        "PrimaryKeyId": 39,        "ValueAsString": null,        "ValueAsBoolean": null,        "ValueAsNumber": null,        "ValueAsDecimal": null,        "ValueAsDate": null,        "ReferenceObject": {          "ObjectFieldReferenceObjectInstanceId": 397,          "ObjectFieldValueId": 2675,          "ObjectId": 7,          "Object": null,          "PrimaryObjectId": 2,          "PrimaryKeyId": 39,          "KeyType": "Int32",          "DisplayFormat": "%Val%",          "IsSystemObject": true,          "Name": "Contact",          "NumberOfValues": 2,          "Values": [            {              "ObjectFieldReferenceObjectInstanceValueId": 265,              "ObjectFieldReferenceObjectInstanceId": 397,              "KeyAsString": null,              "KeyAsInteger": 12,              "KeyAsLong": null,              "Value": "Adele Butler "            },            {              "ObjectFieldReferenceObjectInstanceValueId": 266,              "ObjectFieldReferenceObjectInstanceId": 397,              "KeyAsString": null,              "KeyAsInteger": 9,              "KeyAsLong": null,              "Value": "Ann McDonald "            }          ]        }      },      "ReferenceObject": null    }  ] } ```