Retrieve All Sessions

This API allows users to fetch a paginated list of conversation histories within a specified time range.

Endpoint

GET https://api.genaifactory.ai/v1/all_sessions

Headers

Name
Type
Required
Description

formacloud-api-key

string

Yes

API key for authentication

Query Parameters

Name
Type
Required
Description

start

string (ISO 8601)

No

Start timestamp (UTC) in ISO 8601 format (e.g., 2024-02-20T00:00:00Z). If not provided, no lower limit is applied.

end

string (ISO 8601)

No

End timestamp (UTC) in ISO 8601 format (e.g., 2024-02-21T00:00:00Z). If not provided, no upper limit is applied.

page

int

No

Page number (default: 0).

page_size

int

No

Number of records per page (default: 10).

Example Request

Fetch Conversation History (Default Pagination)

curl --location 'https://api.genaifactory.ai/v1/all_sessions?page=0&page_size=10' \
--header 'formacloud-api-key: abc123'

Fetch History Within a Time Range

curl --location 'https://api.genaifactory.ai/v1/all_sessions?start=2024-02-20T00:00:00Z&end=2024-02-21T00:00:00Z&page=1&page_size=5' \
--header 'formacloud-api-key: abc123'

Response

Returns a JSON object containing conversation history and pagination details.

Response Fields

Field
Type
Description

history

array

List of conversation history records

goal

string

The goal of the conversation

session_id

string

Unique session identifier

created_at

string (ISO 8601)

The timestamp when the session was created

pagination

object

Pagination metadata

current_page

int

The current page number

total_pages

int

The total number of pages

total_records

int

The total number of history records

Example Response

{
    "history": [
        {
            "created_at": "2025-02-25T11:37:30.872055+00:00",
            "goal": "Ask the user what he/she wants, and help them create it.",
            "session_id": "shuxuan-test-4"
        },
        {
            "created_at": "2025-02-25T11:24:30.659717+00:00",
            "goal": "Ask the user what he/she wants, and help them create it.",
            "session_id": "shuxuan-test-3"
        },
        {
            "created_at": "2025-02-24T22:12:07.973776+00:00",
            "goal": "Create a promo video for me",
            "session_id": "79caaf6d-6607-44ca-9829-f7d8cba6e44c"
        },
        {
            "created_at": "2025-02-24T22:01:21.519001+00:00",
            "goal": "Create an image for me",
            "session_id": "shan-1"
        }
    ],
    "pagination": {
        "current_page": 0,
        "total_pages": 1,
        "total_records": 4
    }
}

Last updated

Was this helpful?