> ## Documentation Index
> Fetch the complete documentation index at: https://gcore.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get CDN activity logs

> Get information about all CDN activity logs records.



## OpenAPI

````yaml /api-reference/services_documented/cdn_api.yaml get /cdn/activity_log/requests
openapi: 3.1.0
info:
  title: Gcore OpenAPI – CDN API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: '2026-05-11T15:10:30.328297+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: CDN service
    description: Information about the current state of the CDN service in your account.
    x-displayName: CDN service
  - name: CDN resources
    x-displayName: CDN resources
  - name: Origins
    x-displayName: Origins
  - name: Rules
    description: >-
      Rules allow to set up custom settings for certain file types or paths.

      By default, the rule inherits all options values from the related CDN
      resource.


      Each option in rule settings can be in one of the following states:

      - **Inherit** - Option is not added to the rule. Option inherits its value
      from the CDN resource settings. In this case, the option value is
      **null**.

      - **ON** - Option is added to the rule and enabled. Option values
      configured in the rule will override values from the CDN resource
      settings.

      - **OFF** - Option is added to the rule and disabled. Option will be
      turned off.
    x-displayName: Rules
  - name: Rule templates
    x-displayName: Rule templates
  - name: SSL certificates
    x-displayName: SSL certificates
  - name: Let's Encrypt certificates
    x-displayName: Let's Encrypt certificates
  - name: CA certificates
    x-displayName: CA certificates
  - name: CDN activity logs
    description: |-
      Get the history of users requests to CDN.
      It contains requests made both via the API and via the control panel.

      The following methods are not tracked in the activity logs:
      - HEAD
      - OPTIONS
    x-displayName: CDN activity logs
  - name: Log viewer
    description: >-
      Log viewer provides you with general information about CDN operation. This
      information does not contain all possible

      sets of fields and restricted by time. To receive full data, use Logs
      Uploader.
    x-displayName: Log viewer
  - name: Logs uploader
    description: >-
      Logs uploader allows you to upload logs with desired format to desired
      storages.


      Consists of three main parts:

      - **Policies** - rules that define which logs are uploaded and how they
      are uploaded.

      - **Targets** - destinations where logs are uploaded.

      - **Configs** - combinations of logs uploader policies, targets and
      resources to which they are applied.
    x-displayName: Logs uploader
  - name: Tools
    x-displayName: Tools
  - name: CDN Statistics
    description: >-
      Consumption statistics is updated in near real-time as a standard
      practice.

      However, the frequency of updates can vary, but they are typically
      available within a 24-hour period.

      Exceptions, such as maintenance periods, may delay data beyond 24 hours
      until servers resume and fill in the missing statistics.
    x-displayName: Statistics
  - name: Advanced analytics
    description: >-
      Advanced analytics allows to get statistics about unique visitors,
      traffic, and requests for countries, directories, browsers, devices, and
      operation systems for up to 90 days starting from today.


      Advanced analytics API is based on the [GraphQL
      framework](https://graphql.org/).


      Advanced analytics API has one single endpoint:

       https://api.gcore.com/cdn/advanced/v2/query

      You can pass the query parameters as a JSON object in the payload of a
      POST request to this endpoint.

      You can use curl to make requests to the Advanced analytics API.
      Alternatively, you can use a GraphQL client

      to construct queries and pass requests to the Advanced analytics API.


      You can write queries in GraphQL much like in SQL: specify the data set
      (CDN resource), the metrics

      to retrieve (such as unique visitors and traffic), and filter or group by
      dimensions (for example, a country).
    x-displayName: Advanced analytics
  - name: Origin shielding
    x-displayName: Origin shielding
  - name: IP addresses list
    x-displayName: IP addresses list
  - name: Purge history
    x-displayName: Purge history
paths:
  /cdn/activity_log/requests:
    get:
      tags:
        - CDN activity logs
      summary: Get CDN activity logs
      description: Get information about all CDN activity logs records.
      operationId: get-activity-logs
      parameters:
        - $ref: '#/components/parameters/cdn_path'
        - $ref: '#/components/parameters/user_id'
        - $ref: '#/components/parameters/token_id'
        - $ref: '#/components/parameters/client_id'
        - $ref: '#/components/parameters/method'
        - $ref: '#/components/parameters/min_requested_at'
        - $ref: '#/components/parameters/max_requested_at'
        - $ref: '#/components/parameters/remote_ip_address'
        - $ref: '#/components/parameters/status_code'
        - $ref: '#/components/parameters/query-limit'
        - $ref: '#/components/parameters/query-offset'
      responses:
        '200':
          $ref: '#/components/responses/List'
        '401':
          description: >-
            Authentication credentials were not provided or the given token is
            not valid for any token type.
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from gcore import Gcore

            client = Gcore(
                api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
            )
            page = client.cdn.audit_logs.list()
            page = page.results[0]
            print(page.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/G-Core/gcore-go\"\n\t\"github.com/G-Core/gcore-go/cdn\"\n\t\"github.com/G-Core/gcore-go/option\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.CDN.AuditLogs.List(context.TODO(), cdn.AuditLogListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n"
components:
  parameters:
    cdn_path:
      name: path
      in: query
      schema:
        type: string
      description: Exact URL path.
    user_id:
      name: user_id
      in: query
      schema:
        type: integer
      description: User ID.
    token_id:
      name: token_id
      in: query
      schema:
        type: integer
      description: >-
        Permanent API token ID. Requests made with this token should be
        displayed.
    client_id:
      name: client_id
      in: query
      schema:
        type: integer
      description: Client ID.
    method:
      name: method
      in: query
      schema:
        type: string
      description: |-
        HTTP method type of requests.

        Use upper case only.

        Example:
        - ?method=DELETE
    min_requested_at:
      name: min_requested_at
      in: query
      schema:
        type: string
      description: |-
        Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)

        You can specify a date with a time separated by a space, or just a date.

        Examples:
        - &`min_requested_at`=2021-05-05 12:00:00
        - &`min_requested_at`=2021-05-05
    max_requested_at:
      name: max_requested_at
      in: query
      schema:
        type: string
      description: |-
        End of the requested time period (ISO 8601/RFC 3339 format, UTC.)

        You can specify a date with a time separated by a space, or just a date.

        Examples:
        - &`max_requested_at`=2021-05-05 12:00:00
        - &`max_requested_at`=2021-05-05
    remote_ip_address:
      name: remote_ip_address
      in: query
      schema:
        type: string
      description: Exact IP address from which requests are sent.
    status_code:
      name: status_code
      in: query
      schema:
        type: integer
      description: >-
        Status code returned in the response.


        Specify the first numbers of a status code to get requests for a group
        of status codes.


        To filter the activity logs by 4xx codes, use:

        - &`status_code`=4 -
    query-limit:
      name: limit
      in: query
      schema:
        type: integer
      description: Maximum number of items in response.
    query-offset:
      name: offset
      in: query
      schema:
        type: integer
      description: Offset relative to the beginning of activity logs.
  responses:
    List:
      description: Successful.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ActivityLogsPaginatedList'
          example:
            count: 1
            next: https://api.gcore.com/cdn/activity_log/requests?offset=20&limit=10
            previous: https://api.gcore.com/cdn/activity_log/requests?offset=10&limit=10
            results:
              - id: 1
                user_id: 174
                token_id: 3
                client_id: 174
                requested_at: '2021-07-07T09:02:29.871030Z'
                path: /resources/1/purge
                remote_ip_address: 1.2.3.4
                host: api.gcore.com
                method: POST
                query_params: '{}'
                data:
                  paths:
                    - /url-path-1
                    - /url-path-2
                status_code: 201
                actions: []
  schemas:
    ActivityLogsPaginatedList:
      type: object
      properties:
        count:
          $ref: '#/components/schemas/cdn_Count'
        next:
          $ref: '#/components/schemas/Next'
        previous:
          $ref: '#/components/schemas/Previous'
        results:
          $ref: '#/components/schemas/Results'
    cdn_Count:
      type: integer
      description: Total number of activity logs records.
    Next:
      type: string
      description: URL to the next activity logs records slice.
    Previous:
      type: string
      description: URL to the previous activity logs records slice.
    Results:
      type: array
      items:
        $ref: '#/components/schemas/ActivityLogsDetails'
      description: Activity logs records.
    ActivityLogsDetails:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ID'
        user_id:
          $ref: '#/components/schemas/UserID'
        token_id:
          $ref: '#/components/schemas/TokenID'
        client_id:
          $ref: '#/components/schemas/ClientID'
        requested_at:
          $ref: '#/components/schemas/RequestedAt'
        path:
          $ref: '#/components/schemas/Path'
        remote_ip_address:
          $ref: '#/components/schemas/RemoteIPAddress'
        host:
          $ref: '#/components/schemas/Host'
        method:
          $ref: '#/components/schemas/Method'
        query_params:
          $ref: '#/components/schemas/QueryParams'
        data:
          $ref: '#/components/schemas/Data'
        status_code:
          $ref: '#/components/schemas/StatusCode'
        actions:
          $ref: '#/components/schemas/Actions'
    ID:
      type: integer
      description: Activity logs record ID.
    UserID:
      type: integer
      description: ID of the user who made the request.
    TokenID:
      type: integer
      description: Permanent API token ID with which the request was made.
    ClientID:
      type: integer
      description: ID of the client who made the request.
    RequestedAt:
      type: string
      description: Date and time when the request was made.
    Path:
      type: string
      description: Request URL.
    RemoteIPAddress:
      type: string
      description: IP address from which the request was made.
    Host:
      type: string
      description: Host from which the request was made.
    Method:
      type: string
      description: Request HTTP method.
    QueryParams:
      type: string
      description: Request parameters.
    Data:
      type: object
      description: Request body.
    StatusCode:
      type: integer
      description: Status code that is returned in the response.
    Actions:
      type: array
      description: State of a requested object before and after the request.
      items:
        type: object
        properties:
          action_type:
            $ref: '#/components/schemas/cdn_ActionType'
          state_before_request:
            $ref: '#/components/schemas/StateBeforeRequest'
          state_after_request:
            $ref: '#/components/schemas/StateAfterRequest'
    cdn_ActionType:
      type: string
      description: |-
        Type of change.

        Possible values:
        - **D** - Object is deleted.
        - **C** - Object is created.
        - **U** - Object is updated.
    StateBeforeRequest:
      type: object
      description: JSON representation of object before the request.
    StateAfterRequest:
      type: object
      description: JSON representation of object after the request.
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````