Skip to main content
POST
/
user-sessions
Get User Sessions
curl --request POST \
  --url https://api.publisher.miratsquanto.com/api/v1/publisher/user-sessions \
  --header 'Content-Type: application/json' \
  --header 'publisher-authentication-key: <api-key>' \
  --data '
{
  "authorizationKey": "DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU",
  "rows": 100,
  "page": 1,
  "sessionType": 0,
  "status": "completed",
  "startDate": "2025-11-24",
  "endDate": "2025-12-24"
}
'
{
  "success": true,
  "message": "User sessions fetched successfully",
  "data": [
    {
      "rid": "c339b91cf474987f12aa43015b436f15",
      "surveyNumber": 1759222310541001,
      "clientStatus": {
        "title": "Survey completed",
        "description": "A survey has been completed by a user",
        "code": 10
      },
      "miratsStatus": {
        "title": "Redirected to client survey",
        "description": "The user has been redirected to the client survey",
        "code": 3
      },
      "OS": "Mac OS X",
      "IP": "159.253.79.204",
      "browser": "Chrome",
      "device": "Desktop",
      "duration": "00:19:07",
      "country": "GB",
      "timezone": "Europe/London",
      "startTime": "2025-10-01T04:11:21.819Z",
      "endTime": "2025-10-01T04:30:29.007Z",
      "reconciliationStatus": "Approved"
    }
  ],
  "pagination": {
    "totalDocument": 59,
    "rows": 500,
    "page": 1,
    "totalPages": 1
  },
  "organisation": "Organisation Name",
  "project": "Project Name"
}

Get User Sessions

Retrieve user session data with filtering and pagination options.

Endpoint

POST /user-sessions

Headers

{
  "publisher-authentication-key": "your_project_secret_key"
}
Note: The publisher-authentication-key header corresponds to your Secret Key. The authorizationKey in the request body corresponds to your Web API Key.

Request Body

{
  "authorizationKey": "your web api key",
  "rows": 100,
  "page": 1,
  "sessionType": 0,
  "status": "completed",
  "startDate": "2025-11-24",
  "endDate": "2025-12-24"
}

Request Body Parameters

ParameterTypeRequiredDefaultDescription
authorizationKeystringYes-Publisher’s project web API key
rowsintegerNo100Number of records per page. Min: 1, Max: 500.
pageintegerNo1The page number for pagination.
sessionTypeintegerNo00 = Live, 1 = Test.
statusstringNo”all”Enum: all, completed, overquota, terminated, securityDrop, prescreen.
startDatestringNoLast MonthISO Date format (YYYY-MM-DD). Defaults to 30 days ago.
endDatestringNoTodayISO Date format (YYYY-MM-DD). Defaults to current date.

Response

{
  "success": true,
  "message": "User sessions fetched successfully",
  "organisation": "Organisation Name",
  "project": "Project Name",
  "data": [
    {
      "rid": "c339b91cf474987f12aa43015b436f15",
      "clientStatus": {
        "title": "Survey completed",
        "description": "A survey has been completed by a user",
        "code": 10
      },
      "miratsStatus": {
        "title": "Redirected to client survey",
        "description": "The user has been redirected to the client survey",
        "code": 3
      },
      "surveyNumber": 1759222310541001,
      "OS": "Mac OS X",
      "IP": "159.253.79.204",
      "browser": "Chrome",
      "device": "Desktop",
      "duration": "00:19:07",
      "country": "GB",
      "timezone": "Europe/London",
      "startTime": "2025-10-01T04:11:21.819Z",
      "endTime": "2025-10-01T04:30:29.007Z",
      "reconciliationStatus": "Approved"
    }
  ],
  "pagination": {
    "totalDocument": 59,
    "rows": 500,
    "page": 1,
    "totalPages": 1
  }
}

Error Response

{
  "message": "internal server error",
  "code": 500,
  "success": false
}

Authorizations

publisher-authentication-key
string
header
required

Send your Secret Key using the publisher-authentication-key header. This header is required for every request.

Body

application/json

Payload for retrieving user sessions. Includes your Web API Key plus optional filtering criteria.

authorizationKey
string
required

Publisher's project web API key

Example:

"DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU"

rows
integer
default:100

Number of records per page. Min: 1, Max: 500.

Required range: 1 <= x <= 500
Example:

100

page
integer
default:1

The page number for pagination.

Required range: x >= 1
Example:

1

sessionType
enum<integer>
default:0

0 = Live, 1 = Test.

Available options:
0,
1
Example:

0

status
enum<string>
default:all

Session status filter

Available options:
all,
completed,
overquota,
terminated,
securityDrop,
prescreen
Example:

"completed"

startDate
string<date>

ISO Date format (YYYY-MM-DD). Defaults to 30 days ago.

Example:

"2025-11-24"

endDate
string<date>

ISO Date format (YYYY-MM-DD). Defaults to current date.

Example:

"2025-12-24"

Response

Successful response with user sessions data

success
boolean
required
Example:

true

message
string
required
Example:

"User sessions fetched successfully"

data
object[]
required
pagination
object
required
organisation
string
Example:

"Organisation Name"

project
string
Example:

"Project Name"