> ## 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.

# Listar assets de la organización

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

## Descripción general

Lista todos los assets (**Asset**: activo digital, como una URL, dirección, perfil, app, etc.) que pertenecen a tu organización, con filtros opcionales por tipo, grupo y consulta de búsqueda. La organización se infiere automáticamente a partir de tu clave de API. Este endpoint admite paginación para manejar de forma eficiente colecciones grandes de assets.

## Inicio rápido

### Autenticación

Todos los endpoints de organización requieren una clave de API con acceso a la organización. Incluye tu clave de API en el encabezado `X-API-KEY`:

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

### Solicitud de ejemplo

```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'
```

## Parámetros de consulta

| Parámetro | Tipo | Obligatorio | Descripción |
| - | - | - | - |
| type | string | No | Filtra por tipo de asset: `URL`, `ADDRESS`, `PAGE`, `DISCORD`, `TELEGRAM`, `TWITTER`, `INSTAGRAM`, `MEDIUM`, `GITHUB`, `YOUTUBE`, `LINKEDIN`, `TWITCH`, `TIKTOK`, `EMAIL` |
| groupId | number | No | Filtra por ID de grupo. Usa `-1` para obtener solo los assets sin grupo. Omítelo para incluir todos los assets, sin importar a qué grupo estén asignados. |
| query | string | No | Consulta de búsqueda para filtrar assets por contenido. Realiza una búsqueda que no distingue entre mayúsculas y minúsculas en los campos de contenido, nombre y descripción del asset. |
| per\_page | number | No | Cantidad de assets que se devuelven por página. Rango válido: 1-1000. Valor predeterminado: 100. Usa valores más grandes para operaciones masivas y valores más pequeños para una paginación ágil en la interfaz. |
| next\_page | string | No | Token de cursor para obtener la siguiente página de resultados. Este valor se devuelve en la respuesta cuando hay más resultados disponibles. Pásalo en las solicitudes siguientes para continuar la paginación. |

## Respuesta

### Respuesta exitosa

```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",
      "allowlistExpiresAt": null,
      "allowlistExpiredAt": null
    },
    {
      "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",
      "allowlistExpiresAt": "2025-01-15T23:59:59.999Z",
      "allowlistExpiredAt": null
    }
  ],
  "next_page": "12347"
}
```

### Campos de la respuesta

| Campo | Tipo | Descripción |
| - | - | - |
| assets | array | Arreglo de objetos de asset que pertenecen a tu organización |
| assets\[].id | number | Identificador único del asset |
| assets\[].content | string | El contenido real del asset (URL, dirección, handle, etc.) |
| assets\[].type | string | Clasificación del tipo de asset |
| assets\[].status | string | Estado del asset, normalmente `ALLOWED` para los assets de la organización |
| assets\[].name | string | Nombre visible del asset (opcional) |
| assets\[].description | string | Descripción del asset (opcional, puede ser null) |
| assets\[].group | object | Objeto de grupo que contiene `id` y `name` si el asset está asignado a un grupo; null si no tiene grupo |
| assets\[].createdAt | string | Marca de tiempo ISO 8601 del momento en que se creó el asset |
| assets\[].updatedAt | string | Marca de tiempo ISO 8601 del momento en que se actualizó el asset por última vez |
| assets\[].allowlistExpiresAt | string | Marca de tiempo ISO 8601 del momento en que vence la entrada del asset en la **Allowlist** (lista de permitidos). `null` cuando nunca vence. Consulta [Definir vencimiento de assets de la organización](https://chainpatrol.com/docs/es/external-api/organization-assets-expiry.md) |
| assets\[].allowlistExpiredAt | string | Marca de tiempo ISO 8601 del momento en que pasó el vencimiento y comenzó el período de gracia de 14 días. `null` hasta entonces |
| next\_page | string | Token de cursor para la siguiente página de resultados. Undefined/null cuando no hay más resultados disponibles. |

## Paginación

Para obtener todos los assets, usa el cursor `next_page` que se devuelve en cada respuesta:

```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)}")
```

## Ejemplos de filtrado

### Filtrar por tipo

Obtén solo los assets de tipo URL:

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

### Filtrar por grupo

Obtén los assets de un grupo específico:

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

Obtén solo los assets sin grupo:

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

### Buscar assets

Busca assets que contengan "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'
```

### Combinar filtros

Obtén los assets de tipo URL del grupo 1 que contengan "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'
```

## Respuestas de error

### 401 Unauthorized

Se devuelve cuando falta la clave de API, no es válida o no tiene acceso a la organización:

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

### 400 Bad Request

Se devuelve cuando los parámetros de consulta no son válidos:

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

## Buenas prácticas

### Paginación

* Usa `per_page=500` o más para operaciones masivas, a fin de minimizar las llamadas a la API
* Usa `per_page=50-100` para la paginación en la interfaz, a fin de ofrecer una experiencia de usuario ágil
* Revisa siempre si la respuesta incluye `next_page` para determinar si hay más resultados

### Filtrado

* Aplica los filtros del lado del servidor en lugar de obtener todos los assets y filtrarlos del lado del cliente
* Combina filtros para acotar los resultados de forma eficiente
* Usa el parámetro `query` para funciones de búsqueda impulsadas por el usuario

### Rendimiento

* Guarda en caché las listas de assets cuando corresponda para reducir las llamadas a la API
* Usa valores de `per_page` adecuados según tu caso de uso
* Considera implementar una carga incremental para conjuntos de datos grandes

## Notas

* La organización se determina automáticamente a partir de tu clave de API
* Todas las marcas de tiempo están en formato ISO 8601 con zona horaria UTC
* El `status` de los assets de la organización normalmente es `ALLOWED`
* El campo `group` es `null` cuando un asset no está asignado a ningún grupo
* El cursor `next_page` es opaco y no se debe analizar ni modificar


## 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
  - name: dark-web
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: slug
          schema:
            type: string
        - 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
              - LUMA
              - SMARTMONEYMATCH
              - APK_GOLD
              - GLASSDOOR
              - PUMP_FUN
              - TUMBLR
              - MASTODON
        - 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
            description: The number of assets to return per page (max 1000)
        - in: query
          name: next_page
          description: Cursor for fetching the next page of results
          schema:
            type: string
            nullable: true
            description: Cursor for fetching the next page of results
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  assets:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          description: Asset ID
                        content:
                          type: string
                          description: Asset content (URL, address, handle, etc.)
                        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
                            - LUMA
                            - SMARTMONEYMATCH
                            - APK_GOLD
                            - GLASSDOOR
                            - PUMP_FUN
                            - TUMBLR
                            - MASTODON
                          description: Asset type
                        status:
                          type: string
                          enum:
                            - UNKNOWN
                            - ALLOWED
                            - BLOCKED
                          description: Asset status
                        name:
                          type: string
                          nullable: true
                          description: Asset display name
                        description:
                          type: string
                          nullable: true
                          description: Asset description
                        group:
                          type: object
                          nullable: true
                          properties:
                            id:
                              type: number
                              description: Group ID
                            name:
                              type: string
                              description: Group name
                          required:
                            - id
                            - name
                          description: Asset group information
                        livenessStatus:
                          type: string
                          nullable: true
                          enum:
                            - UNKNOWN
                            - ALIVE
                            - DEAD
                            - null
                          description: >-
                            Whether the asset is currently reachable (`ALIVE`),
                            gone (`DEAD`), or hasn't been checked (`UNKNOWN`).
                            `null` when liveness has never been evaluated.
                        blockedAt:
                          type: string
                          nullable: true
                          description: >-
                            When the asset transitioned to BLOCKED status.
                            `null` for non-blocked assets. Distinct from
                            `updatedAt`.
                        createdAt:
                          type: string
                          description: When the asset was created
                        updatedAt:
                          type: string
                          description: When the asset was last updated
                        allowlistExpiresAt:
                          type: string
                          nullable: true
                          description: >-
                            When the asset's allowlist entry expires. `null`
                            when it never expires. After this date the asset
                            gets a 14-day grace period, then is removed from
                            your organization; its status stays the same.
                        allowlistExpiredAt:
                          type: string
                          nullable: true
                          description: >-
                            When the expiry passed and the 14-day grace period
                            started. `null` while the expiry is still ahead, or
                            when there is none.
                      required:
                        - id
                        - content
                        - type
                        - status
                        - name
                        - description
                        - group
                        - livenessStatus
                        - blockedAt
                        - createdAt
                        - updatedAt
                        - allowlistExpiresAt
                        - allowlistExpiredAt
                    description: List of assets
                  next_page:
                    type: string
                    nullable: true
                    description: Cursor for fetching the next page of results
                required:
                  - assets
                description: Successful operation
        '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.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.