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

# Obtener métricas de la organización

> Get metrics for your organization with optional date range and brand filtering. Organization is determined from your API key.

## Descripción general

Obtén las métricas de seguridad de tu organización, incluidos reportes, amenazas bloqueadas, **Takedowns** (solicitudes de baja de contenido fraudulento) y más. Este endpoint ofrece analíticas completas sobre la postura de seguridad de tu organización. La organización se infiere automáticamente a partir de tu clave de API.

## Inicio rápido

### Autenticació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/metrics?startDate=2024-01-01T00:00:00Z&endDate=2024-12-31T23:59:59Z",
  {
    method: "GET",
    headers: {
      "X-API-KEY": "YOUR_API_KEY_HERE",
    },
  }
);

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

```javascript JavaScript theme={null}
const response = await fetch(
  "https://app.chainpatrol.io/api/v2/organization/metrics?startDate=2024-01-01T00:00:00Z&endDate=2024-12-31T23:59:59Z",
  {
    method: "GET",
    headers: {
      "X-API-KEY": "YOUR_API_KEY_HERE",
    },
  }
);

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

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

response = requests.get(
    "https://app.chainpatrol.io/api/v2/organization/metrics",
    headers={
        "X-API-KEY": "YOUR_API_KEY_HERE",
    },
    params={
        "startDate": "2024-01-01T00:00:00Z",
        "endDate": "2024-12-31T23:59:59Z",
    },
)

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

```bash cURL theme={null}
curl -X GET 'https://app.chainpatrol.io/api/v2/organization/metrics?startDate=2024-01-01T00:00:00Z&endDate=2024-12-31T23:59:59Z' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'
```

## Parámetros de consulta

| Parámetro | Tipo | Obligatorio | Descripción |
| - | - | - | - |
| brandSlug | string | No | Filtra las métricas por una marca específica. Requiere el feature flag brands-metrics. |
| startDate | string | No | Fecha de inicio de las métricas (formato ISO 8601). Si no se indica, se toma por defecto el inicio de los tiempos. |
| endDate | string | No | Fecha de fin de las métricas (formato ISO 8601). Si no se indica, se toma por defecto la fecha actual. |

## Respuesta

### Respuesta exitosa

```json theme={null}
{
  "metrics": {
    "reports": 150,
    "newThreats": 245,
    "threatsWatchlisted": 18,
    "takedownsFiled": 45,
    "takedownsCompleted": 32,
    "domainThreats": 120,
    "twitterThreats": 40,
    "telegramThreats": 25,
    "otherThreats": 60
  },
  "blockedByType": [
    {
      "type": "URL",
      "count": 120
    },
    {
      "type": "ADDRESS",
      "count": 85
    },
    {
      "type": "TWITTER",
      "count": 40
    }
  ],
  "blockedByDay": [
    {
      "date": "2024-01-15",
      "count": 12
    },
    {
      "date": "2024-01-16",
      "count": 8
    }
  ]
}
```

### Campos de la respuesta

| Campo | Tipo | Descripción |
| - | - | - |
| metrics | object | Objeto de métricas que contiene todas las estadísticas de seguridad |
| metrics.reports | number | Cantidad total de reportes enviados |
| metrics.newThreats | number | Cantidad de amenazas nuevas bloqueadas |
| metrics.threatsWatchlisted | number | Cantidad de amenazas agregadas a la **Watchlist** (lista de seguimiento de assets sospechosos que se siguen monitoreando); 0 en las consultas filtradas por marca |
| metrics.takedownsFiled | number | Cantidad total de solicitudes de takedown presentadas |
| metrics.takedownsCompleted | number | Cantidad total de takedowns completados con éxito |
| metrics.domainThreats | number | Cantidad de amenazas de URL/dominio bloqueadas |
| metrics.twitterThreats | number | Cantidad de amenazas de Twitter bloqueadas |
| metrics.telegramThreats | number | Cantidad de amenazas de Telegram bloqueadas |
| metrics.otherThreats | number | Cantidad de amenazas bloqueadas de otros tipos de **Asset** (activo digital: URL, dirección, perfil, app, etc.) |
| blockedByType | array | Desglose de las amenazas bloqueadas por tipo de asset |
| blockedByType\[].type | string | Tipo de asset (URL, ADDRESS, TWITTER, etc.) |
| blockedByType\[].count | number | Cantidad de amenazas bloqueadas para este tipo de asset |
| blockedByDay | array | Datos de serie temporal que muestran las amenazas bloqueadas por día |
| blockedByDay\[].date | string | Fecha en formato YYYY-MM-DD |
| blockedByDay\[].count | number | Cantidad de amenazas bloqueadas en esta fecha |

## Tipos de métricas

### Métricas a nivel de organización (por defecto)

Cuando no se indica `brandSlug`, devuelve las métricas de toda la organización:

* Agrega todas las **Proposals** (propuestas para bloquear o permitir un asset), los reportes y los takedowns de la organización
* Incluye las amenazas con estado `BLOCKED`, `APPROVED` y `AUTO_APPROVED`
* El filtro por fecha se aplica a las marcas de tiempo `createdAt`
* Incluye todas las marcas de la organización

### Métricas a nivel de marca (opcional)

Cuando se indica `brandSlug` (requiere el feature flag brands-metrics):

* Filtra las métricas a una marca específica mediante el historial de revisión
* Consulta el historial de estados de los assets para encontrar las amenazas bloqueadas específicas de la marca
* Usa la tabla de historial de estados con las revisiones de marca
* El filtro por fecha de los takedowns usa las marcas de tiempo `updatedAt`
* **Nota:** `threatsWatchlisted` siempre devuelve 0 en las consultas acotadas a una marca

## Casos de uso

### Obtener las métricas de todo el historial

Obtén las métricas de todo el historial de tu organización:

```typescript theme={null}
const response = await fetch(
  "https://app.chainpatrol.io/api/v2/organization/metrics",
  {
    headers: { "X-API-KEY": "YOUR_API_KEY_HERE" },
  }
);

const { metrics, blockedByType, blockedByDay } = await response.json();
console.log(`Total new threats: ${metrics.newThreats}`);
console.log(`Blocked by type:`, blockedByType);
```

### Obtener las métricas de una marca específica

Obtén las métricas filtradas a una marca específica:

```typescript theme={null}
const response = await fetch(
  "https://app.chainpatrol.io/api/v2/organization/metrics?brandSlug=my-brand",
  {
    headers: { "X-API-KEY": "YOUR_API_KEY_HERE" },
  }
);

const { metrics } = await response.json();
console.log(`Brand threats blocked: ${metrics.newThreats}`);
```

### Obtener las métricas mensuales

```typescript theme={null}
async function getMonthlyMetrics(year: number, month: number) {
  const startDate = new Date(year, month - 1, 1);
  const endDate = new Date(year, month, 0, 23, 59, 59);

  const response = await fetch(
    `https://app.chainpatrol.io/api/v2/organization/metrics?startDate=${startDate.toISOString()}&endDate=${endDate.toISOString()}`,
    {
      headers: { "X-API-KEY": "YOUR_API_KEY_HERE" },
    }
  );

  const { metrics } = await response.json();
  return metrics;
}

// Get metrics for January 2024
const janMetrics = await getMonthlyMetrics(2024, 1);
console.log("January 2024 metrics:", janMetrics);
```

### Comparar períodos de tiempo

```typescript theme={null}
async function compareMetrics(period1Start: string, period1End: string, period2Start: string, period2End: string) {
  const [period1Response, period2Response] = await Promise.all([
    fetch(
      `https://app.chainpatrol.io/api/v2/organization/metrics?startDate=${period1Start}&endDate=${period1End}`,
      { headers: { "X-API-KEY": "YOUR_API_KEY_HERE" } }
    ),
    fetch(
      `https://app.chainpatrol.io/api/v2/organization/metrics?startDate=${period2Start}&endDate=${period2End}`,
      { headers: { "X-API-KEY": "YOUR_API_KEY_HERE" } }
    ),
  ]);

  const period1 = await period1Response.json();
  const period2 = await period2Response.json();

  const change = {
    reportsCount: period2.metrics.reportsCount - period1.metrics.reportsCount,
    threatsBlocked: period2.metrics.threatsBlockedCount - period1.metrics.threatsBlockedCount,
    detections: period2.metrics.totalDetections - period1.metrics.totalDetections,
  };

  console.log("Period-over-period change:", change);
  return change;
}
```

### Analizar la distribución de amenazas

```typescript theme={null}
async function analyzeThreats() {
  const response = await fetch(
    "https://app.chainpatrol.io/api/v2/organization/metrics",
    {
      headers: { "X-API-KEY": "YOUR_API_KEY_HERE" },
    }
  );

  const { metrics, blockedByType } = await response.json();

  // Calculate percentages by asset type
  const total = metrics.newThreats;
  const distribution = blockedByType.map((item) => ({
    type: item.type,
    count: item.count,
    percentage: ((item.count / total) * 100).toFixed(2),
  }));

  console.log("Threat distribution:", distribution);
  return distribution;
}
```

### Visualizar las amenazas a lo largo del tiempo

```typescript theme={null}
async function getThreatsTimeSeries(days: number = 30) {
  const endDate = new Date();
  const startDate = new Date();
  startDate.setDate(startDate.getDate() - days);

  const response = await fetch(
    `https://app.chainpatrol.io/api/v2/organization/metrics?startDate=${startDate.toISOString()}&endDate=${endDate.toISOString()}`,
    {
      headers: { "X-API-KEY": "YOUR_API_KEY_HERE" },
    }
  );

  const { blockedByDay } = await response.json();

  // Use blockedByDay for time series visualization
  console.log("Threats per day:", blockedByDay);
  return blockedByDay;
}
```

### Generar un panel de seguridad

```typescript theme={null}
async function generateDashboard(days: number = 30) {
  const endDate = new Date();
  const startDate = new Date();
  startDate.setDate(startDate.getDate() - days);

  const response = await fetch(
    `https://app.chainpatrol.io/api/v2/organization/metrics?startDate=${startDate.toISOString()}&endDate=${endDate.toISOString()}`,
    {
      headers: { "X-API-KEY": "YOUR_API_KEY_HERE" },
    }
  );

  const { metrics } = await response.json();

  const { metrics, blockedByType } = await response.json();

  const dashboard = {
    period: `Last ${days} days`,
    summary: {
      totalReports: metrics.reports,
      newThreats: metrics.newThreats,
      threatsWatchlisted: metrics.threatsWatchlisted,
      takedownSuccessRate: 
        metrics.takedownsFiled > 0
          ? ((metrics.takedownsCompleted / metrics.takedownsFiled) * 100).toFixed(1) + "%"
          : "N/A",
      breakdown: {
        domains: metrics.domainThreats,
        twitter: metrics.twitterThreats,
        telegram: metrics.telegramThreats,
        other: metrics.otherThreats,
      }
    },
    topThreats: blockedByType
      .sort((a, b) => b.count - a.count)
      .slice(0, 3),
  };

  return dashboard;
}

// Usage
const dashboard = await generateDashboard(30);
console.log("Security Dashboard:", dashboard);
```

### Exportar un informe de métricas

```typescript theme={null}
async function exportMetricsReport(startDate: string, endDate: string) {
  const response = await fetch(
    `https://app.chainpatrol.io/api/v2/organization/metrics?startDate=${startDate}&endDate=${endDate}`,
    {
      headers: { "X-API-KEY": "YOUR_API_KEY_HERE" },
    }
  );

  const { metrics } = await response.json();

  const { metrics, blockedByType } = await response.json();

  const report = `
Security Metrics Report
Period: ${startDate} to ${endDate}
Generated: ${new Date().toISOString()}

Overview:
- Reports Filed: ${metrics.reports}
- New Threats Blocked: ${metrics.newThreats}
- Threats Watchlisted: ${metrics.threatsWatchlisted}
- Domain Threats: ${metrics.domainThreats}
- Twitter Threats: ${metrics.twitterThreats}
- Telegram Threats: ${metrics.telegramThreats}
- Other Threats: ${metrics.otherThreats}

Takedowns:
- Filed: ${metrics.takedownsFiled}
- Completed: ${metrics.takedownsCompleted}
- Success Rate: ${metrics.takedownsFiled > 0 ? ((metrics.takedownsCompleted / metrics.takedownsFiled) * 100).toFixed(1) : 0}%

Threats by Asset Type:
${blockedByType
  .map((item) => `- ${item.type}: ${item.count}`)
  .join("\n")}
  `;

  return report;
}
```

## Respuestas de error

### 401 Unauthorized

Se devuelve cuando la clave de API falta, 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 date format. Use ISO 8601 format."
  }
}
```

### 404 Not Found

Se devuelve cuando el slug de la marca no se encuentra o no pertenece a tu organización:

```json theme={null}
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Brand not found"
  }
}
```

## Buenas prácticas

### Rangos de fechas

* Usa siempre el formato ISO 8601 para las fechas: `YYYY-MM-DDTHH:mm:ss.sssZ`
* Incluye la información de zona horaria (normalmente UTC con el sufijo `Z`)
* Omite ambas fechas para obtener las métricas de todo el historial
* Usa rangos de fechas coherentes al comparar períodos

### Rendimiento

* Guarda en caché los datos de métricas con un TTL adecuado (p. ej., 1 hora para paneles)
* Usa los filtros de fecha para consultar períodos específicos en lugar de filtrar del lado del cliente
* Considera programar instantáneas periódicas de las métricas para llevar un seguimiento histórico

### Análisis

* Compara las métricas de distintos períodos para identificar tendencias
* Monitorea la tasa de éxito de los takedowns para evaluar la efectividad de las acciones contra amenazas
* Haz seguimiento de las amenazas por tipo de asset para entender los patrones de ataque

## 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
* Si no se indica un rango de fechas, se devuelven las métricas de todo el historial
* Las métricas se calculan en tiempo real según el rango de fechas indicado
* El array `blockedByType` incluye todos los tipos de asset que tienen amenazas bloqueadas
* El array `blockedByDay` ofrece datos de serie temporal para visualización
* El filtro por marca requiere el feature flag brands-metrics
* Todas las consultas excluyen los registros eliminados de forma lógica (soft delete)
* Los rangos de fechas son inclusivos
* En las consultas filtradas por marca, `threatsWatchlisted` siempre devuelve 0
* El filtro por fecha de los takedowns usa marcas de tiempo distintas en las consultas por marca y en las consultas por organización


## OpenAPI

````yaml GET /organization/metrics
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/metrics:
    get:
      tags:
        - organization
      summary: Get organization metrics
      description: >-
        Get metrics for your organization with optional date range and brand
        filtering. Organization is determined from your API key.
      operationId: organizationMetricsGet
      parameters:
        - in: query
          name: organizationSlug
          schema:
            type: string
        - in: query
          name: slugs
          schema:
            type: array
            items:
              type: string
            maxItems: 500
        - in: query
          name: allMyOrgs
          schema:
            type: boolean
        - in: query
          name: subscriptionStatus
          schema:
            type: array
            items:
              type: string
              enum:
                - PROSPECT
                - POC
                - ACTIVE
                - INTEGRATION
                - PROTECTION
                - INACTIVE
            minItems: 1
        - in: query
          name: services
          schema:
            type: object
            properties:
              reporting:
                type: object
                properties:
                  active:
                    type: boolean
              reviewing:
                type: object
                properties:
                  active:
                    type: boolean
              protection:
                type: object
                properties:
                  active:
                    type: boolean
              takedowns:
                type: object
                properties:
                  active:
                    type: boolean
                  automated:
                    type: boolean
              detection:
                type: object
                properties:
                  active:
                    type: boolean
              darkWebMonitoring:
                type: object
                properties:
                  active:
                    type: boolean
        - in: query
          name: brandSlug
          schema:
            type: string
        - in: query
          name: startDate
          description: >-
            Count from this date. A date-only value (YYYY-MM-DD) starts at
            midnight UTC
          schema:
            type: string
            description: >-
              Count from this date. A date-only value (YYYY-MM-DD) starts at
              midnight UTC
        - in: query
          name: endDate
          description: >-
            Count up to and including this date. A date-only value (YYYY-MM-DD)
            covers the whole day in UTC; pass a full timestamp for a precise
            cut-off
          schema:
            type: string
            description: >-
              Count up to and including this date. A date-only value
              (YYYY-MM-DD) covers the whole day in UTC; pass a full timestamp
              for a precise cut-off
        - in: query
          name: include
          schema:
            type: array
            items:
              type: string
              enum:
                - reports
                - newThreats
                - threatsWatchlisted
                - takedownsFiled
                - takedownsInProgress
                - takedownsCompleted
                - takedownsCancelled
                - domainThreats
                - twitterThreats
                - telegramThreats
                - otherThreats
                - blockedByType
                - blockedByDay
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  metrics:
                    type: object
                    properties:
                      reports:
                        type: number
                        nullable: true
                      newThreats:
                        type: number
                        nullable: true
                      threatsWatchlisted:
                        type: number
                        nullable: true
                      takedownsFiled:
                        type: number
                        nullable: true
                      takedownsInProgress:
                        type: number
                        nullable: true
                      takedownsCompleted:
                        type: number
                        nullable: true
                      takedownsCancelled:
                        type: number
                        nullable: true
                      domainThreats:
                        type: number
                        nullable: true
                      twitterThreats:
                        type: number
                        nullable: true
                      telegramThreats:
                        type: number
                        nullable: true
                      otherThreats:
                        type: number
                        nullable: true
                    required:
                      - reports
                      - newThreats
                      - threatsWatchlisted
                      - takedownsFiled
                      - takedownsInProgress
                      - takedownsCompleted
                      - takedownsCancelled
                      - domainThreats
                      - twitterThreats
                      - telegramThreats
                      - otherThreats
                  blockedByType:
                    type: array
                    nullable: true
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                        count:
                          type: number
                      required:
                        - type
                        - count
                  blockedByDay:
                    type: array
                    nullable: true
                    items:
                      type: object
                      properties:
                        date:
                          type: string
                        count:
                          type: number
                      required:
                        - date
                        - count
                  averages:
                    type: object
                    properties:
                      perDay:
                        type: object
                        nullable: true
                        properties:
                          reports:
                            type: number
                            nullable: true
                          newThreats:
                            type: number
                            nullable: true
                          threatsWatchlisted:
                            type: number
                            nullable: true
                          takedownsFiled:
                            type: number
                            nullable: true
                          takedownsInProgress:
                            type: number
                            nullable: true
                          takedownsCompleted:
                            type: number
                            nullable: true
                          takedownsCancelled:
                            type: number
                            nullable: true
                          domainThreats:
                            type: number
                            nullable: true
                          twitterThreats:
                            type: number
                            nullable: true
                          telegramThreats:
                            type: number
                            nullable: true
                          otherThreats:
                            type: number
                            nullable: true
                        required:
                          - reports
                          - newThreats
                          - threatsWatchlisted
                          - takedownsFiled
                          - takedownsInProgress
                          - takedownsCompleted
                          - takedownsCancelled
                          - domainThreats
                          - twitterThreats
                          - telegramThreats
                          - otherThreats
                      perOrgPerDay:
                        type: object
                        nullable: true
                        properties:
                          reports:
                            type: number
                            nullable: true
                          newThreats:
                            type: number
                            nullable: true
                          threatsWatchlisted:
                            type: number
                            nullable: true
                          takedownsFiled:
                            type: number
                            nullable: true
                          takedownsInProgress:
                            type: number
                            nullable: true
                          takedownsCompleted:
                            type: number
                            nullable: true
                          takedownsCancelled:
                            type: number
                            nullable: true
                          domainThreats:
                            type: number
                            nullable: true
                          twitterThreats:
                            type: number
                            nullable: true
                          telegramThreats:
                            type: number
                            nullable: true
                          otherThreats:
                            type: number
                            nullable: true
                        required:
                          - reports
                          - newThreats
                          - threatsWatchlisted
                          - takedownsFiled
                          - takedownsInProgress
                          - takedownsCompleted
                          - takedownsCancelled
                          - domainThreats
                          - twitterThreats
                          - telegramThreats
                          - otherThreats
                      windowDays:
                        type: number
                        nullable: true
                    required:
                      - perDay
                      - perOrgPerDay
                      - windowDays
                  perOrg:
                    type: object
                    nullable: true
                    additionalProperties:
                      type: object
                      properties:
                        metrics:
                          type: object
                          properties:
                            reports:
                              type: number
                              nullable: true
                            newThreats:
                              type: number
                              nullable: true
                            threatsWatchlisted:
                              type: number
                              nullable: true
                            takedownsFiled:
                              type: number
                              nullable: true
                            takedownsInProgress:
                              type: number
                              nullable: true
                            takedownsCompleted:
                              type: number
                              nullable: true
                            takedownsCancelled:
                              type: number
                              nullable: true
                            domainThreats:
                              type: number
                              nullable: true
                            twitterThreats:
                              type: number
                              nullable: true
                            telegramThreats:
                              type: number
                              nullable: true
                            otherThreats:
                              type: number
                              nullable: true
                          required:
                            - reports
                            - newThreats
                            - threatsWatchlisted
                            - takedownsFiled
                            - takedownsInProgress
                            - takedownsCompleted
                            - takedownsCancelled
                            - domainThreats
                            - twitterThreats
                            - telegramThreats
                            - otherThreats
                        blockedByType:
                          type: array
                          nullable: true
                          items:
                            type: object
                            properties:
                              type:
                                type: string
                              count:
                                type: number
                            required:
                              - type
                              - count
                        blockedByDay:
                          type: array
                          nullable: true
                          items:
                            type: object
                            properties:
                              date:
                                type: string
                              count:
                                type: number
                            required:
                              - date
                              - count
                      required:
                        - metrics
                        - blockedByType
                        - blockedByDay
                  scope:
                    type: object
                    properties:
                      mode:
                        type: string
                        enum:
                          - single
                          - multi
                      orgs:
                        type: array
                        items:
                          type: string
                      resolvedFrom:
                        type: string
                        enum:
                          - api-key
                          - organizationSlug
                          - slugs
                          - allMyOrgs
                    required:
                      - mode
                      - orgs
                      - resolvedFrom
                required:
                  - metrics
                  - blockedByType
                  - blockedByDay
                  - averages
                  - perOrg
                  - scope
        '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.