curl -X GET https://api.myweave.ai/functions/v1/users/user_abc123/threads \
-H "X-API-Key: your-api-key-here"
curl -X GET "https://api.myweave.ai/functions/v1/users/user_abc123/threads?coachId=coach_xyz789" \
-H "X-API-Key: your-api-key-here"
const userId = 'user_abc123';
const response = await fetch(
`https://api.myweave.ai/functions/v1/users/${userId}/threads`,
{
method: 'GET',
headers: {
'X-API-Key': 'your-api-key-here'
}
}
);
const { data, count } = await response.json();
console.log(`Found ${count} threads`);
data.forEach(thread => {
console.log(`- ${thread.title} with ${thread.coach_profiles.name}`);
});
const userId = 'user_abc123';
const coachId = 'coach_xyz789';
const response = await fetch(
`https://api.myweave.ai/functions/v1/users/${userId}/threads?coachId=${coachId}`,
{
method: 'GET',
headers: {
'X-API-Key': 'your-api-key-here'
}
}
);
const { data } = await response.json();
import requests
user_id = 'user_abc123'
url = f"https://api.myweave.ai/functions/v1/users/{user_id}/threads"
headers = {"X-API-Key": "your-api-key-here"}
response = requests.get(url, headers=headers)
result = response.json()
print(f"Found {result['count']} threads")
for thread in result['data']:
print(f"- {thread['title']} with {thread['coach_profiles']['name']}")
import requests
user_id = 'user_abc123'
coach_id = 'coach_xyz789'
url = f"https://api.myweave.ai/functions/v1/users/{user_id}/threads"
headers = {"X-API-Key": "your-api-key-here"}
params = {"coachId": coach_id}
response = requests.get(url, headers=headers, params=params)
threads = response.json()['data']
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Leadership Development Session",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-16T14:20:00Z",
"coach_id": "coach_xyz789",
"user_id": "user_abc123",
"coach_profiles": {
"name": "Dr. Sarah Johnson",
"title": "Executive Leadership Coach"
}
},
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"title": "Career Planning Discussion",
"created_at": "2024-01-10T09:15:00Z",
"updated_at": "2024-01-12T16:45:00Z",
"coach_id": "coach_abc456",
"user_id": "user_abc123",
"coach_profiles": {
"name": "Michael Chen",
"title": "Career Development Coach"
}
}
],
"count": 2
}
{
"error": "userId is required in path"
}
{
"error": "Failed to fetch threads",
"details": "Database connection error"
}
Chat & Conversations
Get User Threads
Retrieve all conversation threads for a specific user
GET
/
functions
/
v1
/
users
/
:userId
/
threads
curl -X GET https://api.myweave.ai/functions/v1/users/user_abc123/threads \
-H "X-API-Key: your-api-key-here"
curl -X GET "https://api.myweave.ai/functions/v1/users/user_abc123/threads?coachId=coach_xyz789" \
-H "X-API-Key: your-api-key-here"
const userId = 'user_abc123';
const response = await fetch(
`https://api.myweave.ai/functions/v1/users/${userId}/threads`,
{
method: 'GET',
headers: {
'X-API-Key': 'your-api-key-here'
}
}
);
const { data, count } = await response.json();
console.log(`Found ${count} threads`);
data.forEach(thread => {
console.log(`- ${thread.title} with ${thread.coach_profiles.name}`);
});
const userId = 'user_abc123';
const coachId = 'coach_xyz789';
const response = await fetch(
`https://api.myweave.ai/functions/v1/users/${userId}/threads?coachId=${coachId}`,
{
method: 'GET',
headers: {
'X-API-Key': 'your-api-key-here'
}
}
);
const { data } = await response.json();
import requests
user_id = 'user_abc123'
url = f"https://api.myweave.ai/functions/v1/users/{user_id}/threads"
headers = {"X-API-Key": "your-api-key-here"}
response = requests.get(url, headers=headers)
result = response.json()
print(f"Found {result['count']} threads")
for thread in result['data']:
print(f"- {thread['title']} with {thread['coach_profiles']['name']}")
import requests
user_id = 'user_abc123'
coach_id = 'coach_xyz789'
url = f"https://api.myweave.ai/functions/v1/users/{user_id}/threads"
headers = {"X-API-Key": "your-api-key-here"}
params = {"coachId": coach_id}
response = requests.get(url, headers=headers, params=params)
threads = response.json()['data']
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Leadership Development Session",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-16T14:20:00Z",
"coach_id": "coach_xyz789",
"user_id": "user_abc123",
"coach_profiles": {
"name": "Dr. Sarah Johnson",
"title": "Executive Leadership Coach"
}
},
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"title": "Career Planning Discussion",
"created_at": "2024-01-10T09:15:00Z",
"updated_at": "2024-01-12T16:45:00Z",
"coach_id": "coach_abc456",
"user_id": "user_abc123",
"coach_profiles": {
"name": "Michael Chen",
"title": "Career Development Coach"
}
}
],
"count": 2
}
{
"error": "userId is required in path"
}
{
"error": "Failed to fetch threads",
"details": "Database connection error"
}
Overview
Get all conversation threads for a user. Returns thread metadata including coach information, ordered by most recently updated.Path Parameters
string
required
User identifier
Query Parameters
string
Optional filter to get threads with a specific coach only
Response
array
Array of thread objects
Show thread object
Show thread object
number
Total number of threads returned
curl -X GET https://api.myweave.ai/functions/v1/users/user_abc123/threads \
-H "X-API-Key: your-api-key-here"
curl -X GET "https://api.myweave.ai/functions/v1/users/user_abc123/threads?coachId=coach_xyz789" \
-H "X-API-Key: your-api-key-here"
const userId = 'user_abc123';
const response = await fetch(
`https://api.myweave.ai/functions/v1/users/${userId}/threads`,
{
method: 'GET',
headers: {
'X-API-Key': 'your-api-key-here'
}
}
);
const { data, count } = await response.json();
console.log(`Found ${count} threads`);
data.forEach(thread => {
console.log(`- ${thread.title} with ${thread.coach_profiles.name}`);
});
const userId = 'user_abc123';
const coachId = 'coach_xyz789';
const response = await fetch(
`https://api.myweave.ai/functions/v1/users/${userId}/threads?coachId=${coachId}`,
{
method: 'GET',
headers: {
'X-API-Key': 'your-api-key-here'
}
}
);
const { data } = await response.json();
import requests
user_id = 'user_abc123'
url = f"https://api.myweave.ai/functions/v1/users/{user_id}/threads"
headers = {"X-API-Key": "your-api-key-here"}
response = requests.get(url, headers=headers)
result = response.json()
print(f"Found {result['count']} threads")
for thread in result['data']:
print(f"- {thread['title']} with {thread['coach_profiles']['name']}")
import requests
user_id = 'user_abc123'
coach_id = 'coach_xyz789'
url = f"https://api.myweave.ai/functions/v1/users/{user_id}/threads"
headers = {"X-API-Key": "your-api-key-here"}
params = {"coachId": coach_id}
response = requests.get(url, headers=headers, params=params)
threads = response.json()['data']
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Leadership Development Session",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-16T14:20:00Z",
"coach_id": "coach_xyz789",
"user_id": "user_abc123",
"coach_profiles": {
"name": "Dr. Sarah Johnson",
"title": "Executive Leadership Coach"
}
},
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"title": "Career Planning Discussion",
"created_at": "2024-01-10T09:15:00Z",
"updated_at": "2024-01-12T16:45:00Z",
"coach_id": "coach_abc456",
"user_id": "user_abc123",
"coach_profiles": {
"name": "Michael Chen",
"title": "Career Development Coach"
}
}
],
"count": 2
}
{
"error": "userId is required in path"
}
{
"error": "Failed to fetch threads",
"details": "Database connection error"
}
Use Cases
- User Dashboard: Display all conversations for a user
- Coach Filter: Show threads with a specific coach
- Conversation History: List all past consultations
- Thread Management: Get thread IDs for continuing conversations
Response Details
- Threads are ordered by
updated_atin descending order (most recent first) - Includes coach profile information via join
- Returns empty array if no threads found
- Coach filter is optional - omit to get all threads
Was this page helpful?
⌘I

