# Logs

## GET /public/v2/streams/{streamKey}/logs

> Return logs inside a stream

```json
{"openapi":"3.0.1","info":{"title":"Bitpool API v2","version":"v2"},"servers":[{"url":"https://api.bitpool.com","description":"Production API"},{"url":"https://api.dev.bitpool.com","description":"Development API"}],"security":[{"Bitpool2":["readAccess","writeAccess"]}],"components":{"securitySchemes":{"Bitpool2":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"BitPool.Base.Web.StreamLogsListModel":{"type":"object","properties":{"Data":{"type":"array","items":{"$ref":"#/components/schemas/BitPool.Base.Entities.ValueEntity"},"nullable":true},"Total":{"type":"integer","format":"int64"}},"additionalProperties":false},"BitPool.Base.Entities.ValueEntity":{"type":"object","properties":{"StreamKey":{"type":"string","format":"uuid"},"Timestamp":{"type":"string","format":"date-time","nullable":true},"Value":{"type":"number","format":"double","nullable":true},"ValueString":{"type":"string","nullable":true},"Calculated":{"type":"boolean"},"FirstValue":{"type":"number","format":"double","nullable":true},"LastValue":{"type":"number","format":"double","nullable":true}},"additionalProperties":false}}},"paths":{"/public/v2/streams/{streamKey}/logs":{"get":{"tags":["Logs"],"summary":"Return logs inside a stream","parameters":[{"name":"streamKey","in":"path","description":"","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"from","in":"query","description":"","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"","schema":{"type":"string","format":"date-time"}},{"name":"take","in":"query","description":"","schema":{"type":"integer","format":"int32","default":0}},{"name":"skip","in":"query","description":"","schema":{"type":"integer","format":"int32","default":0}},{"name":"minValue","in":"query","description":"","schema":{"type":"number","format":"double"}},{"name":"maxValue","in":"query","description":"","schema":{"type":"number","format":"double"}},{"name":"postProcessIfAvailable","in":"query","description":"","schema":{"type":"boolean","default":true}},{"name":"showDifference","in":"query","description":"","schema":{"type":"boolean","default":false}},{"name":"BPDateFormat","in":"header","description":"Date format header","required":true,"schema":{"type":"string","default":"ISO"}},{"name":"Accept","in":"header","description":"Accept header","required":true,"schema":{"type":"string","default":"application/json"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BitPool.Base.Web.StreamLogsListModel"}}}}}}}}}
```

## POST /public/v2/streams/{streamKey}/logs

> Upload logs into a specific stream

```json
{"openapi":"3.0.1","info":{"title":"Bitpool API v2","version":"v2"},"servers":[{"url":"https://api.bitpool.com","description":"Production API"},{"url":"https://api.dev.bitpool.com","description":"Development API"}],"security":[{"Bitpool2":["readAccess","writeAccess"]}],"components":{"securitySchemes":{"Bitpool2":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"BitPool.Base.Entities.Slog":{"type":"object","properties":{"Ts":{"type":"string","format":"date-time"},"Val":{"type":"number","format":"double","nullable":true},"ValStr":{"type":"string","nullable":true},"Calculated":{"type":"boolean"}},"additionalProperties":false}}},"paths":{"/public/v2/streams/{streamKey}/logs":{"post":{"tags":["Logs"],"summary":"Upload logs into a specific stream","parameters":[{"name":"streamKey","in":"path","description":"","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"BPDateFormat","in":"header","description":"Date format header","required":true,"schema":{"type":"string","default":"ISO"}},{"name":"Accept","in":"header","description":"Accept header","required":true,"schema":{"type":"string","default":"application/json"}}],"requestBody":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BitPool.Base.Entities.Slog"}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"string"}}}}}}}}}
```

## GET /public/v2/streams/{streamKey}/logs/aggregated

> return logs inside a stream, a variety of properties help to filter and aggregate the logs which are returned

```json
{"openapi":"3.0.1","info":{"title":"Bitpool API v2","version":"v2"},"servers":[{"url":"https://api.bitpool.com","description":"Production API"},{"url":"https://api.dev.bitpool.com","description":"Development API"}],"security":[{"Bitpool2":["readAccess","writeAccess"]}],"components":{"securitySchemes":{"Bitpool2":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"BitPool.Base.Enums.TimeRange":{"enum":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],"type":"integer","description":"\n\n0 = Custom\n\n1 = ThisHour\n\n2 = Today\n\n3 = ThisWeek\n\n4 = ThisMonth\n\n5 = ThisYear\n\n6 = LastHour\n\n7 = Yesterday\n\n8 = LastWeek\n\n9 = LastMonth\n\n10 = LastYear\n\n11 = RollingDay\n\n12 = RollingWeek\n\n13 = RollingMonth\n\n14 = RollingYear\n\n15 = RollingHour","format":"int32"},"BitPool.Base.Enums.AggregationType":{"enum":[0,1,2,3,4,7,8,9,10,11,12,13,14],"type":"integer","description":"\n\n0 = Avg\n\n1 = Sum\n\n2 = Diff\n\n3 = Min\n\n4 = Max\n\n7 = None\n\n8 = MinTimeOccurrence\n\n9 = MaxTimeOccurrence\n\n10 = First\n\n11 = Last\n\n12 = Accum\n\n13 = FirstTimeOccurrence\n\n14 = LastTimeOccurrence","format":"int32"},"BitPool.Base.Enums.AggregationTypeString":{"enum":[0,1,2,3,4],"type":"integer","description":"\n\n0 = None\n\n1 = Most\n\n2 = Least\n\n3 = First\n\n4 = Last","format":"int32"},"BitPool.Base.Enums.AggregationPeriod":{"enum":[0,1,2,3,4,5,6,7,8,9,10,11,12],"type":"integer","description":"\n\n0 = Hourly\n\n1 = Daily\n\n2 = Weekly\n\n3 = Monthly\n\n4 = Yearly\n\n5 = None\n\n6 = Minute\n\n7 = Minutes15\n\n8 = FinancialYearly\n\n9 = Raw\n\n10 = Minutes10\n\n11 = Minutes30\n\n12 = Minutes5","format":"int32"},"BitPool.Base.DTO.StreamLogDto":{"type":"object","properties":{"StreamKey":{"type":"string","format":"uuid"},"Timestamp":{"type":"string","format":"date-time","nullable":true},"Value":{"type":"number","format":"double","nullable":true},"ValueString":{"type":"string","nullable":true}},"additionalProperties":false}}},"paths":{"/public/v2/streams/{streamKey}/logs/aggregated":{"get":{"tags":["Logs"],"summary":"return logs inside a stream, a variety of properties help to filter and aggregate the logs which are returned","parameters":[{"name":"streamKey","in":"path","description":"","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"timeRange","in":"query","description":"\n\n0 = Custom\n\n1 = ThisHour\n\n2 = Today\n\n3 = ThisWeek\n\n4 = ThisMonth\n\n5 = ThisYear\n\n6 = LastHour\n\n7 = Yesterday\n\n8 = LastWeek\n\n9 = LastMonth\n\n10 = LastYear\n\n11 = RollingDay\n\n12 = RollingWeek\n\n13 = RollingMonth\n\n14 = RollingYear\n\n15 = RollingHour","schema":{"$ref":"#/components/schemas/BitPool.Base.Enums.TimeRange"}},{"name":"from","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"aggregationType","in":"query","description":"\n\n0 = Avg\n\n1 = Sum\n\n2 = Diff\n\n3 = Min\n\n4 = Max\n\n7 = None\n\n8 = MinTimeOccurrence\n\n9 = MaxTimeOccurrence\n\n10 = First\n\n11 = Last\n\n12 = Accum\n\n13 = FirstTimeOccurrence\n\n14 = LastTimeOccurrence","schema":{"$ref":"#/components/schemas/BitPool.Base.Enums.AggregationType"}},{"name":"aggregationTypeString","in":"query","description":"\n\n0 = None\n\n1 = Most\n\n2 = Least\n\n3 = First\n\n4 = Last","schema":{"$ref":"#/components/schemas/BitPool.Base.Enums.AggregationTypeString"}},{"name":"aggregationPeriod","in":"query","description":"\n\n0 = Hourly\n\n1 = Daily\n\n2 = Weekly\n\n3 = Monthly\n\n4 = Yearly\n\n5 = None\n\n6 = Minute\n\n7 = Minutes15\n\n8 = FinancialYearly\n\n9 = Raw\n\n10 = Minutes10\n\n11 = Minutes30\n\n12 = Minutes5","schema":{"$ref":"#/components/schemas/BitPool.Base.Enums.AggregationPeriod"}},{"name":"timeZone","in":"query","schema":{"type":"string"}},{"name":"autoTimeZone","in":"query","schema":{"type":"boolean"}},{"name":"nullWhenNoData","in":"query","schema":{"type":"boolean"}},{"name":"multiplier","in":"query","schema":{"type":"number","format":"double"}},{"name":"postProcessIfAvailable","in":"query","schema":{"type":"boolean"}},{"name":"BPDateFormat","in":"header","description":"Date format header","required":true,"schema":{"type":"string","default":"ISO"}},{"name":"Accept","in":"header","description":"Accept header","required":true,"schema":{"type":"string","default":"application/json"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BitPool.Base.DTO.StreamLogDto"}}}}}}}}}}
```

## POST /public/v2/streams/logs

> Bulk upload logs into many streams

```json
{"openapi":"3.0.1","info":{"title":"Bitpool API v2","version":"v2"},"servers":[{"url":"https://api.bitpool.com","description":"Production API"},{"url":"https://api.dev.bitpool.com","description":"Development API"}],"security":[{"Bitpool2":["readAccess","writeAccess"]}],"components":{"securitySchemes":{"Bitpool2":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"BitPool.Base.DTO.StreamData":{"type":"object","properties":{"StreamKey":{"type":"string","format":"uuid"},"Values":{"type":"array","items":{"$ref":"#/components/schemas/BitPool.Base.Entities.Slog"},"nullable":true}},"additionalProperties":false},"BitPool.Base.Entities.Slog":{"type":"object","properties":{"Ts":{"type":"string","format":"date-time"},"Val":{"type":"number","format":"double","nullable":true},"ValStr":{"type":"string","nullable":true},"Calculated":{"type":"boolean"}},"additionalProperties":false}}},"paths":{"/public/v2/streams/logs":{"post":{"tags":["Logs"],"summary":"Bulk upload logs into many streams","parameters":[{"name":"BPDateFormat","in":"header","description":"Date format header","required":true,"schema":{"type":"string","default":"ISO"}},{"name":"Accept","in":"header","description":"Accept header","required":true,"schema":{"type":"string","default":"application/json"}}],"requestBody":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BitPool.Base.DTO.StreamData"}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"string"}}}}}}}}}
```


---

# 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://wiki-cloud.bitpool.com/public-bitpool-api/logs.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.
