# Get profile activities

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

## 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/activities/{clientId}:
    get:
      deprecated: true
      tags:
        - Activities
      summary: Get profile activities
      description: |
        Retrieve a list of activities from a single profile.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `ACTIVITIES_API_ACTIVITIES_READ`

        **User role permission required:** `client_activities: read`
      operationId: getActivitiesPerClient
      security:
        - JWT: []
      parameters:
        - in: path
          name: clientId
          description: The ID of the profile
          required: true
          schema:
            type: number
            example: "434428563"
        - in: query
          name: dateFrom
          description: Lower value of the time range, as a Unix timestamp in milliseconds. Defaults to current time minus 2 hours.
          required: false
          schema:
            type: number
        - in: query
          name: dateTo
          description: Upper limit of the time range to fetch, as a Unix timestamp in milliseconds. Defaults to current time.
          required: false
          schema:
            type: number
        - 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: 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: format
          description: The format of the retrieved data
          required: false
          schema:
            enum:
              - json
              - csv
            type: string
            default: json
      responses:
        "200":
          description: Activities
          content:
            application/json:
              schema:
                type: array
                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:
                        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\\.\\-_]+$`"
                        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
                        label:
                          type: string
                          deprecated: true
                        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
                          properties:
                            ip:
                              type: string
                              description: IP of the device which sent the event
                            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
                          additionalProperties:
                            description: Custom parameters that were sent with the event
                        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
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Activities/operation/getActivitiesPerClient
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/activities-api/activities/434428563?dateFrom=SOME_NUMBER_VALUE&dateTo=SOME_NUMBER_VALUE&actions=page.visit&limit=SOME_NUMBER_VALUE&raw=SOME_BOOLEAN_VALUE&format=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/activities/434428563?dateFrom=SOME_NUMBER_VALUE&dateTo=SOME_NUMBER_VALUE&actions=page.visit&limit=SOME_NUMBER_VALUE&raw=SOME_BOOLEAN_VALUE&format=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/activities/434428563?dateFrom=SOME_NUMBER_VALUE&dateTo=SOME_NUMBER_VALUE&actions=page.visit&limit=SOME_NUMBER_VALUE&raw=SOME_BOOLEAN_VALUE&format=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/activities/434428563?dateFrom=SOME_NUMBER_VALUE&dateTo=SOME_NUMBER_VALUE&actions=page.visit&limit=SOME_NUMBER_VALUE&raw=SOME_BOOLEAN_VALUE&format=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/activities/434428563');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'dateFrom' => 'SOME_NUMBER_VALUE',
              'dateTo' => 'SOME_NUMBER_VALUE',
              'actions' => 'page.visit',
              'limit' => 'SOME_NUMBER_VALUE',
              'raw' => 'SOME_BOOLEAN_VALUE',
              'format' => '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/activities/434428563?dateFrom=SOME_NUMBER_VALUE&dateTo=SOME_NUMBER_VALUE&actions=page.visit&limit=SOME_NUMBER_VALUE&raw=SOME_BOOLEAN_VALUE&format=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.
```
