> ## Documentation Index
> Fetch the complete documentation index at: https://thehyperstack.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Credentials

### Description

This endpoint allows you to **search and filter credentials** based on recipient details, group key, credential key, custom attributes, date range, and pagination.

### Headers

<ParamField header="Authorization" type="string" required="true">
  Bearer YOUR\_API\_TOKEN — obtainable from **Hyperstack Dashboard → Settings → API Access**
</ParamField>

### Body Parameters

<ParamField body="recipient" type="object" required="false">
  Filter by recipient details. Can include:

  <ul>
    <li><code>name</code> — recipient's name (partial match)</li>
    <li><code>email</code> — recipient's email (partial match)</li>
  </ul>
</ParamField>

<ParamField body="group_key" type="string" required="false">
  Filter credentials by credential group key (partial match).
</ParamField>

<ParamField body="credential_key" type="string" required="false">
  Filter by a specific credential key (partial match).
</ParamField>

<ParamField body="custom_attributes" type="object" required="false">
  Filter by custom attributes stored with the credentials.
</ParamField>

<ParamField body="start_date" type="string" required="false">
  Filter credentials issued on or after this date. Format: `YYYY/MM/DD`.
</ParamField>

<ParamField body="end_date" type="string" required="false">
  Filter credentials issued on or before this date. Format: `YYYY/MM/DD`. Must be used together with `start_date`.
</ParamField>

<ParamField body="page" type="number" required="false">
  The page number for pagination (default is 1).
</ParamField>

<ParamField body="page_size" type="number" required="false">
  The number of credentials to return per page (default is 50).
</ParamField>

### Success Response Fields

<ResponseField name="success" type="boolean">
  Indicates whether the credential search was successful.
</ResponseField>

<ResponseField name="credentials" type="array[object]">
  An array of credential objects matching the search criteria. Each object contains the same fields as the View Credential response.
</ResponseField>

<ResponseField name="total" type="number">
  Total number of credentials matching the search criteria.
</ResponseField>

<ResponseField name="page" type="number">
  Current page number.
</ResponseField>

<ResponseField name="page_size" type="number">
  Number of credentials returned per page.
</ResponseField>

### Responses

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "success": true,
    "total": 1,
    "page": 1,
    "page_size": 50,
    "credentials": [
      {
        "document_id": "j4nDvaxF6ehodPXI84p4X1yhQe7lrYgx",
        "document_url": "https://hyperstack.id/credential/j4nDvaxF6ehodPXI84p4X1yhQe7lrYgx",
        "recipient": { "name": "John Doe", "email": "john@example.com" },
        "group": { "title": "Cloud Certification", "key": "GcI6H5b66a3v", "code": "CC-2024" },
        "issued_on": "2024-03-15T10:30:00Z",
        "valid_until": null,
        "metadata": { "custom_location": "Mars" },
        "status": "active",
        "privacy": "public"
      }
    ]
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "detail": "Invalid token or organization not found"
  }
  ```
</ResponseExample>
