Skip to main content

Wrike Integration

Cync integrates with Wrike for project management and task tracking.

Overview

Wrike integration enables:

  • Task search and viewing
  • Task creation and updates
  • Comment management
  • Activity tracking for summaries

Setup

1. Get Access Token

  1. Log into Wrike
  2. Go to: https://www.wrike.com/frontend/apps/index.html#/api
  3. Create a permanent token
  4. Copy the token

2. Configure Environment

# .env.local
WRIKE_ACCESS_TOKEN=your-permanent-token
WRIKE_API_BASE_URL=https://www.wrike.com/api/v4

API Usage

Base URL

https://www.wrike.com/api/v4

Authentication

All requests include the token:

const headers = {
'Authorization': `Bearer ${WRIKE_ACCESS_TOKEN}`,
'Content-Type': 'application/json'
};

Common Endpoints

MethodEndpointDescription
GET/tasksList tasks
GET/tasks/{id}Get task details
POST/folders/{folderId}/tasksCreate task
PUT/tasks/{id}Update task
POST/tasks/{id}/commentsAdd comment

Wrike Client

// lib/wrike/client.ts
export class WrikeClient {
private baseUrl: string;
private token: string;

constructor(config: { accessToken: string }) {
this.baseUrl = process.env.WRIKE_API_BASE_URL;
this.token = config.accessToken;
}

async searchTasks(query: string) {
const response = await fetch(
`${this.baseUrl}/tasks?title=${encodeURIComponent(query)}`,
{ headers: this.getHeaders() }
);
return response.json();
}

async createTask(folderId: string, data: TaskInput) {
const response = await fetch(
`${this.baseUrl}/folders/${folderId}/tasks`,
{
method: 'POST',
headers: this.getHeaders(),
body: JSON.stringify(data)
}
);
return response.json();
}

async addComment(taskId: string, text: string) {
const response = await fetch(
`${this.baseUrl}/tasks/${taskId}/comments`,
{
method: 'POST',
headers: this.getHeaders(),
body: JSON.stringify({ text })
}
);
return response.json();
}

private getHeaders() {
return {
'Authorization': `Bearer ${this.token}`,
'Content-Type': 'application/json'
};
}
}

MCP Tools

Wrike operations are exposed as MCP tools:

ToolDescription
search_wrike_tasksSearch tasks by keyword
create_wrike_taskCreate new task in folder
add_comment_to_wrike_taskAdd comment to task
edit_wrike_taskUpdate task details
get_wrike_task_detailsGet full task info

Usage in Cync Summaries

The Collector agent fetches Wrike activity:

// Fetch daily activity
const activity = {
created: await wrike.getTasksCreatedOn(date),
updated: await wrike.getTasksModifiedOn(date),
completed: await wrike.getCompletedTasksOn(date),
timeLogged: await wrike.getTimeLogsFor(date)
};

Rate Limits

Wrike API rate limits:

  • Free tier: 500 requests/hour per user
  • Enterprise: Higher limits

Handle rate limits:

if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After');
// Wait and retry
}

Task Object

FieldTypeDescription
idstringTask ID
titlestringTask title
statusstringActive/Completed/etc
importancestringHigh/Normal/Low
datesobjectStart/due dates
parentIdsstring[]Parent folder IDs
responsibleIdsstring[]Assignee IDs