# Get profile's own events

- Operation ID: `getEvents`
- HTTP method: `GET`
- Path: `/activities-api/events`
- [Human-readable API reference](https://hub.synerise.com/api-reference/data-management#tag/Activities/operation/getEvents)

## Self-contained OpenAPI method

The fenced document below contains this method's documentation and all of its local references. It is self-contained; no category or master specification fetch is required.

```yaml
openapi: 3.0.0
info:
  title: Synerise Public API
  version: 1.9.1
paths:
  /activities-api/events:
    get:
      tags:
        - Activities
      summary: Get profile's own events
      description: |
        As a profile, retrieve a list of your own events.


        ---

        **API consumer:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=authenticateUsingPOST_v3" target="_blank" rel="noopener">Profile (Client)</a>

        **User role permission required:** `client_activities: read`
      operationId: getEvents
      parameters:
        - in: query
          name: actions
          required: false
          description: A comma-separated list of actions (or a single action) that will be included in the response
          schema:
            type: string
          example: page.visit
        - in: query
          name: dateFrom
          description: Lower value of the time range, as a Unix timestamp in milliseconds.
          required: false
          schema:
            type: number
        - in: query
          name: dateTo
          description: Upper limit of the time range to fetch, as a Unix timestamp in milliseconds.
          required: false
          schema:
            type: number
        - in: query
          name: limit
          description: The maximum number of events to retrieve
          required: false
          schema:
            type: number
            minimum: 1
            maximum: 1000
        - in: query
          name: raw
          description: 'When `true`, the response returns raw data. If raw data is not available, processed data from event storage (like from `"raw": false`) is returned instead.'
          required: false
          schema:
            type: boolean
            default: false
        - in: query
          name: pageToken
          description: The token of the page to retrieve. You can check the tokens of the next/previous page in the response to this endpoint. If not provided, the first page is retrieved.
          required: false
          schema:
            type: string
        - in: query
          name: sortBy
          required: false
          description: Sorting order. `time:desc` (default) returns newest events first.
          schema:
            type: string
            default: time:desc
            enum:
              - time:desc
              - time:asc
      responses:
        "200":
          description: Events
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                  - data
                properties:
                  meta:
                    type: object
                    description: Pagination metadata
                    properties:
                      links:
                        type: array
                        description: Links to the neighboring pages and the first page
                        items:
                          type: object
                          required:
                            - url
                            - rel
                          properties:
                            url:
                              type: string
                              description: URL of the page, used for navigation
                            rel:
                              type: string
                              description: The type of relation to the current page. `first` is always the first page.
                              enum:
                                - first
                                - prev
                                - next
                      cursors:
                        type: object
                        description: Tokens of the next and previous pages
                        required:
                          - after
                          - before
                        properties:
                          after:
                            type: string
                            description: Token of the next page
                          before:
                            type: string
                            description: Token of the previous page
                      limit:
                        type: integer
                        format: int32
                        description: Limit of items per page
                      count:
                        type: integer
                        nullable: true
                        description: The number of items on the current page
                  data:
                    type: array
                    description: A list of events
                    items:
                      oneOf:
                        - type: object
                          title: Data from event storage
                          properties:
                            action:
                              type: object
                              title: Action
                              description: Details of the action.
                              properties:
                                name:
                                  type: string
                                  example: page.visit
                                  description: "Action name. Can be up to 32 characters long and must match the following regular expression: `^[a-zA-Z0-9\\.\\-_]+$`"
                                label:
                                  type: string
                                  description: Human-readable label of the event. Used in Data Management, Analytics, and Automation modules. You can add this parameter to an event the Data Management module, but up to 48 hours may pass until it's returned here.
                                description:
                                  type: string
                                  description: Description of the event. Used in Data Management, Analytics, and Automation modules. You can add this parameter to an event the Data Management module, but up to 48 hours may pass until it's returned here.
                                  nullable: true
                            description:
                              type: string
                              description: |-
                                Event description shown in a Profile card. Can include jinja inserts, which are returned unprocessed.
                                This description is not used when searching for events in Analytics or for Automation trigger purposes.
                            eventUUID:
                              type: string
                              description: UUID of the event
                              example: 482af443-7f6f-4b80-b4ac-a7db5a2f543a
                            unique:
                              type: integer
                              description: Unique identifier of the event
                              example: 1245924049
                            icon:
                              type: string
                              description: URL of the event's icon
                            icons:
                              type: object
                              description: Icon configuration with primary, secondary icon and color
                              required:
                                - primary
                              properties:
                                primary:
                                  type: string
                                  description: Primary icon ID/name from the system SVG library
                                secondary:
                                  type: string
                                  nullable: true
                                  description: Secondary icon ID/name from the system SVG library
                                color:
                                  type: string
                                  nullable: true
                                  description: Semantic color name (e.g. positive, negative, warning, neutral) or hex color code
                            time:
                              type: integer
                              description: |-
                                Unix timestamp of when the event occurred, in milliseconds.

                                This is the time that:
                                - is sent as `recordedAt` to **v4/transactions/** endpoints
                                - is sent as `time` to **v4/events/** endpoints
                                - is the occurrence time of system events
                                - is used (after converting to ISO string) as the event time when overwriting with eventSalt (see v4/events endpoints)

                                If the event had no time provided when sending, the time of receiving the event is used.

                                If the event had a future time when sending, it was rejected and the time of receiving the event is used.
                              example: 1667563770404
                            label:
                              description: |-
                                Event name shown in a Profile card (not in Analytics). Can include jinja inserts, which are returned unprocessed.

                                This name is not used when searching for events in Analytics or for Automation trigger purposes.

                                If no label is defined in the Data Management settings, this field returns the value of `label` that was sent with the original event, but that is not used by the Synerise Web Application.
                              type: string
                            client:
                              type: object
                              description: Profile's data
                              properties:
                                uuid:
                                  type: string
                                  description: Profile's UUID
                                id:
                                  type: number
                                  description: Profile's ID
                                firstname:
                                  description: Profile's first name
                                  type: string
                                lastname:
                                  description: Profile's last name
                                  type: string
                                email:
                                  description: Profile's email address
                                  type: string
                                avatarUrl:
                                  description: URL of the profile's avatar
                                  type: string
                            userAgent:
                              type: object
                              description: User Agent details
                              properties:
                                system:
                                  type: string
                                  description: Operating System
                                browser:
                                  description: Browser
                                  type: string
                            modifiedBy:
                              nullable: true
                              type: string
                              deprecated: true
                        - type: object
                          title: Raw data
                          properties:
                            eventUUID:
                              type: string
                              description: UUID of the event
                              example: 482af443-7f6f-4b80-b4ac-a7db5a2f543a
                            unique:
                              type: integer
                              nullable: true
                              description: Not available (null) with raw data
                            action:
                              type: string
                              example: page.visit
                              description: "Action name. Can be up to 32 characters long and must match the following regular expression: `^[a-zA-Z0-9\\.\\-_]+$`"
                            label:
                              type: string
                              deprecated: true
                              description: The label that was sent with the event.
                            client:
                              type: object
                              description: Profile's data
                              properties:
                                uuid:
                                  type: string
                                  description: Profile's UUID
                                id:
                                  type: number
                                  description: Profile's ID
                                firstname:
                                  description: Profile's first name
                                  type: string
                                lastname:
                                  description: Profile's last name
                                  type: string
                                email:
                                  description: Profile's email address
                                  type: string
                                avatarUrl:
                                  description: URL of the profile's avatar
                                  type: string
                            params:
                              type: object
                              description: Parameters of the event. Some of the parameters listed here don't exist in system events.
                              additionalProperties:
                                description: Other parameters depending on event type and custom parameters
                              properties:
                                ip:
                                  type: string
                                  description: IP of the device which sent the event
                                clientId:
                                  type: number
                                  description: Profile's ID
                                uuid:
                                  type: string
                                  description: Profile's UUID
                                snr-original-time:
                                  type: string
                                  description: Original ISO string that was sent with the event. This is saved without modification even if the time was rejected (for example, because it was a future date).
                                eventUUID:
                                  type: string
                                  description: UUID of the event
                                  example: 482af443-7f6f-4b80-b4ac-a7db5a2f543a
                                eventCreateTime:
                                  type: string
                                  format: date-time
                                  description: |-
                                    Time when the event was received, as an ISO string.
                                    When you overwrite an event with eventSalt, this value changes to the time of overwriting.
                                  example: 2022-11-04T12:09:30.404Z
                                time:
                                  type: integer
                                  description: |-
                                    Unix timestamp of when the event occurred, in milliseconds.

                                    This is the time that:
                                    - is sent as `recordedAt` to **v4/transactions/** endpoints
                                    - is sent as `time` to **v4/events/** endpoints
                                    - is the occurrence time of system events
                                    - is used (after converting to ISO string) as the event time when overwriting with eventSalt (see v4/events endpoints)

                                    If the event had no time provided when sending, the time of receiving the event is used.

                                    If the event had a future time when sending, it was rejected and the time of receiving the event is used.
                                  example: 1667563770404
                                businessProfileId:
                                  type: integer
                                  description: Workspace ID
                            createDate:
                              type: integer
                              description: |-
                                Unix timestamp of when the event occurred, in milliseconds.

                                This is the time that:
                                - is sent as `recordedAt` to **v4/transactions/** endpoints
                                - is sent as `time` to **v4/events/** endpoints
                                - is the occurrence time of system events
                                - is used (after converting to ISO string) as the event time when overwriting with eventSalt (see v4/events endpoints)

                                If the event had no time provided when sending, the time of receiving the event is used.

                                If the event had a future time when sending, it was rejected and the time of receiving the event is used.
                              example: 1667563770404
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Activities/operation/getEvents
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/activities-api/events?actions=page.visit&dateFrom=SOME_NUMBER_VALUE&dateTo=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&raw=SOME_BOOLEAN_VALUE&pageToken=SOME_STRING_VALUE&sortBy=SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/activities-api/events?actions=page.visit&dateFrom=SOME_NUMBER_VALUE&dateTo=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&raw=SOME_BOOLEAN_VALUE&pageToken=SOME_STRING_VALUE&sortBy=SOME_STRING_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/activities-api/events?actions=page.visit&dateFrom=SOME_NUMBER_VALUE&dateTo=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&raw=SOME_BOOLEAN_VALUE&pageToken=SOME_STRING_VALUE&sortBy=SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/activities-api/events?actions=page.visit&dateFrom=SOME_NUMBER_VALUE&dateTo=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&raw=SOME_BOOLEAN_VALUE&pageToken=SOME_STRING_VALUE&sortBy=SOME_STRING_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/activities-api/events');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'actions' => 'page.visit',
              'dateFrom' => 'SOME_NUMBER_VALUE',
              'dateTo' => 'SOME_NUMBER_VALUE',
              'limit' => 'SOME_NUMBER_VALUE',
              'raw' => 'SOME_BOOLEAN_VALUE',
              'pageToken' => 'SOME_STRING_VALUE',
              'sortBy' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/activities-api/events?actions=page.visit&dateFrom=SOME_NUMBER_VALUE&dateTo=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&raw=SOME_BOOLEAN_VALUE&pageToken=SOME_STRING_VALUE&sortBy=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
servers:
  - description: Microsoft Azure EU
    url: https://api.synerise.com
  - description: Microsoft Azure USA
    url: https://api.azu.synerise.com
  - description: Google Cloud Platform
    url: https://api.geb.synerise.com
tags:
  - name: Activities
components:
  securitySchemes:
    JWT:
      type: http
      scheme: bearer
      description: |-
        JWT Bearer token. The header looks like this: `Bearer {JWT}`

        Remember to include the space between 'Bearer' and the token.

        Generate a token via the **Authorization** endpoints.
```
