get__conversation

⚠️ TEST ENVIRONMENT ONLY

This API endpoint is currently available only in the TEST environment. It is not yet available in production.

GET /conversation

List Conversations

Retrieve a list of AI conversations with optional filtering and pagination. This endpoint returns conversations based on user permissions and access controls.

Key Features:

  • Filter by workspace, repository, user, or date range

  • Pagination support with configurable page size

  • Returns conversation metadata including token usage

  • Respects workspace and organization access controls

  • Includes creator information for each conversation

Query Filtering:

  • take - Number of records to return (default: 50, max: 100)

  • skip - Number of records to skip (default: 0)

  • from - Start date for date range filter (ISO 8601 format)

  • to - End date for date range filter (ISO 8601 format)

  • userId - Filter by user who created the conversation

  • workspaceId - Filter by workspace

  • repoId - Filter by repository

Access Control:

  • Organization administrators see all conversations in their organization

  • Workspace administrators see all conversations in their managed workspaces

  • Regular users see only their own conversations

  • Users can filter conversations from workspaces they have access to

Important Notes:

  • Results are sorted by creation date (newest first)

  • Maximum take value is 100 to prevent excessive data transfer

  • Deleted conversations are excluded from results

  • Token counts are returned as strings to support large numbers

TypeScript Client Library

public getConversations = async (query: GetConversationsRequest): Promise<GetConversationsResponse> => {
  const queryParams = new URLSearchParams();
  if (query.take !== undefined) {
    queryParams.append('take', query.take.toString());
  }
  if (query.skip !== undefined) {
    queryParams.append('skip', query.skip.toString());
  }
  if (query.from) {
    queryParams.append('from', query.from);
  }
  if (query.to) {
    queryParams.append('to', query.to);
  }
  if (query.userId) {
    queryParams.append('userId', query.userId);
  }
  if (query.workspaceId) {
    queryParams.append('workspaceId', query.workspaceId);
  }
  if (query.repoId) {
    queryParams.append('repoId', query.repoId);
  }
  return this.makeRequest<GetConversationsResponse>(
    `conversation?${queryParams.toString()}`,
    'GET',
    null
  );
};

Code Samples

# You can also use wget
curl -X GET "https://backend.flashback.tech/conversation?workspaceId=workspace-123&take=50&skip=0" \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

Parameters

Name
In
Type
Required
Description

take

query

integer

false

Number of records to return (default: 50, max: 100)

skip

query

integer

false

Number of records to skip (default: 0)

from

query

string

false

Start date for date range filter (ISO 8601)

to

query

string

false

End date for date range filter (ISO 8601)

userId

query

string

false

Filter by user who created the conversation

workspaceId

query

string

false

Filter by workspace ID

repoId

query

string

false

Filter by repository ID

Example responses

200 Response

{
  "success": true,
  "conversations": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "orgId": "org-123",
      "createdBy": "user-456",
      "createdAt": "2024-01-15T10:30:00.000Z",
      "lastUpdatedAt": "2024-01-15T11:45:00.000Z",
      "workspaceId": "workspace-789",
      "repoId": "repo-101",
      "tokensIn": "1523",
      "tokensOut": "2847",
      "creator": {
        "id": "user-456",
        "name": "John",
        "lastName": "Doe",
        "email": "[email protected]"
      }
    }
  ],
  "total": 1
}

Responses

Status
Meaning
Description
Schema

200

Successfully retrieved conversations

Inline

400

Invalid request parameters

Inline

500

Failed to retrieve conversations

Inline

Response Schema

Status Code 200

Name
Type
Required
Restrictions
Description

» success

boolean

false

none

Operation success status

» conversations

[object]

false

none

Array of conversation objects

»» id

string

false

none

Unique identifier for the conversation

»» orgId

string

false

none

Organization ID

»» createdBy

string

false

none

User ID who created the conversation

»» createdAt

string

false

none

ISO 8601 timestamp

»» lastUpdatedAt

string

false

none

ISO 8601 timestamp

»» workspaceId

string

false

none

Workspace ID

»» repoId

string

false

none

Repository ID

»» tokensIn

string

false

none

Total input tokens consumed (as string)

»» tokensOut

string

false

none

Total output tokens generated (as string)

»» creator

object

false

none

Creator user information

»»» id

string

false

none

User ID

»»» name

string

false

none

User first name

»»» lastName

string

false

none

User last name

»»» email

string

false

none

User email

» total

integer

false

none

Total number of conversations matching the query

Status Code 400

Name
Type
Required
Restrictions
Description

» success

boolean

false

none

none

» conversations

array

false

none

none

» total

integer

false

none

none

» message

string

false

none

Error message

Status Code 500

Name
Type
Required
Restrictions
Description

» success

boolean

false

none

none

» conversations

array

false

none

none

» total

integer

false

none

none

» message

string

false

none

Error message

To perform this operation, you must be authenticated by means of one of the following methods: BearerAuth

Last updated

Was this helpful?