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

# List Organization Assets

> List all assets belonging to your organization with optional filtering by type, group, and search query. Supports pagination.

## Overview

List all assets belonging to your organization with optional filtering by type, group, and search query. The organization is automatically inferred from your API key. This endpoint supports pagination for efficient handling of large asset collections.

## Quick Start

### Authentication

All organization endpoints require an API key with organization access. Include your API key in the `X-API-KEY` header:

```bash theme={null}
X-API-KEY: your_api_key_here
```

### Example Request

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await fetch(
    "https://app.chainpatrol.io/api/v2/organization/assets?type=URL&per_page=100",
    {
      method: "GET",
      headers: {
        "X-API-KEY": "YOUR_API_KEY_HERE",
      },
    }
  );

  const data = await response.json();
  console.log(data.assets);
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://app.chainpatrol.io/api/v2/organization/assets?type=URL&per_page=100",
    {
      method: "GET",
      headers: {
        "X-API-KEY": "YOUR_API_KEY_HERE",
      },
    }
  );

  const data = await response.json();
  console.log(data.assets);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://app.chainpatrol.io/api/v2/organization/assets",
      headers={
          "X-API-KEY": "YOUR_API_KEY_HERE",
      },
      params={
          "type": "URL",
          "per_page": 100,
      },
  )

  data = response.json()
  print(data["assets"])
  ```

  ```bash cURL theme={null}
  curl -X GET 'https://app.chainpatrol.io/api/v2/organization/assets?type=URL&per_page=100' \
    -H 'X-API-KEY: YOUR_API_KEY_HERE'
  ```
</CodeGroup>

## Query Parameters

| Parameter  | Type   | Required | Description                                                                                                                                                                        |
| ---------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| type       | string | No       | Filter by asset type: `URL`, `ADDRESS`, `PAGE`, `DISCORD`, `TELEGRAM`, `TWITTER`, `INSTAGRAM`, `MEDIUM`, `GITHUB`, `YOUTUBE`, `LINKEDIN`, `TWITCH`, `TIKTOK`, `EMAIL`              |
| groupId    | number | No       | Filter by group ID. Use `-1` for ungrouped assets only. Omit to include all assets regardless of group assignment.                                                                 |
| query      | string | No       | Search query to filter assets by content. Performs a case-insensitive search across asset content, name, and description fields.                                                   |
| per\_page  | number | No       | Number of assets to return per page. Valid range: 1-1000. Default: 100. Use larger values for bulk operations and smaller values for responsive UI pagination.                     |
| next\_page | string | No       | Cursor token for fetching the next page of results. This value is returned in the response when more results are available. Pass it in subsequent requests to continue pagination. |

## Response

### Success Response

```json theme={null}
{
  "assets": [
    {
      "id": 12345,
      "content": "https://example.com",
      "type": "URL",
      "status": "ALLOWED",
      "name": "Main Website",
      "description": "Our official website",
      "group": {
        "id": 1,
        "name": "URLs"
      },
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:30:00.000Z"
    },
    {
      "id": 12346,
      "content": "0x1234567890abcdef1234567890abcdef12345678",
      "type": "ADDRESS",
      "status": "ALLOWED",
      "name": "Treasury Wallet",
      "description": null,
      "group": null,
      "createdAt": "2024-01-15T11:00:00.000Z",
      "updatedAt": "2024-01-15T11:00:00.000Z"
    }
  ],
  "next_page": "12347"
}
```

### Response Fields

| Field                 | Type   | Description                                                                                   |
| --------------------- | ------ | --------------------------------------------------------------------------------------------- |
| assets                | array  | Array of asset objects belonging to your organization                                         |
| assets\[].id          | number | Unique identifier for the asset                                                               |
| assets\[].content     | string | The actual asset content (URL, address, handle, etc.)                                         |
| assets\[].type        | string | Asset type classification                                                                     |
| assets\[].status      | string | Asset status, typically `ALLOWED` for organization assets                                     |
| assets\[].name        | string | Display name for the asset (optional)                                                         |
| assets\[].description | string | Description of the asset (optional, can be null)                                              |
| assets\[].group       | object | Group object containing `id` and `name` if asset is assigned to a group, null if ungrouped    |
| assets\[].createdAt   | string | ISO 8601 timestamp when the asset was created                                                 |
| assets\[].updatedAt   | string | ISO 8601 timestamp when the asset was last updated                                            |
| next\_page            | string | Cursor token for the next page of results. Undefined/null when no more results are available. |

## Pagination

To fetch all assets, use the `next_page` cursor returned in each response:

<CodeGroup>
  ```typescript TypeScript theme={null}
  async function fetchAllAssets() {
    let allAssets = [];
    let nextPage: string | undefined = undefined;

    while (true) {
      const params = new URLSearchParams({
        per_page: "500",
        ...(nextPage && { next_page: nextPage }),
      });

      const response = await fetch(
        `https://app.chainpatrol.io/api/v2/organization/assets?${params}`,
        {
          method: "GET",
          headers: {
            "X-API-KEY": "YOUR_API_KEY_HERE",
          },
        }
      );

      const data = await response.json();
      allAssets = allAssets.concat(data.assets);
      nextPage = data.next_page;

      if (!nextPage) {
        break;
      }
    }

    return allAssets;
  }

  fetchAllAssets()
    .then((assets) => console.log(`Total assets: ${assets.length}`))
    .catch((error) => console.error("Error:", error));
  ```

  ```javascript JavaScript theme={null}
  async function fetchAllAssets() {
    let allAssets = [];
    let nextPage = undefined;

    while (true) {
      const params = new URLSearchParams({
        per_page: "500",
        ...(nextPage && { next_page: nextPage }),
      });

      const response = await fetch(
        `https://app.chainpatrol.io/api/v2/organization/assets?${params}`,
        {
          method: "GET",
          headers: {
            "X-API-KEY": "YOUR_API_KEY_HERE",
          },
        }
      );

      const data = await response.json();
      allAssets = allAssets.concat(data.assets);
      nextPage = data.next_page;

      if (!nextPage) {
        break;
      }
    }

    return allAssets;
  }

  fetchAllAssets()
    .then((assets) => console.log(`Total assets: ${assets.length}`))
    .catch((error) => console.error("Error:", error));
  ```

  ```python Python theme={null}
  import requests

  def fetch_all_assets():
      all_assets = []
      next_page = None

      while True:
          params = {"per_page": 500}
          if next_page:
              params["next_page"] = next_page

          response = requests.get(
              "https://app.chainpatrol.io/api/v2/organization/assets",
              headers={"X-API-KEY": "YOUR_API_KEY_HERE"},
              params=params,
          )

          data = response.json()
          all_assets.extend(data["assets"])
          next_page = data.get("next_page")

          if not next_page:
              break

      return all_assets

  try:
      assets = fetch_all_assets()
      print(f"Total assets: {len(assets)}")
  except Exception as error:
      print(f"Error: {str(error)}")
  ```
</CodeGroup>

## Filtering Examples

### Filter by Type

Get only URL assets:

```bash theme={null}
curl -X GET 'https://app.chainpatrol.io/api/v2/organization/assets?type=URL' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'
```

### Filter by Group

Get assets in a specific group:

```bash theme={null}
curl -X GET 'https://app.chainpatrol.io/api/v2/organization/assets?groupId=1' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'
```

Get only ungrouped assets:

```bash theme={null}
curl -X GET 'https://app.chainpatrol.io/api/v2/organization/assets?groupId=-1' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'
```

### Search Assets

Search for assets containing "wallet":

```bash theme={null}
curl -X GET 'https://app.chainpatrol.io/api/v2/organization/assets?query=wallet' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'
```

### Combine Filters

Get URL assets in group 1 containing "main":

```bash theme={null}
curl -X GET 'https://app.chainpatrol.io/api/v2/organization/assets?type=URL&groupId=1&query=main' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'
```

## Error Responses

### 401 Unauthorized

Returned when the API key is missing, invalid, or doesn't have organization access:

```json theme={null}
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "API key with organization access required"
  }
}
```

### 400 Bad Request

Returned when query parameters are invalid:

```json theme={null}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "Invalid asset type provided"
  }
}
```

## Best Practices

### Pagination

* Use `per_page=500` or higher for bulk operations to minimize API calls
* Use `per_page=50-100` for UI pagination for responsive user experience
* Always check for `next_page` in the response to determine if more results exist

### Filtering

* Apply filters server-side rather than fetching all assets and filtering client-side
* Combine filters to narrow down results efficiently
* Use the `query` parameter for user-driven search features

### Performance

* Cache asset lists when appropriate to reduce API calls
* Use appropriate `per_page` values based on your use case
* Consider implementing incremental loading for large datasets

## Notes

* Organization is automatically determined from your API key
* All timestamps are in ISO 8601 format with UTC timezone
* Asset `status` for organization assets is typically `ALLOWED`
* The `group` field is `null` when an asset is not assigned to any group
* The `next_page` cursor is opaque and should not be parsed or modified


## OpenAPI

````yaml GET /organization/assets
openapi: 3.0.3
info:
  title: ChainPatrol External API - OpenAPI 3.0
  description: ChainPatrol External API documentation
  version: 2.0.0
servers:
  - url: https://app.chainpatrol.io/api/v2
security: []
tags:
  - name: asset
  - name: report
externalDocs:
  url: https://chainpatrol.com/docs
paths:
  /organization/assets:
    get:
      tags:
        - organization
      summary: List organization assets
      description: >-
        List all assets belonging to your organization with optional filtering
        by type, group, and search query. Supports pagination.
      operationId: organizationAssetsList
      parameters:
        - in: query
          name: type
          schema:
            type: string
            enum:
              - URL
              - PAGE
              - ADDRESS
              - DISCORD
              - LINKEDIN
              - TWITTER
              - FACEBOOK
              - YOUTUBE
              - REDDIT
              - TELEGRAM
              - GOOGLE_APP_STORE
              - APPLE_APP_STORE
              - AMAZON_APP_STORE
              - MICROSOFT_APP_STORE
              - TIKTOK
              - INSTAGRAM
              - THREADS
              - MEDIUM
              - CHROME_WEB_STORE
              - MOZILLA_ADDONS
              - OPERA_ADDONS
              - EMAIL
              - PATREON
              - OPENSEA
              - FARCASTER
              - IPFS
              - GOOGLE_FORM
              - WHATSAPP
              - DISCORD_USER
              - QUORA
              - GITHUB
              - TEACHABLE
              - SUBSTACK
              - DEBANK
              - TAWK_TO
              - JOTFORM
              - PRIMAL
              - BLUESKY
              - SNAPCHAT
              - DESO
              - PINTEREST
              - FLICKR
              - GALXE
              - VELOG
              - NPM
              - PYPI
              - HEX
              - DOCKER_HUB
              - VOCAL_MEDIA
              - TECKFINE
              - TENDERLY
              - HACKMD
              - ETSY
              - ZAZZLE
              - BASENAME
              - BILIBILI_TV
              - VIMEO
              - DAILYMOTION
              - PHONE_NUMBER
              - SLACK
              - CALENDLY
              - NGROK
              - RARIBLE
              - RUST_PACKAGE
              - FLATHUB
              - VIDLII
              - VEVIOZ
              - ISSUU
              - SOUNDCLOUD
              - ZAPPER
              - REDNOTE
              - SAMSUNG_APP_STORE
              - HUAWEI_APP_STORE
              - XIAOMI_APP_STORE
              - TENCENT_APP_STORE
              - OPPO_APP_STORE
              - VIVO_APP_STORE
              - F_DROID
              - GOOGLE_AD
              - BING_AD
              - TWITCH
              - BEHANCE
              - ZORA
              - META_AD
              - SIGNAL
              - DEVIANTART
              - BANDCAMP
              - ARCHIVE_ORG
              - FIVE_HUNDRED_PX
        - in: query
          name: groupId
          schema:
            type: integer
        - in: query
          name: query
          schema:
            type: string
        - in: query
          name: per_page
          description: The number of assets to return per page (max 1000)
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 100
        - in: query
          name: next_page
          description: Cursor for fetching the next page of results
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  assets:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                        content:
                          type: string
                        type:
                          type: string
                          enum:
                            - URL
                            - PAGE
                            - ADDRESS
                            - DISCORD
                            - LINKEDIN
                            - TWITTER
                            - FACEBOOK
                            - YOUTUBE
                            - REDDIT
                            - TELEGRAM
                            - GOOGLE_APP_STORE
                            - APPLE_APP_STORE
                            - AMAZON_APP_STORE
                            - MICROSOFT_APP_STORE
                            - TIKTOK
                            - INSTAGRAM
                            - THREADS
                            - MEDIUM
                            - CHROME_WEB_STORE
                            - MOZILLA_ADDONS
                            - OPERA_ADDONS
                            - EMAIL
                            - PATREON
                            - OPENSEA
                            - FARCASTER
                            - IPFS
                            - GOOGLE_FORM
                            - WHATSAPP
                            - DISCORD_USER
                            - QUORA
                            - GITHUB
                            - TEACHABLE
                            - SUBSTACK
                            - DEBANK
                            - TAWK_TO
                            - JOTFORM
                            - PRIMAL
                            - BLUESKY
                            - SNAPCHAT
                            - DESO
                            - PINTEREST
                            - FLICKR
                            - GALXE
                            - VELOG
                            - NPM
                            - PYPI
                            - HEX
                            - DOCKER_HUB
                            - VOCAL_MEDIA
                            - TECKFINE
                            - TENDERLY
                            - HACKMD
                            - ETSY
                            - ZAZZLE
                            - BASENAME
                            - BILIBILI_TV
                            - VIMEO
                            - DAILYMOTION
                            - PHONE_NUMBER
                            - SLACK
                            - CALENDLY
                            - NGROK
                            - RARIBLE
                            - RUST_PACKAGE
                            - FLATHUB
                            - VIDLII
                            - VEVIOZ
                            - ISSUU
                            - SOUNDCLOUD
                            - ZAPPER
                            - REDNOTE
                            - SAMSUNG_APP_STORE
                            - HUAWEI_APP_STORE
                            - XIAOMI_APP_STORE
                            - TENCENT_APP_STORE
                            - OPPO_APP_STORE
                            - VIVO_APP_STORE
                            - F_DROID
                            - GOOGLE_AD
                            - BING_AD
                            - TWITCH
                            - BEHANCE
                            - ZORA
                            - META_AD
                            - SIGNAL
                            - DEVIANTART
                            - BANDCAMP
                            - ARCHIVE_ORG
                            - FIVE_HUNDRED_PX
                        status:
                          type: string
                          enum:
                            - UNKNOWN
                            - ALLOWED
                            - BLOCKED
                        name:
                          type: string
                          nullable: true
                        description:
                          type: string
                          nullable: true
                        group:
                          type: object
                          nullable: true
                          properties:
                            id:
                              type: number
                            name:
                              type: string
                          required:
                            - id
                            - name
                        createdAt:
                          type: string
                        updatedAt:
                          type: string
                      required:
                        - id
                        - content
                        - type
                        - status
                        - name
                        - description
                        - group
                        - createdAt
                        - updatedAt
                  next_page:
                    type: string
                    nullable: true
                required:
                  - assets
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.NOT_FOUND'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
      security:
        - ApiKey: []
components:
  schemas:
    error.BAD_REQUEST:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Invalid input data
        code:
          type: string
          description: The error code
          example: BAD_REQUEST
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Invalid input data error (400)
      description: The error information
      example:
        code: BAD_REQUEST
        message: Invalid input data
        issues: []
    error.UNAUTHORIZED:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Authorization not provided
        code:
          type: string
          description: The error code
          example: UNAUTHORIZED
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Authorization not provided error (401)
      description: The error information
      example:
        code: UNAUTHORIZED
        message: Authorization not provided
        issues: []
    error.FORBIDDEN:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Insufficient access
        code:
          type: string
          description: The error code
          example: FORBIDDEN
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Insufficient access error (403)
      description: The error information
      example:
        code: FORBIDDEN
        message: Insufficient access
        issues: []
    error.NOT_FOUND:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Not found
        code:
          type: string
          description: The error code
          example: NOT_FOUND
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Not found error (404)
      description: The error information
      example:
        code: NOT_FOUND
        message: Not found
        issues: []
    error.INTERNAL_SERVER_ERROR:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Internal server error
        code:
          type: string
          description: The error code
          example: INTERNAL_SERVER_ERROR
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Internal server error error (500)
      description: The error information
      example:
        code: INTERNAL_SERVER_ERROR
        message: Internal server error
        issues: []
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Your API key. This is required by most endpoints to access our API
        programatically. Reach out to us at
        [support@chainpatrol.io](mailto:support@chainpatrol.io?subject=Re:%20API%20Key%20for%20SDK&body=Company:%20%0AName:%20%0APurpose:%20)
        to get an API key for your use.

````