> This page is for Applications Protection.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.humansecurity.com/llms.txt.

# Get header inventory

GET https://api-gw.perimeterx.com/v1/pci/inventory/headers

Returns a list of the PCI DSS payment page header inventory for the given Application ID and host domain. Headers must exceed HUMAN's internal appearance threshold before they are introduced into the system and appear in the response. This prevents testing and low volume data from interfering with data quality.

Reference: https://docs.humansecurity.com/applications/reference/get-header-inventory

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `appId` (list of string, required) — An array of Application IDs to filter the relevant headers by. At least one ID is required.
- `tld` (list of string, required) — An array of host domains to filter the relevant headers by. At least one domain is required.
- `excludedStatuses` (list of enum, optional) — An array of script statuses that should be excluded from the results.
  - Allowed values: `authorized`, `in_progress`, `unreviewed`
- `from` (integer, optional) — A timestamp, in milliseconds, indicating from what point in time to filter the results by. If omitted, defaults to the **later** time between the following: 1. The last time [script grouping](/applications/cd-glossary#grouping) was performed plus one hour. 2. One year ago. Further, if a value is provided and it is **earlier** than the default calculated by the above logic, then the default will be used instead.
- `to` (integer, optional) — A timestamp, in milliseconds, indicating until what point in time to filter the results by. Defaults to the current time.
- `skip` (integer, optional, default: 0) — The number of headers to offset pagination by when returning the results.
- `take` (integer, optional, default: 20) — The number of headers to display per page when returning the results.

## Response

### 200

Success

- `paging` (GetHeaderInventoryPaging, optional)
- `data` (list of GetHeaderInventoryDataItems, optional)

## Errors

### 401 Unauthorized Error

Access token is missing or invalid.

- `any`

### 422 Unprocessable Entity Error

Invalid or missing parameters.

- `any`

### 500 Internal Server Error

Internal error. Contact HUMAN if the error persists.

- `any`

## Types

### GetHeaderInventoryPaging

- `previous` (string, optional)
- `current` (string, optional)
- `next` (string, optional)
- `count` (integer, optional)

### GetHeaderInventoryDataItems

- `app_id` (string, optional)
- `host_domain` (string, optional)
- `page` (string, optional)
- `page_key` (string, optional)
- `name` (string, optional)
- `unreviewed_values` (list of string, optional)
- `first_seen` (string, optional)
- `last_seen` (string, optional)
- `status` (string, optional)
- `status_category` (string, optional)

## Examples

**Response**

```json
{
  "paging": {
    "previous": "",
    "current": "https://localhost:80/v1/pci/inventory/headers?appId=PXabcd1234&tld=humansecurity.com&take=20&skip=0",
    "next": "",
    "count": 31
  },
  "data": [
    {
      "app_id": "PXabcd1234",
      "host_domain": "domain.com",
      "page": "https://cd.humansecurity.com/checkout.html",
      "page_key": "ac3887f3e1163d14c98609fd516be517",
      "name": "content-security-policy",
      "unreviewed_values": [
        "connect-src 'self' b.px-cdn.net https://*.px-cloud.net https://api-js.mixpanel.com/track/;"
      ],
      "first_seen": "2023-08-31T12:00:01.425Z",
      "last_seen": "2024-08-13T16:00:05.471Z",
      "status": "unreviewed",
      "status_category": "unreviewed"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api-gw.perimeterx.com/v1/pci/inventory/headers"

querystring = {"appId":"[\"PXabc123\",\"PXdef456\"]","excludedStatuses":"[\"authorized\",\"in_progress\"]","from":"1674313200000","skip":"40","take":"10","tld":"[\"domain1.com\",\"domain2.com\"]","to":"1674313200000"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api-gw.perimeterx.com/v1/pci/inventory/headers?appId=%5B%22PXabc123%22%2C%22PXdef456%22%5D&excludedStatuses=%5B%22authorized%22%2C%22in_progress%22%5D&from=1674313200000&skip=40&take=10&tld=%5B%22domain1.com%22%2C%22domain2.com%22%5D&to=1674313200000';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api-gw.perimeterx.com/v1/pci/inventory/headers?appId=%5B%22PXabc123%22%2C%22PXdef456%22%5D&excludedStatuses=%5B%22authorized%22%2C%22in_progress%22%5D&from=1674313200000&skip=40&take=10&tld=%5B%22domain1.com%22%2C%22domain2.com%22%5D&to=1674313200000"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api-gw.perimeterx.com/v1/pci/inventory/headers?appId=%5B%22PXabc123%22%2C%22PXdef456%22%5D&excludedStatuses=%5B%22authorized%22%2C%22in_progress%22%5D&from=1674313200000&skip=40&take=10&tld=%5B%22domain1.com%22%2C%22domain2.com%22%5D&to=1674313200000")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api-gw.perimeterx.com/v1/pci/inventory/headers?appId=%5B%22PXabc123%22%2C%22PXdef456%22%5D&excludedStatuses=%5B%22authorized%22%2C%22in_progress%22%5D&from=1674313200000&skip=40&take=10&tld=%5B%22domain1.com%22%2C%22domain2.com%22%5D&to=1674313200000")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-gw.perimeterx.com/v1/pci/inventory/headers?appId=%5B%22PXabc123%22%2C%22PXdef456%22%5D&excludedStatuses=%5B%22authorized%22%2C%22in_progress%22%5D&from=1674313200000&skip=40&take=10&tld=%5B%22domain1.com%22%2C%22domain2.com%22%5D&to=1674313200000', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api-gw.perimeterx.com/v1/pci/inventory/headers?appId=%5B%22PXabc123%22%2C%22PXdef456%22%5D&excludedStatuses=%5B%22authorized%22%2C%22in_progress%22%5D&from=1674313200000&skip=40&take=10&tld=%5B%22domain1.com%22%2C%22domain2.com%22%5D&to=1674313200000");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-gw.perimeterx.com/v1/pci/inventory/headers?appId=%5B%22PXabc123%22%2C%22PXdef456%22%5D&excludedStatuses=%5B%22authorized%22%2C%22in_progress%22%5D&from=1674313200000&skip=40&take=10&tld=%5B%22domain1.com%22%2C%22domain2.com%22%5D&to=1674313200000")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```