Auth0 logs API

The logs API from Auth0 — 2 operation(s) for logs.

OpenAPI Specification

auth0-logs-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Auth0 Authentication actions logs API
  description: Auth0 Authentication API. Endpoints for authentication and authorization using OpenID Connect, OAuth 2.0, SAML, WS-Federation, and Passwordless flows.
  version: 1.0.0
servers:
- url: '{auth0_domain}'
  description: The Authentication API is served over HTTPS.
  variables:
    auth0_domain:
      description: Auth0 domain
      default: https://demo.us.auth0.com
tags:
- name: logs
paths:
  /logs:
    get:
      summary: Search Log Events
      description: "Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified).\n\nSet custom search criteria using the <code>q</code> parameter, or search from a specific log ID (<i>\"search from checkpoint\"</i>).\n\nFor more information on all possible event types, their respective acronyms, and descriptions, see <a href=\"https://auth0.com/docs/logs/log-event-type-codes\">Log Event Type Codes</a>.\n\n<h5>To set custom search criteria, use the following parameters:</h5>\n\n<ul>\n    <li><b>q:</b> Search Criteria using <a href=\"https://auth0.com/docs/logs/log-search-query-syntax\">Query String Syntax</a></li>\n    <li><b>page:</b> Page index of the results to return. First page is 0.</li>\n    <li><b>per_page:</b> Number of results per page.</li>\n    <li><b>sort:</b> Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`</li>\n    <li><b>fields:</b> Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.</li>\n    <li><b>include_fields:</b> Whether specified fields are to be included (true) or excluded (false).</li>\n    <li><b>include_totals:</b> Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). <b>Deprecated:</b> this field is deprecated and should be removed from use. See <a href=\"https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination\">Search Engine V3 Breaking Changes</a></li>\n</ul>\n\nFor more information on the list of fields that can be used in <code>fields</code> and <code>sort</code>, see <a href=\"https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields\">Searchable Fields</a>.\n\nAuth0 <a href=\"https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations\">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the <a href=\"https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint\">get logs by checkpoint method</a>.\n\n<h5>To search from a checkpoint log ID, use the following parameters:</h5>\n<ul>\n    <li><b>from:</b> Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the <code>take</code> parameter. If you use <code>from</code> at the same time as <code>q</code>, <code>from</code> takes precedence and <code>q</code> is ignored.</li>\n    <li><b>take:</b> Number of entries to retrieve when using the <code>from</code> parameter.</li>\n</ul>\n\n<strong>Important:</strong> When fetching logs from a checkpoint log ID, any parameter other than <code>from</code> and <code>take</code> will be ignored, and date ordering is not guaranteed.\n"
      tags:
      - logs
      parameters:
      - name: page
        in: query
        description: Page index of the results to return. First page is 0.
        schema:
          type: integer
          minimum: 0
      - name: per_page
        in: query
        description: ' Number of results per page. Paging is disabled if parameter not sent. Default: <code>50</code>. Max value: <code>100</code>'
        schema:
          type: integer
          minimum: 0
          maximum: 100
      - name: sort
        in: query
        description: Field to use for sorting appended with <code>:1</code>  for ascending and <code>:-1</code> for descending. e.g. <code>date:-1</code>
        schema:
          type: string
          pattern: ^((date)|(connection)|(client_id)|(client_name)|(ip)|(user_id)|(user_name)|(description)|(user_agent)|(type)|(details)|(strategy)|(strategy_type))\:(1|-1)$
      - name: fields
        in: query
        description: Comma-separated list of fields to include or exclude (based on value provided for <code>include_fields</code>) in the result. Leave empty to retrieve all fields.
        schema:
          type: string
          pattern: ^((date)|(connection)|(client_id)|(client_name)|(ip)|(user_id)|(user_name)|(description)|(user_agent)|(type)|(details)|(strategy)|(strategy_type))(,((date)|(connection)|(client_id)|(client_name)|(ip)|(user_id)|(user_name)|(description)|(user_agent)|(type)|(details)|(strategy)|(strategy_type)))*$
      - name: include_fields
        in: query
        description: Whether specified fields are to be included (<code>true</code>) or excluded (<code>false</code>)
        schema:
          type: boolean
      - name: include_totals
        in: query
        description: Return results as an array when false (default). Return results inside an object that also contains a total result count when true.
        schema:
          type: boolean
      - name: from
        in: query
        description: Log Event Id from which to start selection from.
        schema:
          type: string
      - name: take
        in: query
        description: Number of entries to retrieve when using the <code>from</code> parameter. Default <code>50</code>, max <code>100</code>
        schema:
          type: integer
      - name: search
        in: query
        description: 'Retrieves logs that match the specified search criteria. This parameter can be combined with all the others in the /api/logs endpoint but is specified separately for clarity.

          If no fields are provided a case insensitive ''starts with'' search is performed on all of the following fields: client_name, connection, user_name. Otherwise, you can specify multiple fields and specify the search using the %field%:%search%, for example: application:node user:"John@contoso.com".

          Values specified without quotes are matched using a case insensitive ''starts with'' search. If quotes are used a case insensitve exact search is used. If multiple fields are used, the AND operator is used to join the clauses.'
        schema:
          type: string
      responses:
        '200':
          description: Logs successfully retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListLogResponseContent'
        '400':
          description: Invalid request URI. The message will vary depending on the cause.
        '401':
          description: Invalid token.
          x-description-1: Invalid signature received for JSON Web Token validation.
        '403':
          description: 'Insufficient scope; expected any of: read:logs, read:logs_users.'
        '429':
          description: Too many requests. Check the X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers.
      operationId: get_logs
      x-release-lifecycle: GA
      x-operation-name: list
      x-operation-request-parameters-name: ListLogsRequestParameters
      x-operation-group: logs
      security:
      - bearerAuth: []
      - oAuth2ClientCredentials:
        - read:logs
        - read:logs_users
  /logs/{id}:
    get:
      summary: Get a Log Event by Id
      description: Retrieve an individual log event.
      tags:
      - logs
      parameters:
      - name: id
        in: path
        description: log_id of the log to retrieve.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Log successfully retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLogResponseContent'
        '400':
          description: Invalid request URI. The message will vary depending on the cause.
        '401':
          description: Invalid token.
          x-description-1: Invalid signature received for JSON Web Token validation.
        '403':
          description: 'Insufficient scope; expected any of: read:logs, read:logs_users.'
        '404':
          description: Log not found.
        '429':
          description: Too many requests. Check the X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers.
      operationId: get_logs_by_id
      x-release-lifecycle: GA
      x-operation-name: get
      x-operation-group: logs
      security:
      - bearerAuth: []
      - oAuth2ClientCredentials:
        - read:logs
        - read:logs_users
components:
  schemas:
    ListLogOffsetPaginatedResponseContent:
      type: object
      additionalProperties: false
      properties:
        start:
          type: number
        limit:
          type: number
        length:
          type: number
        total:
          type: number
        logs:
          type: array
          items:
            $ref: '#/components/schemas/Log'
    LogDate:
      oneOf:
      - type: string
        description: Date when the event occurred in ISO 8601 format.
        default: '2016-02-23T19:57:29.532Z'
      - $ref: '#/components/schemas/LogDateObject'
    GetLogResponseContent:
      type: object
      additionalProperties: true
      properties:
        date:
          $ref: '#/components/schemas/LogDate'
        type:
          type: string
          description: Type of event.
          default: sapi
        description:
          type:
          - string
          - 'null'
          description: Description of this event.
        connection:
          type: string
          description: Name of the connection the event relates to.
        connection_id:
          type: string
          description: ID of the connection the event relates to.
        client_id:
          type: string
          description: ID of the client (application).
          default: AaiyAPdpYdesoKnqjj8HJqRn4T5titww
        client_name:
          type: string
          description: Name of the client (application).
          default: My application Name
        ip:
          type: string
          description: IP address of the log event source.
          default: 190.257.209.19
        hostname:
          type: string
          description: Hostname the event applies to.
          default: 190.257.209.19
        user_id:
          type: string
          description: ID of the user involved in the event.
          default: auth0|56c75c4e42b6359e98374bc2
        user_name:
          type: string
          description: Name of the user involved in the event.
        audience:
          type: string
          description: API audience the event applies to.
        scope:
          type: string
          description: Scope permissions applied to the event.
          default: ''
        strategy:
          type: string
          description: Name of the strategy involved in the event.
        strategy_type:
          type: string
          description: Type of strategy involved in the event.
        log_id:
          type: string
          description: Unique ID of the event.
        isMobile:
          type: boolean
          description: Whether the client was a mobile device (true) or desktop/laptop/server (false).
        details:
          $ref: '#/components/schemas/LogDetails'
        user_agent:
          type: string
          description: User agent string from the client device that caused the event.
        security_context:
          $ref: '#/components/schemas/LogSecurityContext'
        location_info:
          $ref: '#/components/schemas/LogLocationInfo'
    Log:
      type: object
      additionalProperties: true
      properties:
        date:
          $ref: '#/components/schemas/LogDate'
        type:
          type: string
          description: Type of event.
          default: sapi
        description:
          type:
          - string
          - 'null'
          description: Description of this event.
        connection:
          type: string
          description: Name of the connection the event relates to.
        connection_id:
          type: string
          description: ID of the connection the event relates to.
        client_id:
          type: string
          description: ID of the client (application).
          default: AaiyAPdpYdesoKnqjj8HJqRn4T5titww
        client_name:
          type: string
          description: Name of the client (application).
          default: My application Name
        ip:
          type: string
          description: IP address of the log event source.
          default: 190.257.209.19
        hostname:
          type: string
          description: Hostname the event applies to.
          default: 190.257.209.19
        user_id:
          type: string
          description: ID of the user involved in the event.
          default: auth0|56c75c4e42b6359e98374bc2
        user_name:
          type: string
          description: Name of the user involved in the event.
        audience:
          type: string
          description: API audience the event applies to.
        scope:
          type: string
          description: Scope permissions applied to the event.
          default: ''
        strategy:
          type: string
          description: Name of the strategy involved in the event.
        strategy_type:
          type: string
          description: Type of strategy involved in the event.
        log_id:
          type: string
          description: Unique ID of the event.
        isMobile:
          type: boolean
          description: Whether the client was a mobile device (true) or desktop/laptop/server (false).
        details:
          $ref: '#/components/schemas/LogDetails'
        user_agent:
          type: string
          description: User agent string from the client device that caused the event.
        security_context:
          $ref: '#/components/schemas/LogSecurityContext'
        location_info:
          $ref: '#/components/schemas/LogLocationInfo'
    LogLocationInfo:
      type: object
      description: Information about the location that triggered this event based on the `ip`.
      additionalProperties: true
      properties:
        country_code:
          type: string
          description: Two-letter <a href="https://www.iso.org/iso-3166-country-codes.html">Alpha-2 ISO 3166-1</a> country code.
          minLength: 2
          maxLength: 2
        country_code3:
          type: string
          description: Three-letter <a href="https://www.iso.org/iso-3166-country-codes.html">Alpha-3 ISO 3166-1</a> country code.
          minLength: 3
          maxLength: 3
        country_name:
          type: string
          description: Full country name in English.
        city_name:
          type: string
          description: Full city name in English.
        latitude:
          type: number
          description: Global latitude (horizontal) position.
        longitude:
          type: number
          description: Global longitude (vertical) position.
        time_zone:
          type: string
          description: Time zone name as found in the <a href="https://www.iana.org/time-zones">tz database</a>.
        continent_code:
          type: string
          description: Continent the country is located within. Can be `AF` (Africa), `AN` (Antarctica), `AS` (Asia), `EU` (Europe), `NA` (North America), `OC` (Oceania) or `SA` (South America).
    LogDetails:
      type: object
      description: Additional useful details about this event (structure is dependent upon event type).
      additionalProperties: true
    LogSecurityContext:
      type: object
      description: Information about security-related signals.
      additionalProperties: true
      properties:
        ja3:
          type: string
          description: JA3 fingerprint value.
        ja4:
          type: string
          description: JA4 fingerprint value.
    LogDateObject:
      type: object
      description: Date when the event occurred in ISO 8601 format.
      additionalProperties: true
    ListLogResponseContent:
      oneOf:
      - type: array
        items:
          $ref: '#/components/schemas/Log'
      - $ref: '#/components/schemas/ListLogOffsetPaginatedResponseContent'