List application fields

List the fields an application's data can be queried by, with their types. The list holds the fields seen in the application's logs, spans, exceptions or web events in the last 6 hours. The response lists every field at once. An application that received no data in the last 6 hours returns an empty list.

GET https://errors.betterstack.com/api/v4/applications/{application_id}/fields

URL parameters

application_id
required string

Query parameters

source_type
DEFAULT logs string
team_id
string

Headers

Authorization
required string
200

Response body

{
  "data": [
    {
      "id": "123456789",
      "type": "source_field",
      "attributes": {
        "path": "error.message",
        "path_parts": [
          "'error'",
          "'message'"
        ],
        "type": "String"
      }
    }
  ]
}
401

Response body

{
  "errors": "Invalid Team API token. How to find your Team API token: https://betterstack.com/docs/logs/api/getting-started/#obtaining-a-logtail-api-token"
}
403
404

Response body

{
  "errors": "Resource with the provided ID was not found"
}
422

Response body

{
  "errors": "Sorry, some values are incorrect",
  "invalid_values": {
    "source_type": "This source has no spans data."
  }
}

Response attributes

id
string
type
string
path
string
path_parts
array of strings
attributes.type
string

Example cURL

List application fields Web event fields
curl --request GET \
  --url https://errors.betterstack.com/api/v4/applications/1234/fields \
  --header "Authorization: Bearer $TOKEN"
curl --request GET \
  --url "https://errors.betterstack.com/api/v4/applications/1234/fields?source_type=web_events" \
  --header "Authorization: Bearer $TOKEN"