{
  "openapi": "3.0.0",
  "info": {
    "description": "OpenAPI specification for the entire Messari API",
    "title": "Messari API - Diligence V1",
    "version": "1.0.0"
  },
  "servers": [
    {
      "description": "Messari API",
      "url": "https://api.messari.io"
    }
  ],
  "security": [],
  "paths": {
    "/diligence/v1/public/report/pdf/{id}": {
      "get": {
        "description": "Returns a report PDF by its report ID",
        "operationId": "getReportPDFByID",
        "parameters": [
          {
            "description": "ID of the report",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "byte",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PDF"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get report PDF by report ID",
        "tags": [
          "diligence/Reports"
        ]
      }
    },
    "/diligence/v1/report/asset/{assetId}": {
      "get": {
        "description": "Returns a report by its asset ID",
        "operationId": "getReportByAssetID",
        "parameters": [
          {
            "description": "asset ID of the report",
            "in": "path",
            "name": "assetId",
            "required": true,
            "schema": {
              "format": "byte",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReportResponse"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Report not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get report by assetId",
        "tags": [
          "diligence/Reports"
        ]
      }
    },
    "/diligence/v1/report/{id}": {
      "get": {
        "description": "Returns a report by its ID",
        "operationId": "getReportByID",
        "parameters": [
          {
            "description": "ID of the report",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "byte",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReportResponse"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Report not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get report by ID",
        "tags": [
          "diligence/Reports"
        ]
      }
    },
    "/diligence/v1/reports/preview": {
      "get": {
        "description": "Returns a list of all report previews. Excludes report contents",
        "operationId": "getReportPreviews",
        "parameters": [
          {
            "in": "query",
            "name": "sortBy",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sortDir",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sector",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "isDefaultIncluded",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "isPublished",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "isPurchased",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ReportPreviewResponse"
                      },
                      "type": "array"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get preview of all reports",
        "tags": [
          "diligence/Reports"
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ReportResponse": {
        "properties": {
          "assetId": {
            "format": "byte",
            "type": "string"
          },
          "assetSlug": {
            "type": "string"
          },
          "id": {
            "format": "byte",
            "type": "string"
          },
          "lastRevisedAt": {
            "format": "date-time",
            "type": "string"
          },
          "projectName": {
            "type": "string"
          },
          "publishStatus": {
            "type": "string"
          },
          "sections": {
            "additionalProperties": true,
            "type": "object"
          },
          "sector": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          }
        },
        "required": [
          "assetId",
          "assetSlug",
          "id",
          "lastRevisedAt",
          "projectName",
          "publishStatus",
          "sections",
          "sector",
          "slug"
        ],
        "type": "object"
      },
      "PDF": {
        "properties": {
          "pdfUrl": {
            "type": "string"
          },
          "ttl": {
            "type": "string"
          }
        },
        "required": [
          "pdfUrl",
          "ttl"
        ],
        "type": "object"
      },
      "ReportPreviewResponse": {
        "properties": {
          "assetId": {
            "format": "byte",
            "type": "string"
          },
          "assetSlug": {
            "type": "string"
          },
          "isDefaultIncluded": {
            "type": "boolean"
          },
          "isPurchased": {
            "type": "boolean"
          },
          "lastRevisedAt": {
            "format": "date-time",
            "type": "string"
          },
          "logos": {
            "additionalProperties": true,
            "type": "object"
          },
          "projectName": {
            "type": "string"
          },
          "publishStatus": {
            "type": "string"
          },
          "reportId": {
            "format": "byte",
            "type": "string"
          },
          "sector": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          }
        },
        "required": [
          "assetId",
          "assetSlug",
          "isDefaultIncluded",
          "isPurchased",
          "lastRevisedAt",
          "logos",
          "projectName",
          "publishStatus",
          "reportId",
          "sector",
          "slug"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "apiKey": {
        "in": "header",
        "name": "X-Messari-API-Key",
        "type": "apiKey"
      }
    }
  }
}