GET
/
v1
/
content-sessions
# Get the most recent content session with all related data
curl https://api.usertour.io/v1/content-sessions?contentId=cm9f6vwed0002iejc4vg2zu3t&limit=1&expand[]=content&orderBy=-createdAt&expand[]=version&expand[]=answers&expand[]=company&expand[]=user \
-H 'Authorization: Bearer ak_123456789' \
-H 'Content-Type: application/json'
{
  "results": [
    {
      "id": "cmaavyi16003twg0bgimbcdnr",
      "object": "contentSession",
      "answers": [],
      "completedAt": null,
      "completed": false,
      "contentId": "cm9f6vwed0002iejc4vg2zu3t",
      "content": {
        "id": "cm9f6vwed0002iejc4vg2zu3t",
        "object": "content",
        "name": "fff",
        "type": "flow",
        "editedVersionId": "cm9mkru2c000mlhmajx3l0146",
        "publishedVersionId": "cm9mjsv7d001bvfe8qe8tgzv9",
        "updatedAt": "2025-04-18T09:16:37.989Z",
        "createdAt": "2025-04-13T05:13:29.797Z"
      },
      "createdAt": "2025-05-05T09:36:13.002Z",
      "companyId": "group-1746437717425",
      "company": {
        "id": "group-1746437717425",
        "object": "company",
        "attributes": {
          "name": "Iric L"
        },
        "createdAt": "2025-05-05T09:35:17.434Z"
      },
      "isPreview": false,
      "lastActivityAt": "2025-05-05T09:36:13.016Z",
      "progress": 11,
      "userId": "user-1746437717384",
      "user": {
        "id": "user-1746437717384",
        "object": "user",
        "attributes": {
          "like": ["123", "456"],
          "male": true,
          "name": "Iric L",
          "email": "iric-1746437717384@usertour.com",
          "sdsdd": 13,
          "loginName": "222222222222",
          "registerAt": "2024-03-29T16:05:45.000Z",
          "website_lead": true
        },
        "createdAt": "2025-05-05T09:35:17.406Z"
      },
      "versionId": "cm9mjsv7d001bvfe8qe8tgzv9",
      "version": {
        "id": "cm9mjsv7d001bvfe8qe8tgzv9",
        "object": "contentVersion",
        "number": 13,
        "updatedAt": "2025-04-18T08:49:26.501Z",
        "createdAt": "2025-04-18T08:49:26.501Z"
      }
    }
  ],
  "next": "/v1/content-sessions?contentId=cm9f6vwed0002iejc4vg2zu3t&limit=1&orderBy=-createdAt&cursor=cmaavyi16003twg0bgimbcdnr&expand%5B%5D=content&expand%5B%5D=version&expand%5B%5D=answers&expand%5B%5D=company&expand%5B%5D=user",
  "previous": null
}

Query Parameters

contentId
string
required

Filter sessions by a specific content ID. Only sessions associated with this content will be returned.

userId
string

Filter sessions by a specific user ID. Only sessions created by this user will be returned.

limit
number
default:"20"

Specifies the maximum number of items to return in a single response. The value must be between 1 and 100. If not specified, defaults to 20 items per page.

cursor
string

Specifies the starting point for the next page of results. The response will include items that come after (but not including) the object with this ID. To get the next page, use the ID of the last item from your previous request. The easiest way is to use the list object’s cursor field. If not provided, the API will return items from the beginning of the list.

orderBy
string | string[]

Sort the results by specified fields. Available options:

  • createdAt: Sort by session creation time (default)
  • Use - prefix for descending order: orderBy[]=-createdAt
  • You can combine multiple fields: orderBy[]=-createdAt&orderBy[]=id
expand
string | string[]

Include additional related objects in the response. Available options:

  • content: Include the associated content object
  • version: Include the content version details
  • answers: Include survey answers if any
  • company: Include the associated company information
  • user: Include the user who created the session
  • You can request multiple expansions: expand[]=content&expand[]=user

Response

Returns a list object containing:

  • results: Array of content session objects
  • next: URL for the next page (null if no more pages)
  • previous: URL for the previous page (null if on first page)
# Get the most recent content session with all related data
curl https://api.usertour.io/v1/content-sessions?contentId=cm9f6vwed0002iejc4vg2zu3t&limit=1&expand[]=content&orderBy=-createdAt&expand[]=version&expand[]=answers&expand[]=company&expand[]=user \
-H 'Authorization: Bearer ak_123456789' \
-H 'Content-Type: application/json'
{
  "results": [
    {
      "id": "cmaavyi16003twg0bgimbcdnr",
      "object": "contentSession",
      "answers": [],
      "completedAt": null,
      "completed": false,
      "contentId": "cm9f6vwed0002iejc4vg2zu3t",
      "content": {
        "id": "cm9f6vwed0002iejc4vg2zu3t",
        "object": "content",
        "name": "fff",
        "type": "flow",
        "editedVersionId": "cm9mkru2c000mlhmajx3l0146",
        "publishedVersionId": "cm9mjsv7d001bvfe8qe8tgzv9",
        "updatedAt": "2025-04-18T09:16:37.989Z",
        "createdAt": "2025-04-13T05:13:29.797Z"
      },
      "createdAt": "2025-05-05T09:36:13.002Z",
      "companyId": "group-1746437717425",
      "company": {
        "id": "group-1746437717425",
        "object": "company",
        "attributes": {
          "name": "Iric L"
        },
        "createdAt": "2025-05-05T09:35:17.434Z"
      },
      "isPreview": false,
      "lastActivityAt": "2025-05-05T09:36:13.016Z",
      "progress": 11,
      "userId": "user-1746437717384",
      "user": {
        "id": "user-1746437717384",
        "object": "user",
        "attributes": {
          "like": ["123", "456"],
          "male": true,
          "name": "Iric L",
          "email": "iric-1746437717384@usertour.com",
          "sdsdd": 13,
          "loginName": "222222222222",
          "registerAt": "2024-03-29T16:05:45.000Z",
          "website_lead": true
        },
        "createdAt": "2025-05-05T09:35:17.406Z"
      },
      "versionId": "cm9mjsv7d001bvfe8qe8tgzv9",
      "version": {
        "id": "cm9mjsv7d001bvfe8qe8tgzv9",
        "object": "contentVersion",
        "number": 13,
        "updatedAt": "2025-04-18T08:49:26.501Z",
        "createdAt": "2025-04-18T08:49:26.501Z"
      }
    }
  ],
  "next": "/v1/content-sessions?contentId=cm9f6vwed0002iejc4vg2zu3t&limit=1&orderBy=-createdAt&cursor=cmaavyi16003twg0bgimbcdnr&expand%5B%5D=content&expand%5B%5D=version&expand%5B%5D=answers&expand%5B%5D=company&expand%5B%5D=user",
  "previous": null
}