> ## 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_docs_mintlify/cdn_reseller_api.yaml get /cdn/activity_log/requests
openapi: 3.1.0
info:
  title: Gcore OpenAPI – CDN Reseller 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: 374b36dbeac8
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: Account
    description: Information about CDN product settings in your account.
  - name: CDN service
    description: Information about the current state of CDN service in your account.
  - name: Features
    description: Information about free and paid features available for you account.
  - name: Balancer
    description: >-
      Balancer allows choosing CDN server locations that will be used for
      content delivery.


      To activate balancer, [set client’s balancer
      settings](/api-reference/cdn-resellers/balancer/set-client-balancer-settings).
  - 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
  - name: Logs uploader
    description: Manage logs uploader configs for reseller accounts.
  - name: Statistics
    description: Statistics CDN usage and paid features usage.
  - name: Origin shielding
    description: >-
      Origin shielding helps protect your origin server from being overloaded
      with requests from multiple CDN servers.

      The option accumulates all CDN server requests at a special server called
      a shield or precache server.


      When shielding is enabled, only one precache server communicates with the
      origin host, not the entire CDN.
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/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/limit'
        - $ref: '#/components/parameters/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.
components:
  parameters:
    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 -
    limit:
      name: limit
      in: query
      schema:
        type: integer
      description: Maximum number of items in response.
    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/Count'
        next:
          $ref: '#/components/schemas/Next'
        previous:
          $ref: '#/components/schemas/Previous'
        results:
          $ref: '#/components/schemas/Results'
    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/ActionType'
          state_before_request:
            $ref: '#/components/schemas/StateBeforeRequest'
          state_after_request:
            $ref: '#/components/schemas/StateAfterRequest'
    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

````