MetriBeacon
Menu

POST Create log export

/api/v1/logs/exports

Start a CSV or NDJSON export over a frozen filter snapshot. Exceeding the complete-export limit fails explicitly instead of returning truncated output.

On this page

Access and permissions

Start a CSV or NDJSON export over a frozen filter snapshot. Exceeding the complete-export limit fails explicitly instead of returning truncated output.

Browser session: __Host-mb_session cookie.

Machine management credentials in Authorization: Bearer. Check the permissions (scopes) required by the operation.

Parameters and headers

FieldLocationType and limitsRequiredMeaning
formatURL querystring; {"enum":["csv","ndjson"]}YesExport format. Export limits are checked before download.

Request body

FieldType and limitsRequiredMeaning
$CentralLogQueryYes—
$.cursorstring; {"maxLength":4096}No—
$.environmentstringNo—
$.fromstring; {"format":"date-time"}No—
$.hoststringNo—
$.levelsarray<string>; {"maxItems":7}No—
$.levels[]stringYes—
$.limitinteger; {"default":50,"maximum":100,"minimum":1}No—
$.patternstringNo—
$.servicestringNo—
$.snapshotstring; {"format":"date-time"}No—
$.source_idsarray<string; {"format":"uuid"}>; {"maxItems":100}No—
$.source_ids[]string; {"format":"uuid"}Yes—
$.textstring; {"maxLength":4096}No—
$.tostring; {"format":"date-time"}No—
$.trace_idstringNo—
$.workspace_idstring; {"format":"uuid"}Yes—
$.facet_fieldsarray<string; {"enum":["service","environment","host","level","source_id"]}>; {"maxItems":5}NoAdditional exact field-value counts to calculate for the complete filtered time range. Omit when not needed; normal search still returns the complete count, histogram and message patterns.
$.facet_fields[]string; {"enum":["service","environment","host","level","source_id"]}Yes—
$.stream_idstring; {"maxLength":128}No—
$.incident_idstring; {"format":"uuid"}No—
$.incident_scopestring; {"enum":["associated","workspace"]}No—
$.incident_modestring; {"enum":["matched","warnings","all"]}No—

Responses

application/json

FieldType and limitsRequiredMeaning
$CentralLogExportJobYes—
$.error_codestring | nullNo—
$.idstring; {"format":"uuid"}Yes—
$.resultCentralLogResultNo—
$.result.countintegerNo—
$.result.facetsarray<object; {"additionalProperties":false}>; {"maxItems":150}No—
$.result.facets[]object; {"additionalProperties":false}Yes—
$.result.facets[].countintegerNo—
$.result.facets[].fieldstringNo—
$.result.facets[].valuestringNo—
$.result.histogramarray<object; {"additionalProperties":false}>; {"maxItems":1000}No—
$.result.histogram[]object; {"additionalProperties":false}Yes—
$.result.histogram[].countintegerNo—
$.result.histogram[].levelstringNo—
$.result.histogram[].timestring; {"format":"date-time"}No—
$.result.next_cursorstringNo—
$.result.patternsarray<object; {"additionalProperties":false}>; {"maxItems":30}No—
$.result.patterns[]object; {"additionalProperties":false}Yes—
$.result.patterns[].countintegerNo—
$.result.patterns[].messagestringNo—
$.result.patterns[].patternstringNo—
$.result.pendingintegerNo—
$.result.recordsarray<CentralLogRecord>; {"maxItems":100}No—
$.result.records[]CentralLogRecordYes—
$.result.records[].attributesobject; {"additionalProperties":true}No—
$.result.records[].bodyJSONNo—
$.result.records[].environmentstringNo—
$.result.records[].hoststringNo—
$.result.records[].idstring; {"maxLength":256}Yes—
$.result.records[].levelstringYes—
$.result.records[].messagestring; {"maxLength":65536}Yes—
$.result.records[].patternstringYes—
$.result.records[].received_atstring; {"format":"date-time"}Yes—
$.result.records[].resourceobject; {"additionalProperties":true}No—
$.result.records[].scopestringNo—
$.result.records[].servicestringNo—
$.result.records[].source_idstring; {"format":"uuid"}Yes—
$.result.records[].span_idstringNo—
$.result.records[].timestring; {"format":"date-time"}Yes—
$.result.records[].time_originstringYes—
$.result.records[].trace_idstringNo—
$.result.records[].workspace_idstring; {"format":"uuid"}Yes—
$.result.snapshotstring; {"format":"date-time"}No—
$.result.incompletebooleanNo—
$.result.expires_atstring; {"format":"date-time"}No—
$.result.summary_pendingbooleanNoRecords are available while complete-range counts, histogram, facets and patterns are still being calculated. Their interim zero or empty values are not final statistics.
$.result.observation_statestring; {"enum":["complete","delivery_delayed","catching_up","incomplete"]}No—
$.result.observation_issuesarray<CentralLogObservationIssue>; {"maxItems":100}No—
$.result.observation_issues[]CentralLogObservationIssueYes—
$.result.observation_issues[].source_idstring; {"format":"uuid"}Yes—
$.result.observation_issues[].source_namestringYes—
$.result.observation_issues[].stream_idstringYes—
$.result.observation_issues[].stream_namestringYes—
$.result.observation_issues[].statusstringYes—
$.result.observation_issues[].codestringYes—
$.result.observation_issues[].phasestringYes—
$.result.observation_issues[].started_atstring; {"format":"date-time"}Yes—
$.result.observation_issues[].ended_atstring; {"format":"date-time"}No—
$.result.observation_issues[].http_statusintegerNo—
$.result.observation_issues[].server_phasestringNo—
$.result.observation_issues[].sqlstatestringNo—
$.result.observation_issues[].last_atstring; {"format":"date-time"}No—
$.statusstring; {"enum":["queued","running","complete","failed","cancelled"]}Yes—
$.from_timestring; {"format":"date-time"}Yes—
$.to_timestring; {"format":"date-time"}Yes—
$.created_atstring; {"format":"date-time"}Yes—
$.expires_atstring; {"format":"date-time"}Yes—
$.row_keystringYes—
$.workspace_idstring; {"format":"uuid"}Yes—
$.formatstring; {"enum":["csv","ndjson"]}Yes—
$.completed_atstring | null; {"format":"date-time"}Yes—
$.result_availablebooleanYes—
$.download_urlstringNo—
$.error_detailobjectNo—
$.error_detail.message_keystringNo—
$.error_detail.message_paramsobjectNo—
Stable error codes
invalid_credential
unauthorized
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
Stable error codes
csrf
insufficient_scope
invalid_origin
operator_required
forbidden
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
Stable error codes
invalid_workspace
not_found
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
Stable error codes
invalid_workspace
stale_check
result_conflict
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
Stable error codes
invalid_config
invalid_monitor
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
Stable error codes
invalid_workspace
check_capacity
HeaderType and limitsMeaning
Retry-Afterstring; {"pattern":"^[0-9]+$"}Temporary server error; retry unchanged with Retry-After and the same idempotency identifier

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
Stable error codes
check_location_unavailable
feature_unavailable
log_admission_busy
log_queue_full
log_storage_unavailable
unavailable
account_busy
database_lock_timeout
database_timeout
database_unavailable
database_error
request_cancelled
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
Stable error codes
log_limit
request_too_large
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—

Retries and asynchronous work

This operation reads or validates without applying a resource mutation. Respect rate limits and credential lifetime.

HTTP 202 means the background job was accepted. Use the returned job ID to check its status. Download results when the job is complete, or inspect its error or cancellation status.

Request examples

Replace demo IDs, timestamps and placeholders with your own values. For a retry, keep the same IDs, time and content. These examples do not run requests on this page.

Keep login links, codes, cookies and keys private. Do not print them in logs or share them in support requests.

shell
curl --proto "=https" --tlsv1.2 --fail-with-body --max-time 30 --request POST --header @"$HOME/.config/metribeacon/headers.txt" --header "Content-Type: application/json" --data-binary '{"workspace_id":"00000000-0000-4000-8000-000000000001","text":"service:api level:>=error","source_ids":[],"levels":[]}' 'https://metribeacon.com/api/v1/logs/exports?format=ndjson'
python
import json
from pathlib import Path
from urllib.request import Request, urlopen
headers=json.loads((Path.home()/".config/metribeacon/headers.json").read_text())
headers["Content-Type"]="application/json"
request=Request('https://metribeacon.com/api/v1/logs/exports?format=ndjson',headers=headers,method='POST',data='{"workspace_id":"00000000-0000-4000-8000-000000000001","text":"service:api level:>=error","source_ids":[],"levels":[]}'.encode())
with urlopen(request,timeout=30) as response:
    print(response.status)
javascript
import {readFile} from "node:fs/promises";
import {homedir} from "node:os";
const headers=JSON.parse(await readFile(homedir()+"/.config/metribeacon/headers.json","utf8"));
headers["Content-Type"]="application/json";
const response=await fetch("https://metribeacon.com/api/v1/logs/exports?format=ndjson",{method:"POST",headers,redirect:"error",signal:AbortSignal.timeout(30000),body:"{\"workspace_id\":\"00000000-0000-4000-8000-000000000001\",\"text\":\"service:api level:>=error\",\"source_ids\":[],\"levels\":[]}"});
console.log(response.status);await response.body?.cancel();
go
package main
import("net/http";"os";"path/filepath";"encoding/json";"time";"fmt";"strings")
func main(){home,_:=os.UserHomeDir();raw,e:=os.ReadFile(filepath.Join(home,".config/metribeacon/headers.json"));if e!=nil{panic("headers unavailable")};var h map[string]string;if json.Unmarshal(raw,&h)!=nil{panic("invalid headers")};r,_:=http.NewRequest("POST","https://metribeacon.com/api/v1/logs/exports?format=ndjson",strings.NewReader("{\"workspace_id\":\"00000000-0000-4000-8000-000000000001\",\"text\":\"service:api level:>=error\",\"source_ids\":[],\"levels\":[]}"));for k,v:=range h{r.Header.Set(k,v)};r.Header.Set("Content-Type","application/json");c:=&http.Client{Timeout:30*time.Second,CheckRedirect:func(*http.Request,[]*http.Request)error{return http.ErrUseLastResponse}};res,e:=c.Do(r);if e!=nil{panic("request failed")};defer res.Body.Close();fmt.Println(res.StatusCode)}
  • HTTP API, OAuth and MCP

    Find the user API endpoints, their permissions, fields, examples and response formats.

  • GET Read log export status

    Read the status of your protected export job. Download becomes available only after the complete export is ready.

  • GET Download log export

    Download a complete export while its current workspace access, source revisions and retention remain valid.

  • GET Read approved log policy

    A source write key reads only its own enabled state and masking policy. It cannot approve new local files or commands.