# Report

## Gets a list of reports

> Lists all reports and their rules

```json
{"openapi":"3.1.1","info":{"title":"api.cdn.i3d.net","version":"ed6131ed-256"},"servers":[{"url":"https://api.cdn.i3d.net/api/"}],"security":[{"OAuth2Application":[]}],"components":{"securitySchemes":{"OAuth2Application":{"type":"oauth2","flows":{"application":{"tokenUrl":"https://id.i3d.net/connect/token"}}}},"schemas":{"model.ReportRule":{"type":"object","properties":{"name":{"type":"string"},"options":{"type":"array","items":{"$ref":"#/components/schemas/model.ReportOption"}},"reportId":{"type":"integer"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/model.ReportTag"}},"vhost":{"$ref":"#/components/schemas/model.VHost"}}},"model.ReportOption":{"type":"object","properties":{"method":{"type":"string","enum":["matchPath","excludePath"]},"value":{"type":"string"}}},"model.ReportTag":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"model.VHost":{"type":"object","properties":{"BillingTemplateId":{"type":"integer"},"clientId":{"type":"string"},"dns":{"type":"string"},"enabled":{"type":"boolean"},"hash":{"type":"string"},"name":{"type":"string"},"originId":{"type":"integer"},"path":{"type":"string"}}},"model.HTTPError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/service/{serviceId}/report":{"get":{"description":"Lists all reports and their rules","tags":["report"],"summary":"Gets a list of reports","parameters":[{"type":"string","description":"serviceId","name":"serviceId","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/model.ReportRule"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.HTTPError"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.HTTPError"}}}}}}}}}
```

## Creates a Report

> A report is created based of rules, this call allows you to define a set of rules to report on

```json
{"openapi":"3.1.1","info":{"title":"api.cdn.i3d.net","version":"ed6131ed-256"},"servers":[{"url":"https://api.cdn.i3d.net/api/"}],"security":[{"OAuth2Application":[]}],"components":{"securitySchemes":{"OAuth2Application":{"type":"oauth2","flows":{"application":{"tokenUrl":"https://id.i3d.net/connect/token"}}}},"schemas":{"model.ReportCreateRequest":{"type":"object","properties":{"rule":{"$ref":"#/components/schemas/model.ReportCreateRule"}}},"model.ReportCreateRule":{"type":"object","properties":{"name":{"type":"string"},"options":{"type":"array","items":{"$ref":"#/components/schemas/model.ReportCreateOption"}},"tags":{"type":"array","items":{"$ref":"#/components/schemas/model.ReportTag"}}}},"model.ReportCreateOption":{"type":"object","properties":{"method":{"type":"string","enum":["matchPath","excludePath"]},"value":{"type":"string"}}},"model.ReportTag":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}}},"paths":{"/service/{serviceId}/report":{"post":{"description":"A report is created based of rules, this call allows you to define a set of rules to report on","tags":["report"],"summary":"Creates a Report","parameters":[{"type":"string","description":"serviceId","name":"serviceId","in":"path","required":true}],"responses":{},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ReportCreateRequest"}}},"description":"Report Create Request","required":true}}}}}
```

## Generates a report by its reportId

> A report is created based of rules, this call create a report based on the RuleID

```json
{"openapi":"3.1.1","info":{"title":"api.cdn.i3d.net","version":"ed6131ed-256"},"servers":[{"url":"https://api.cdn.i3d.net/api/"}],"security":[{"OAuth2Application":[]}],"components":{"securitySchemes":{"OAuth2Application":{"type":"oauth2","flows":{"application":{"tokenUrl":"https://id.i3d.net/connect/token"}}}},"schemas":{"model.Report":{"type":"object","properties":{"endTime":{"type":"string"},"regions":{"type":"array","items":{"$ref":"#/components/schemas/model.Region"}},"rule":{"$ref":"#/components/schemas/model.ReportRule"},"startTime":{"type":"string"},"totals":{"$ref":"#/components/schemas/model.ReportTotal"}}},"model.Region":{"type":"object","properties":{"billingTemplate":{"$ref":"#/components/schemas/model.BillingTemplate"},"cost":{"type":"number"},"name":{"type":"string"},"requests":{"type":"integer"},"tx":{"type":"integer"},"txGbit":{"type":"number"}}},"model.BillingTemplate":{"type":"object","properties":{"id":{"type":"integer"},"pricePerGbit":{"type":"number"},"region":{"type":"string"}}},"model.ReportRule":{"type":"object","properties":{"name":{"type":"string"},"options":{"type":"array","items":{"$ref":"#/components/schemas/model.ReportOption"}},"reportId":{"type":"integer"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/model.ReportTag"}},"vhost":{"$ref":"#/components/schemas/model.VHost"}}},"model.ReportOption":{"type":"object","properties":{"method":{"type":"string","enum":["matchPath","excludePath"]},"value":{"type":"string"}}},"model.ReportTag":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"model.VHost":{"type":"object","properties":{"BillingTemplateId":{"type":"integer"},"clientId":{"type":"string"},"dns":{"type":"string"},"enabled":{"type":"boolean"},"hash":{"type":"string"},"name":{"type":"string"},"originId":{"type":"integer"},"path":{"type":"string"}}},"model.ReportTotal":{"type":"object","properties":{"cost":{"type":"number"},"requests":{"type":"integer"},"tx":{"type":"integer"},"txGbit":{"type":"number"}}},"model.HTTPError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/service/{serviceId}/report/{reportId}":{"get":{"description":"A report is created based of rules, this call create a report based on the RuleID","tags":["report"],"summary":"Generates a report by its reportId","parameters":[{"type":"string","description":"serviceId","name":"serviceId","in":"path","required":true},{"type":"string","description":"reportId to run","name":"reportId","in":"path","required":true},{"type":"integer","description":"start time range,  unix timestamp, default 24 hours ago","name":"startTimestamp","in":"query"},{"type":"integer","description":"end time range, unix timestamp, default now","name":"endTimestamp","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.Report"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.HTTPError"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.HTTPError"}}}}}}}}}
```

## Deletes a Report

> A report is created based of rules, this call allows you to delete a rule

```json
{"openapi":"3.1.1","info":{"title":"api.cdn.i3d.net","version":"ed6131ed-256"},"servers":[{"url":"https://api.cdn.i3d.net/api/"}],"security":[{"OAuth2Application":[]}],"components":{"securitySchemes":{"OAuth2Application":{"type":"oauth2","flows":{"application":{"tokenUrl":"https://id.i3d.net/connect/token"}}}},"schemas":{"model.HTTPError":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/service/{serviceId}/report/{reportId}":{"delete":{"description":"A report is created based of rules, this call allows you to delete a rule","tags":["report"],"summary":"Deletes a Report","parameters":[{"type":"string","description":"serviceId","name":"serviceId","in":"path","required":true},{"type":"string","description":"reportId to run","name":"reportId","in":"path","required":true}],"responses":{"202":{"description":"Accepted"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.HTTPError"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.HTTPError"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.i3d.net/api-references/cdn/report-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
