---
title: Read Statement Dependencies
description: The GET /v2/policy-manager/statements/{{statementId}}/dependencies operation returns the dependencies of the statement identified by {{statementId}}. The request must provide either a branch ID or a snapshot ID in the request URL to specify where the statement and its dependencies should be read from.
component: pingauthorize
page_id: pingauthorize:pingauthorize:policy-editor/policy-manager/statements/read-statement-dependencies
canonical_url: https://developer.pingidentity.com/pingauthorize/pingauthorize/policy-editor/policy-manager/statements/read-statement-dependencies.html
section_ids:
  prerequisites: Prerequisites
  headers: Headers
  example-request: Example Request
  example-response: Example Response
---

# Read Statement Dependencies

##

```none
GET {{apiPath}}/v2/policy-manager/statements/{{statementId}}/dependencies?branch={{branchId}}
```

The `GET /v2/policy-manager/statements/{{statementId}}/dependencies` operation returns the dependencies of the statement identified by `{{statementId}}`. The request must provide either a branch ID or a snapshot ID in the request URL to specify where the statement and its dependencies should be read from.

### Prerequisites

* [Create a branch](../../version-control/snapshot-management/create-child-branch-from-snapshot.html) to get a branch ID.

* [Create a snapshot](../../version-control/branch-manager/create-snapshot.html) to get a snapshot ID.

> **Collapse: Query parameters**
>
> | Query parameter                    | Description                                                                                |
> | ---------------------------------- | ------------------------------------------------------------------------------------------ |
> | `branch`                           | Branch ID or name.                                                                         |
> | `snapshot`                         | Snapshot ID.                                                                               |
> | `page`                             | Specifies the page number of results to return.                                            |
> | `page-size`                        | Specifies the number of results to return per page.                                        |
> | `depth`                            | Specifies the maximum dependency recursion depth.                                          |
> | `includeDependenciesOfDefinitions` | Specifies whether to include dependencies of definitions or not. Default value is `false`. |

### Headers

x-user-id      {{userId}}

##

### Example Request

* cURL

* C#

* Go

* HTTP

* Java

* jQuery

* NodeJS

* Python

* PHP

* Ruby

* Swift

```shell
curl --location --globoff '{{apiPath}}/v2/policy-manager/statements/{{statementId}}/dependencies?branch={{branchId}}' \
--header 'x-user-id: {{userId}}'
```

```csharp
var options = new RestClientOptions("{{apiPath}}/v2/policy-manager/statements/{{statementId}}/dependencies?branch={{branchId}}")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("x-user-id", "{{userId}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
```

```golang
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {

  url := "{{apiPath}}/v2/policy-manager/statements/{{statementId}}/dependencies?branch={{branchId}}"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("x-user-id", "{{userId}}")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

```http
GET /v2/policy-manager/statements/{{statementId}}/dependencies?branch={{branchId}} HTTP/1.1
Host: {{apiPath}}
x-user-id: {{userId}}
```

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("{{apiPath}}/v2/policy-manager/statements/{{statementId}}/dependencies?branch={{branchId}}")
  .method("GET", body)
  .addHeader("x-user-id", "{{userId}}")
  .build();
Response response = client.newCall(request).execute();
```

```javascript
var settings = {
  "url": "{{apiPath}}/v2/policy-manager/statements/{{statementId}}/dependencies?branch={{branchId}}",
  "method": "GET",
  "timeout": 0,
  "headers": {
    "x-user-id": "{{userId}}"
  },
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
```

```javascript
var request = require('request');
var options = {
  'method': 'GET',
  'url': '{{apiPath}}/v2/policy-manager/statements/{{statementId}}/dependencies?branch={{branchId}}',
  'headers': {
    'x-user-id': '{{userId}}'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

```python
import requests

url = "{{apiPath}}/v2/policy-manager/statements/{{statementId}}/dependencies?branch={{branchId}}"

payload = {}
headers = {
  'x-user-id': '{{userId}}'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
```

```php
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiPath}}/v2/policy-manager/statements/{{statementId}}/dependencies?branch={{branchId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'x-user-id' => '{{userId}}'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
```

```ruby
require "uri"
require "net/http"

url = URI("{{apiPath}}/v2/policy-manager/statements/{{statementId}}/dependencies?branch={{branchId}}")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["x-user-id"] = "{{userId}}"

response = http.request(request)
puts response.read_body
```

```swift
var request = URLRequest(url: URL(string: "{{apiPath}}/v2/policy-manager/statements/{{statementId}}/dependencies?branch={{branchId}}")!,timeoutInterval: Double.infinity)
request.addValue("{{userId}}", forHTTPHeaderField: "x-user-id")

request.httpMethod = "GET"

let task = URLSession.shared.dataTask(with: request) { data, response, error in
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()
```

### Example Response

200 OK

```json
{
    "pagination": {
        "page": 1,
        "pageSize": 100,
        "totalItems": 3,
        "totalPages": 1
    },
    "data": [
        {
            "id": "b6f2a432-e405-4aeb-b216-43542913fd79",
            "version": "82699c2b-d776-4a6d-8c4d-b5214e75b683",
            "type": "Statement",
            "name": "example-statement-with-dependencies",
            "description": "",
            "shared": true,
            "code": "denied-reason",
            "appliesTo": "ANYTHING",
            "appliesIf": "PATH_MATCHES",
            "payload": "example-payload",
            "obligatory": false,
            "permissions": {
                "inherit": true,
                "rolePermissions": []
            },
            "attributes": [
                "3577dd53-a71a-4ce8-ab40-c9c083c7c5b9"
            ],
            "services": [
                "25769e5c-5b33-4daf-9780-3e09b6f32207"
            ]
        },
        {
            "id": "3577dd53-a71a-4ce8-ab40-c9c083c7c5b9",
            "version": "e8bb2fb0-efc5-40ca-9e1f-e93cf1ae05be",
            "type": "ATTRIBUTE",
            "name": "TokenOwner",
            "fullName": "TokenOwner",
            "description": "If the request is authorized with a user access token, this is a JSON object representing the authenticated user that owns the access token.   Will not be present for client-credentials access tokens.  The fields of this JSON object depend upon the schema defined for the user record.",
            "parentId": null,
            "numberOfChildren": 2,
            "valueType": "JSON",
            "defaultValue": null,
            "repetitionSource": null,
            "cacheConfig": {
                "timeToLive": 0,
                "scopeAttributeId": null,
                "strategy": "NO_CACHING"
            },
            "secret": false,
            "permissions": {
                "inherit": true,
                "rolePermissions": []
            },
            "resolvers": [
                {
                    "attributeResolverType": "request",
                    "condition": null,
                    "valueProcessor": null,
                    "name": null
                }
            ],
            "querySettings": null,
            "valueProcessor": null,
            "properties": []
        },
        {
            "id": "25769e5c-5b33-4daf-9780-3e09b6f32207",
            "version": "5111cf16-8349-4880-a643-a42283996f62",
            "type": "SERVICE",
            "name": "PDP",
            "fullName": "PDP",
            "description": "PDP API endpoint service for directly requesting policy decisions from the PingAuthorize policy engine using XACML-JSON.",
            "parentId": null,
            "numberOfChildren": 0,
            "valueType": "STRING",
            "serviceType": "NONE",
            "secret": false,
            "permissions": {
                "inherit": true,
                "rolePermissions": []
            },
            "serviceSettings": {
                "serviceSettingsType": "ServiceSettings",
                "maximumConcurrentRequests": 2,
                "maximumRequestsPerSecond": 1000000,
                "retryStrategy": "BACKOFF",
                "timeout": 2000,
                "retries": 2,
                "holdoff": 1000,
                "retryJitter": 10,
                "description": null,
                "holdoffMultiplier": 2,
                "definitions": []
            },
            "cacheSettings": null,
            "valueProcessor": null,
            "properties": []
        }
    ]
}
```
