linear-motion 0.2.0

A CLI tool for syncing between Linear and Motion
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
# Motion API Documentation

Complete documentation for the Motion API, extracted from https://docs.usemotion.com/

## Table of Contents

- [Getting Started]#getting-started
- [Cookbooks]#cookbooks
  - [Getting Started]#getting-started-1
  - [Description]#description
  - [Frequency]#frequency
  - [Rate Limits]#rate-limits
- [API Reference]#api-reference
  - [Comments]#comments
  - [Custom Fields]#custom-fields
  - [Projects]#projects
  - [Recurring Tasks]#recurring-tasks
  - [Schedules]#schedules
  - [Statuses]#statuses
  - [Tasks]#tasks
  - [Users]#users
  - [Workspaces]#workspaces

---

## Getting Started

### Create API Key

1. Log into Motion and under the Settings tab, create an API key.
   - **Note**: Be sure to copy the key, as it will only be shown once for security reasons.

### Set Authorization Headers

Pass in your API key as a `X-API-Key` header.

### Test the API

Try sending a GET request to `https://api.usemotion.com/v1/workspaces` with your API key as a header!

---

## Cookbooks

### Getting Started

#### Create API Key

1. Log into Motion and under the Settings tab, create an API key.
   - **Note**: Be sure to copy the key, as it will only be shown once for security reasons.

#### Set Authorization Headers

Pass in your API key as a `X-API-Key` header.

#### Test the API

Try sending a GET request to `https://api.usemotion.com/v1/workspaces` with your API key as a header!

### Description

#### Github Flavored Markdown

Motion uses [Github Flavored Markdown](https://github.github.com/gfm/) for description fields. API users can test their code using a markdown to HTML converter like [showdown](https://www.npmjs.com/package/showdown).

#### Limitations

Currently, Motion uses Prosemirror for their text editor, which has some compatibility issues with Github Flavored Markdown. Specifically:

- Checkboxes created with `- [ ] My checkbox` or `- [x] My checkbox` do not work

#### Workaround

Until the Prosemirror limitation is resolved, use the following raw HTML string to create a checkbox:

```html
<ul data-type="taskList">
  <li data-checked="false">
    <label contenteditable="false">
      <input type="checkbox">
      <span></span>
    </label>
    <div>
      <p>YOUR SUBTASK ITEM HERE</p>
    </div>
  </li>
</ul>
```

### Frequency

#### Days

Defining days should always be used along with a specific frequency type. When picking specific week days, use an array with these values:

- `MO` - Monday
- `TU` - Tuesday
- `WE` - Wednesday
- `TH` - Thursday
- `FR` - Friday
- `SA` - Saturday
- `SU` - Sunday

Example: `[MO, FR, SU]` means Monday, Friday, and Sunday.

#### Defining a Daily Frequency

Options include:
- `daily_every_day`
- `daily_every_week_day`
- `daily_specific_days_[DAYS_ARRAY]`

Example: `daily_specific_days_[MO, TU, FR]` means every Monday, Tuesday, and Friday.

#### Defining a Weekly Frequency

Options include:
- `weekly_any_day`
- `weekly_any_week_day`
- `weekly_specific_days_[DAYS_ARRAY]`

Example: `weekly_specific_days_[MO, TU, FR]` means once a week on Monday, Tuesday, or Friday.

#### Defining a Bi-Weekly Frequency

Options include:
- `biweekly_first_week_specific_days_[DAYS_ARRAY]`
- `biweekly_first_week_any_day`
- `biweekly_first_week_any_week_day`
- `biweekly_second_week_any_day`
- `biweekly_second_week_any_week_day`

Example: `biweekly_first_week_specific_days_[MO, TU, FR]` means biweekly on first week's Monday, Tuesday, or Friday.

#### Defining a Monthly Frequency

##### Specific Week Day Options
- `monthly_first_DAY`
- `monthly_second_DAY`
- `monthly_third_DAY`
- `monthly_fourth_DAY`
- `monthly_last_DAY`

Example: `monthly_first_MO` means first Monday of the month.

### Rate Limits

The base tier for individuals is 12 requests per minute.

Teams can request up to 120 requests per minute.

For even higher rate limits, please sign up for our enterprise tier.

---

## API Reference

### Comments

#### Get Comments

**Endpoint:** `GET /v1/comments`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Query Parameters:**
- **cursor** (string) - Use for pagination through results
- **taskId** (string, required) - Task for which comments should be returned

**Response (200 - application/json):**

Meta Object:
- **nextCursor** (string) - Cursor for next page of results
- **pageSize** (number) - Number of results in response

Comments Array:
- **id** (string)
- **taskId** (string)
- **content** (string, HTML)
- **createdAt** (datetime)
- **creator** (object)
  - **id** (string)
  - **name** (string)
  - **email** (string)

#### Create Comment

**Endpoint:** `POST /v1/comments`

**Authorization:**
- **X-API-Key** (string, required) - Header containing API key

**Request Body (application/json):**
- **taskId** (string, required) - Task to comment on
- **content** (string) - Comment in Github Flavored Markdown

**Response (200 OK):**
```json
{
  "id": "string",
  "taskId": "string", 
  "content": "string",
  "createdAt": "datetime",
  "creator": {
    "id": "string",
    "name": "string",
    "email": "string"
  }
}
```

### Custom Fields

#### Add Custom Field to Project

**Endpoint:** `POST /beta/custom-field-values/project/{projectId}`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Path Parameters:**
- **projectId** (string, required) - Project for adding custom field value

**Request Body (application/json):**
- **customFieldInstanceId** (string, required) - Custom field being set
- **value** (object, required):
  - **type** (string, required) - Custom field type
  - **value** (string or number) - Actual value being set

**Supported Types:** "text", "url", "date", "person", "multiPerson", "phone", "select", "multiSelect", "number", "email", "checkbox", "relatedTo"

#### Add Custom Field to Task

**Endpoint:** `POST /beta/custom-field-values/task/{taskId}`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Path Parameters:**
- **taskId** (string, required) - Task for which a new custom field value will be added

**Request Body (application/json):**
- **customFieldInstanceId** (string, required) - Custom field on the workspace being set
- **value** (object, required):
  - **type** (string, required) - Custom field type
  - **value** (string or number) - Actual value being set

#### Delete Custom Field from Project

**Endpoint:** `DELETE /beta/custom-field-values/project/{projectId}/custom-fields/{valueId}`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Path Parameters:**
- **projectId** (string, required) - Project from which custom field value will be deleted
- **valueId** (string, required) - ID of custom field value to be deleted

#### Delete Custom Field from Task

**Endpoint:** `DELETE /beta/custom-field-values/task/{taskId}/custom-fields/{valueId}`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Path Parameters:**
- **taskId** (string, required) - The task from which a custom field value will be deleted
- **valueId** (string, required) - The ID of the custom field value that will be deleted

#### Delete Custom Field

**Endpoint:** `DELETE /beta/workspaces/{workspaceId}/custom-fields/{id}`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Path Parameters:**
- **workspaceId** (string, required) - Workspace for deleting custom field
- **id** (string, required) - ID of custom field to delete

#### Get Custom Fields

**Endpoint:** `GET /beta/workspaces/{workspaceId}/custom-fields`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Path Parameters:**
- **workspaceId** (string, required) - Workspace to retrieve custom fields from

**Response (200 - application/json):**
Array with the following properties:
- **id** (string, required) - Custom field ID
- **field** (string, required) - Custom field type

**Supported Field Types:** text, url, date, person, multiPerson, phone, select, multiSelect, number, email, checkbox, relatedTo

#### Create Custom Field

**Endpoint:** `POST /beta/workspaces/{workspaceId}/custom-fields`

**Authorization:**
- **X-API-Key** (string, required) - API key in header

**Path Parameters:**
- **workspaceId** (string, required) - Workspace for creating custom field

**Request Body (application/json):**

Required Fields:
- **type** (string) - Custom field type
- **name** (string) - Custom field name

Optional Fields:
- **metadata** (object) - Advanced configuration
  - For number fields: `format` (plain/formatted/percent)
  - For checkbox: `toggle` (boolean)
  - For select fields: `options` array with `id`, `value`, `color`

**Valid Types:** "text", "url", "date", "person", "multiPerson", "phone", "select", "multiSelect", "number", "email", "checkbox", "relatedTo"

### Projects

#### Get Project

**Endpoint:** `GET /v1/projects/{id}`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Path Parameters:**
- **id** (string, required) - Project ID to return

**Response (200 - application/json):**
- `id` - Project ID (string)
- `name` - Project name (string)
- `description` - HTML description contents (string)
- `workspaceId` - Workspace ID (string)
- `status` - Project status object
- `createdTime` - Creation timestamp
- `updatedTime` - Last update timestamp
- `customFieldValues` - Custom field values record

#### List Projects

**Endpoint:** `GET /v1/projects`

**Authorization:**
- **X-API-Key** (string, required) - API key in header

**Query Parameters:**
- `cursor` (string) - For pagination
- `workspaceId` (string) - Workspace to retrieve projects from

**Response (200 OK):**

Meta Object:
- `nextCursor` (string) - Cursor for next page
- `pageSize` (number) - Number of results

Projects Array:
- `id` (string)
- `name` (string)
- `description` (string, HTML)
- `workspaceId` (string)
- `status` (object)
- `createdTime` (datetime)
- `updatedTime` (datetime)
- `customFieldValues` (record)

#### Create Project

**Endpoint:** `POST /v1/projects`

**Authorization:**
- **X-API-Key** (string, required) - API key in header

**Request Body (application/json):**

Required Parameters:
- `name` (string) - Project name
- `workspaceId` (string) - Workspace ID

Optional Parameters:
- `dueDate` (ISO 8601 date)
- `description` (string, HTML accepted)
- `labels` (array of strings)
- `priority` (string, default: MEDIUM) - Options: ASAP, HIGH, MEDIUM, LOW
- `projectDefinitionId` (string)
- `stages` (array of stage objects)

### Recurring Tasks

#### Delete Recurring Task

**Endpoint:** `DELETE /v1/recurring-tasks/{id}`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Path Parameters:**
- **id** (integer) - ID of the recurring task to delete

#### List Recurring Tasks

**Endpoint:** `GET /v1/recurring-tasks`

**Authorization:**
- **X-API-Key** (string, required) - API key in header

**Query Parameters:**
- `cursor` (string) - Pagination cursor
- `workspaceId` (string, required) - Workspace ID for recurring tasks

**Response (200 OK):**

Meta Object:
- `nextCursor` (string) - Cursor for next page
- `pageSize` (number) - Number of results

Tasks Array:
- `id` (string)
- `name` (string)
- `creator` (object)
- `assignee` (object)
- `project` (optional object)
- `status` (object)
- `priority` (string: ASAP, HIGH, MEDIUM, or LOW)
- `labels` (array)
- `workspace` (object)

#### Create Recurring Task

**Endpoint:** `POST /v1/recurring-tasks`

**Authorization:**
- `X-API-Key` (string, required) - API key in header

**Request Body (application/json):**

Required fields:
- `frequency` - Task scheduling frequency
- `name` - Recurring task name
- `workspaceId` - Workspace for task creation
- `assigneeId` - User assigned to task

Optional fields:
- `dueDate` (datetime) - ISO 8601 Due date on the task. REQUIRED for scheduled tasks.
- `duration` (string | number) - "NONE", "REMINDER", or integer > 0 (minutes)
- `status` (string) - Defaults to workspace default status
- `autoScheduled` (object | null) - Set values to enable auto scheduling, null to disable
  - `startDate` (datetime) - ISO 8601 date trimmed to start of day
  - `deadlineType` (string) - "HARD", "SOFT", or "NONE" (default: SOFT)
  - `schedule` (string) - Schedule name (default: "Work Hours")
- `description` (string) - Github Flavored Markdown
- `priority` (string) - "ASAP", "HIGH", "MEDIUM", "LOW"
- `labels` (array<string>) - Label names
- `assigneeId` (string) - User ID to assign task to
- `projectId` (string) - Project ID to associate with

### Schedules

#### Get Schedules

**Endpoint:** `GET /v1/schedules`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Response (200 - application/json):**

Schedule Properties:
- `name` (string) - Name of the schedule
- `isDefaultTimezone` (boolean) - Whether it's the default timezone
- `timezone` (string) - Timezone of the schedule
- `schedule` (object) - Schedule details

Daily Schedule Structure:
Each day (monday-sunday) contains an array of objects with:
- `start` (string) - Schedule start time (HH:MM)
- `end` (string) - Schedule end time (HH:MM)

### Statuses

#### Get Statuses

**Endpoint:** `GET /v1/statuses`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Query Parameters:**
- **workspaceId** (string) - Get statuses for a particular workspace

**Response (200 - application/json - array):**

Status Object:
- **name** (string) - The name of the status
- **isDefaultStatus** (boolean) - Whether this status is a default status for the workspace
- **isResolvedStatus** (boolean) - Whether this is a resolved (terminated) status for the workspace

### Tasks

#### Delete Task

**Endpoint:** `DELETE /v1/tasks/{id}`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Path Parameters:**
- **id** (integer) - ID of the task to delete

#### Get Task

**Endpoint:** `GET /v1/tasks/{id}`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Path Parameters:**
- `id` (string) - ID of the task to fetch

**Response (200 OK, application/json):**

Key Response Fields:
- `id` - Task ID (string, required)
- `name` - Task name (string, required)
- `description` - HTML description contents (string, required)
- `duration` - Task duration (string/number)
- `dueDate` - Task due datetime
- `deadlineType` - "HARD", "SOFT" (default), or "NONE"
- `completed` - Whether task is completed (boolean)
- `creator` - Object with creator details
- `project` - Object with project information
- `workspace` - Object with workspace data
- `status` - Task status object
- `priority` - "ASAP", "HIGH", "MEDIUM", or "LOW"
- `assignees` - Array of assigned users
- `customFieldValues` - Custom field data record

#### List Tasks

**Endpoint:** `GET /v1/tasks`

**Authorization:**
- `X-API-Key` (string, required) - API key header

**Query Parameters:**
- `assigneeId` (string) - Limit tasks to specific assignee
- `cursor` (string) - Page through results
- `includeAllStatuses` (boolean) - Include all task statuses
- `label` (string) - Filter by task label
- `name` (string) - Search tasks by name (case-insensitive)
- `projectId` (string) - Limit tasks to specific project
- `status` (array<string>) - Filter by task statuses
- `workspaceId` (string) - Specify workspace for tasks

**Response (200 OK):**

Meta Object:
- `nextCursor` (string) - Cursor for next page of results
- `pageSize` (number) - Number of results in response

Tasks Array:
- `id` (string)
- `name` (string)
- `description` (string)
- `dueDate` (datetime)
- `completed` (boolean)
- `creator` (object)
- `project` (object)
- `workspace` (object)
- `status` (object)
- `priority` (string)
- `assignees` (array)
- `customFieldValues` (record)

#### Move Task

**Endpoint:** `PATCH /v1/tasks/{id}/move`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Path Parameters:**
- **id** (string, required) - Task ID

**Request Body (application/json):**
- **workspaceId** (string, required) - Destination workspace ID
- **assigneeId** (string, optional) - User ID to assign task

#### Update Task

**Endpoint:** `PATCH /v1/tasks/{id}`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Path Parameters:**
- `id` (string) - Task ID to update

**Request Body (application/json):**

Optional Fields:
- `dueDate` (datetime) - ISO 8601 due date
- `duration` (string/number) - "NONE", "REMINDER", or minutes
- `status` (string) - Workspace default status
- `autoScheduled` (object/null)
- `name` (string, required) - Task title
- `projectId` (string) - Project association
- `workspaceId` (string, required)
- `description` (string) - GitHub Flavored Markdown
- `priority` (string) - ASAP, HIGH, MEDIUM, LOW
- `labels` (array<string>)
- `assigneeId` (string)

#### Create Task

**Endpoint:** `POST /v1/tasks`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Request Body (application/json):**

Required Parameters:
- `name` (string) - Task title
- `workspaceId` (string) - Workspace ID

Optional Parameters:
- `dueDate` (datetime) - ISO 8601 Due date. REQUIRED for scheduled tasks
- `duration` (string | number) - "NONE", "REMINDER", or integer > 0 (minutes)
- `status` (string) - Workspace default status
- `autoScheduled` (object | null) - Auto-scheduling configuration
  - `startDate` (datetime) - ISO 8601 date trimmed to start of day
  - `deadlineType` (string) - "HARD", "SOFT", or "NONE" (default: SOFT)  
  - `schedule` (string) - Schedule name (default: "Work Hours")
- `projectId` (string) - Project association
- `description` (string) - GitHub Flavored Markdown
- `priority` (string) - ASAP, HIGH, MEDIUM, LOW
- `labels` (array<string>) - Label names
- `assigneeId` (string) - User ID to assign task to

#### Unassign Task

**Endpoint:** `DELETE /v1/tasks/{id}/assignee`

**Authorization:**
- **X-API-Key** (string, required) - Header with the API key

**Path Parameters:**
- **id** (string, required) - The ID of the task

### Users

#### List Users

**Endpoint:** `GET /v1/users`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Query Parameters:**
- `cursor` (string) - Pagination cursor
- `teamId` (string) - Team ID to list members
- `workspaceId` (string) - Workspace ID to list members

**Response (200 OK):**

Meta Object:
- `nextCursor` (string) - Cursor for next page
- `pageSize` (number) - Number of results

Users Array:
- `id` (string, required) - User ID
- `name` (string) - User name
- `email` (string, required) - User email

#### Get My User

**Endpoint:** `GET /v1/users/me`

**Authorization:**
- **X-API-Key** (string, required) - Header with the API key

**Response (200 - application/json):**
- `id` (string, required) - User ID
- `name` (string) - User name
- `email` (string, required) - User email

### Workspaces

#### List Workspaces

**Endpoint:** `GET /v1/workspaces`

**Authorization:**
- **X-API-Key** (string, required) - Header with API key

**Query Parameters:**
- `cursor` (string) - Page through results
- `ids` (array<string>) - Expand details of specific workspaces

**Response (200 - application/json):**

Meta:
- `nextCursor` (string) - Cursor for next page of results
- `pageSize` (number) - Number of results in response

Workspaces (array of objects):
- `id` (string) - Workspace ID
- `name` (string) - Workspace name
- `teamId` (string) - Team ID
- `type` (string) - Workspace type (team or individual)
- `labels` (array of objects)
- `statuses` (array of objects)

---

## Base API URL

All API endpoints are accessed via: `https://api.usemotion.com`

## Authentication

All API requests require authentication via the `X-API-Key` header:

```
X-API-Key: your_api_key_here
```

## Rate Limits

- **Individual tier**: 12 requests per minute
- **Teams**: 120 requests per minute
- **Enterprise**: Higher limits available

## Common Response Patterns

### Pagination

Many endpoints support pagination using cursor-based pagination:

```json
{
  "meta": {
    "nextCursor": "string",
    "pageSize": 50
  },
  "data": []
}
```

### Error Responses

API errors follow standard HTTP status codes with JSON error messages.

---

*Documentation generated from Motion API docs at https://docs.usemotion.com/*