Sample body for Teamwork.com POST requests
The beginning of an awesome article...
Update Project samples: https://apidocs.teamwork.com/docs/teamwork/v1/projects/put-projects-id-json
Update Project owner:
{
"project": {
"projectOwnerId": "238860"
}
}
Add project to another company
{
"project": {
"companyId": "114489"
}
}
Archive Project:
{
"project": {
"status": "inactive"
}
}
Make Project Active
{
"project": {
"status": "active"
}
}
Enable Project Channel
{
"project": {
"chatChannelEnabled": 1
}
}
Update an existing custom field V3: https://apidocs.teamwork.com/docs/teamwork/v3/custom-fields/put-projects-api-v3-customfields-custom-field-id-json
Update an existing custom field
{
"customfield":
{
"customFieldId": 2300,
"name": "Update field name",
"entity":"project"
}
}
User Preferences
{
"person": {
//Preferences
"notifyOnTaskComplete": true,
"notify-on-added-as-follower": true,
"soundAlertsEnabled": true,
"notify-on-status-update": true,
"textFormat": "TEXT",
"useShorthandDurations": true,
"userReceiveNotifyWarnings": true,
"userReceiveMyNotificationsOnly": true
}
}
User daily report preferences
{
"person": {
//Receive daily 'Project Report' email?
"receiveDailyReports": true,
"dailyReportSort": "DATE",
"receiveDailyReportsAtWeekend": true,
"receiveDailyReportsIfEmpty": true,
"dailyReportEventsType": "ALL",//set to MINE to include only events the user is attending
"receiveDailyReportsAtTime": "7",
"dailyReportDaysFilter": 14,
"allowEmailNotifications": true
}
}
User permissions
{
"person": {
//Permissions Tab
"administrator": true,
"canAddProjects": true,
"canManagePeople": true,
"autoGiveProjectAccess": true,
"canAccessCalendar": true,
"canAccessTemplates": true,
"canAccessPortfolio": true,
"canManageCustomFields": true,
"canAddCustomReports": true,//Can user create Custom Reports?
"canManagePortfolio": true,
"canManageProjectTemplates": true,
"canViewProjectTemplates": true,
"canViewSchedule": true,//Can this user access resource scheduling?
"canManageSchedule": true,//Can this user manage resource scheduling?
"canManageTimeReminders": true,
}
}
Full body sample
{
"person": {
//Essentials Tab
"email-address": "sample@example.com",
"first-name": "First Name",
"last-name": "Last Name",
"company-id": 110969,
"user-type": "account",
"isClientUser": false,
"workingHours": {
"entries": [
{
"weekday": "sunday",
"taskHours": 0
},
{
"weekday": "monday",
"taskHours": 8
},
{
"weekday": "tuesday",
"taskHours": 8
},
{
"weekday": "wednesday",
"taskHours": 8
},
{
"weekday": "thursday",
"taskHours": 8
},
{
"weekday": "friday",
"taskHours": 8
},
{
"weekday": "saturday",
"taskHours": 0
}
]
},
"sendInvite": false,
//Details tab
"title": "Support Lead",
"phone-number-office": "",
"phone-number-office-ext": "",
"phone-number-mobile-countrycode": "IE",
"phone-number-mobile-prefix": "21",
"phone-number-mobile": "0122362806",
"phone-number-home": "+1 844 819 3456",
"phone-number-fax": "0314963229",
"email-alt-1": "",
"email-alt-2": "",
"email-alt-3": "",
//Address tab
"address": {
"line1": "Address Line 1",
"line2": "Address Line 2",
"city": "City",
"state": "State",
"zipcode": "Zipcode",
"countrycode": "US"
},
//Profile tab
"profile": "",
//Notes tab
"privateNotes": "",
//Social tab
"userTwitterName": "",
"userLinkedin": "",
"userFacebook": "",
"userWebsite": "",
"im-service": "Twitter",
"im-handle": "",
//Localization Tab
"language": "EN",
"dateFormatId": 1,
"timeFormatId": 2,
"timezoneId": 144,
"calendarStartsOnSunday": "yes",
"lengthOfDay": 15,
"changeForEveryone": false,
//Permissions Tab
"administrator": true,
"canAddProjects": true,
"canManagePeople": true,
"autoGiveProjectAccess": true,
"canAccessCalendar": true,
"canAccessTemplates": true,
"canAccessPortfolio": true,
"canManageCustomFields": true,
"canAddCustomReports": true,
"canManagePortfolio": true,
"canManageProjectTemplates": true,
"canViewProjectTemplates": true,
"canViewSchedule": true,
"canManageSchedule": true,
"canManageTimeReminders": true,
//Preferences tab
"notifyOnTaskComplete": true,
"notify-on-added-as-follower": true,
"notify-on-status-update": true,
"userReceiveNotifyWarnings": true,
"userReceiveMyNotificationsOnly": true,
//Preferences tab > Daily report email
"receiveDailyReports": true,
"receiveDailyReportsAtWeekend": true,
"receiveDailyReportsIfEmpty": true,
"soundAlertsEnabled": true,
"dailyReportSort": "DATE",
"receiveDailyReportsAtTime": "5",
"dailyReportEventsType": "MINE",
"dailyReportDaysFilter": 2,
"avatarPendingFileRef": "",
"removeAvatar": false,
"allowEmailNotifications": true,
//Preferences tab > Editing
"textFormat": "TEXT",
"useShorthandDurations": true
}
}
Reminders
Create a reminder: https://apidocs.teamwork.com/docs/teamwork/v1/task-reminders/post-tasks-id-reminders-json
Create a reminder:
{
"reminder": {
"threshold": 80,
"time": "18:00:00",
"frequencyRRule": "FREQ=DAILY",
"isActive": true
}
}
Update a task reminder: https://apidocs.teamwork.com/docs/teamwork/v1/task-reminders/put-taskreminders-id-json
set to a single user
Reminder date on task due date
Update a task reminder
{
"reminder": {
"note": "Hey, don't forget about me!",
"type": "EMAIL",//SMS,PUSH
"date-time-utc": "2023-09-06T10:07:45Z",
"user-id": [
238860
],
"isRelative": false,//Set to true to follow task due date
"id": "593057",
"peopleAssigned": false,//true when reminder is set to all task assignees
"assignToMultiple": false,
"assigneeDetails": [
{
"id": 238860,
"label": "Marc Cashman",
"firstName": "Marc",
"lastName": "Cashman"
}
],
"usingOffSetDueDate": false
}
}
Alter "user-id" and "assigneeDetails" arrays to include multiple users
"user-id": [
238860,
369453
],
"assigneeDetails": [
{
"id": 238860,
"label": "Marc Cashman",
"firstName": "Marc",
"lastName": "Cashman"
},
{
"id": 369453,
"label": "Adrian Kerr",
"firstName": "Adrian",
"lastName": "Kerr"
}
],
Update a task reminder
set to all task assignees
Reminder date 3 days before task due date
Update task reminder
{
"reminder": {
"note": "Gentle reminder to review this task",
"type": "EMAIL",//SMS,PUSH
"date-time-utc": "2023-09-12T20:00:00Z",//Date must be set based on relative days and task due date
"user-id": [
"238860",
"369453"
],
"isRelative": true,//Set to true to follow task due date
"relative-number-days": "3",//Positive number refers to days before task due date ie: 3 = 3 days before. Negative number refers to days after task due date ie: -2 = 2 days after task due date. O = On due date
"peopleAssigned": true,//true when reminder is set to all task assignees
"assignToMultiple": false,
"assigneeDetails": [
{
"id": "-3",
"label": "All people assigned to the task",
"firstName": "All people assigned to the task",
"lastName": ""
}
],//Auto assigns reminder to all task assignees
"usingOffSetDueDate": false
}
}
Add a budget expense to a project - internal
Add a budget expense to a project
{
"budgetExpense": {
"cost": 1000,
"description": "Petrol"
}
}
Update My Board > Board: /boards/:boardId.json
Update My Board > Board
{
"board": {
"name": "App Review",
"description": "Description here please",
"color": "",
"projectIds": "732893,739377", //replace ids with your project Id's
"columns": [
"In progress",
"Completed",
"Waiting",
"Global review"
], //Your columns will be different to my test site
"userIds": "{userId}" //User Ids for shared access
}
}
Update many task custom field values at once The custom fields must have data already so that you can capture the unique id for the custom field value. https://apidocs.teamwork.com/docs/teamwork/v3/custom-fields/post-projects-api-v3-tasks-task-id-customfields-bulk-update-json
Update many task custom field values at once
{
"customfieldTasks": [
{
"id": 78570,
"customfieldId": 2794,
"value": "Value in bulk 2"
},
{
"id": 78569,
"customfieldId": 2558,
"value": "Submitted"
}
]
}