--- title: "Get-RelativityWorkspaces" slug: "scripting-get-relativityworkspaces" updated: 2024-09-23T12:27:40Z published: 2024-09-23T12:27:40Z canonical: "help.agilityblue.com/scripting-get-relativityworkspaces" --- > ## 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-RelativityWorkspaces > [!NOTE] > Relativity Integration Required > > This cmdlet requires a valid Relativity integration in order to work. See the [Relativity integration](/v1/docs/relativity-integration) documentation to learn how to set up the integration. ## Summary Gets an array of Relativity workspaces from a connected Relativity integration. ```powershell Get-RelativityWorkspaces    -IntegrationId    -Raw ``` Returns an array of Relativity workspace objects. > [!NOTE] > **Model** > > This cmdlet returns the following fields from Relativity for this object: > > - ArtifactID (int) > - Name (string) > > **The cmdlet cannot be customized to return any other fields.** > [!WARNING] > Modern APIs Only > > This cmdlet will only work with integrations that have the “Use Modern Relativity Apis” switch applied for their configuration. ## Parameters | Parameter | Type | Required? | Notes | | --- | --- | --- | --- | | IntegrationId | Int32 | Yes | The integration id. | | Raw | Switch | No, defaults to `false` | If set to `true`, the cmdlet will provide the raw response from Relativity rather than an array of workspace objects. The content will be encoded as a Base64 string. Setting this switch is only useful if you are trying to troubleshoot a response that Relativity provided. | ## Examples ### Get a list of Relativity workspaces from Relativity ```powershell # Get a specific integration based on the Relativity identifier (url) # $relativityUrl = "https://my-company.relativity.one" $integrations = Get-Integrations `    -Filter "Name eq 'Relativity' and startswith(Identifier,'$relativityUrl')" $relativityIntegration = $integrations.Collection | Select-Object -First 1 if ($null -eq $relativityIntegration) {    Write-Error "Unable to find a Relativity integration with the identifier `"$relativityIdentifier`""    exit } $result = Get-RelativityWorkspaces `    -IntegrationId $relativityIntegration.IntegrationId $result | ConvertTo-Json -Depth 10 ``` Output of this script: ```plaintext [  {    "ArtifactID": 9021563,    "Name": "Salt v Pepper ECA"  },  {    "ArtifactID": 9021564,    "Name": "Salt v Pepper Review"  } ] ```