BigW Consortium Gitlab

users.md 19.2 KB
Newer Older
1 2
# Users

3 4 5
## List users

Get a list of users.
6

7
This function takes pagination parameters `page` and `per_page` to restrict the list of users.
8

Ciro Santilli committed
9
### For normal users
10 11 12 13 14 15 16 17 18 19 20 21 22

```
GET /users
```

```json
[
  {
    "id": 1,
    "username": "john_smith",
    "name": "John Smith",
    "state": "active",
    "avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
23
    "web_url": "http://localhost:3000/john_smith"
24 25 26 27 28 29 30
  },
  {
    "id": 2,
    "username": "jack_smith",
    "name": "Jack Smith",
    "state": "blocked",
    "avatar_url": "http://gravatar.com/../e32131cd8.jpeg",
31
    "web_url": "http://localhost:3000/jack_smith"
32 33 34 35
  }
]
```

36 37 38 39 40 41 42 43 44 45 46 47
In addition, you can filter users based on states eg. `blocked`, `active`
This works only to filter users who are `blocked` or `active`.
It does not support `active=false` or `blocked=false`.

```
GET /users?active=true
```

```
GET /users?blocked=true
```

Ciro Santilli committed
48
### For admins
49

50 51 52 53 54 55 56 57
```
GET /users
```

```json
[
  {
    "id": 1,
58
    "username": "john_smith",
59 60
    "email": "john@example.com",
    "name": "John Smith",
61
    "state": "active",
62
    "avatar_url": "http://localhost:3000/uploads/user/avatar/1/index.jpg",
63
    "web_url": "http://localhost:3000/john_smith",
64
    "created_at": "2012-05-23T08:00:58Z",
65
    "is_admin": false,
66
    "bio": null,
67
    "location": null,
68 69 70
    "skype": "",
    "linkedin": "",
    "twitter": "",
Jerome Dalbert committed
71
    "website_url": "",
72
    "organization": "",
73 74
    "last_sign_in_at": "2012-06-01T11:41:01Z",
    "confirmed_at": "2012-05-23T09:05:22Z",
75
    "color_scheme_id": 2,
76 77 78 79 80 81 82
    "projects_limit": 100,
    "current_sign_in_at": "2012-06-02T06:36:55Z",
    "identities": [
      {"provider": "github", "extern_uid": "2435223452345"},
      {"provider": "bitbucket", "extern_uid": "john.smith"},
      {"provider": "google_oauth2", "extern_uid": "8776128412476123468721346"}
    ],
83
    "can_create_group": true,
84 85 86
    "can_create_project": true,
    "two_factor_enabled": true,
    "external": false
87 88 89
  },
  {
    "id": 2,
90
    "username": "jack_smith",
91 92
    "email": "jack@example.com",
    "name": "Jack Smith",
93
    "state": "blocked",
94
    "avatar_url": "http://localhost:3000/uploads/user/avatar/2/index.jpg",
95
    "web_url": "http://localhost:3000/jack_smith",
96
    "created_at": "2012-05-23T08:01:01Z",
97
    "is_admin": false,
98
    "bio": null,
99
    "location": null,
100 101 102
    "skype": "",
    "linkedin": "",
    "twitter": "",
Jerome Dalbert committed
103
    "website_url": "",
104
    "organization": "",
105 106
    "last_sign_in_at": null,
    "confirmed_at": "2012-05-30T16:53:06.148Z",
107
    "color_scheme_id": 3,
108
    "projects_limit": 100,
109
    "current_sign_in_at": "2014-03-19T17:54:13Z",
110 111 112 113 114
    "identities": [],
    "can_create_group": true,
    "can_create_project": true,
    "two_factor_enabled": true,
    "external": false
115 116 117 118
  }
]
```

Ciro Santilli committed
119
You can search for users by email or username with: `/users?search=John`
dosire committed
120

121 122 123 124 125 126 127 128 129 130 131
In addition, you can lookup users by username:

```
GET /users?username=:username
```

For example:

```
GET /users?username=jack_smith
```
132

133 134
You can search for users who are external with: `/users?external=true`

135 136 137 138
## Single user

Get a single user.

Ciro Santilli committed
139
### For user
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155

```
GET /users/:id
```

Parameters:

- `id` (required) - The ID of a user

```json
{
  "id": 1,
  "username": "john_smith",
  "name": "John Smith",
  "state": "active",
  "avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
156
  "web_url": "http://localhost:3000/john_smith",
157 158 159
  "created_at": "2012-05-23T08:00:58Z",
  "is_admin": false,
  "bio": null,
160
  "location": null,
161 162 163
  "skype": "",
  "linkedin": "",
  "twitter": "",
164 165
  "website_url": "",
  "organization": ""
166 167 168
}
```

Ciro Santilli committed
169
### For admin
170

171 172 173 174 175 176
```
GET /users/:id
```

Parameters:

177
- `id` (required) - The ID of a user
178 179 180 181

```json
{
  "id": 1,
182
  "username": "john_smith",
183 184
  "email": "john@example.com",
  "name": "John Smith",
185
  "state": "active",
186
  "avatar_url": "http://localhost:3000/uploads/user/avatar/1/index.jpg",
187
  "web_url": "http://localhost:3000/john_smith",
188
  "created_at": "2012-05-23T08:00:58Z",
189
  "is_admin": false,
190
  "bio": null,
191
  "location": null,
192 193 194
  "skype": "",
  "linkedin": "",
  "twitter": "",
Jerome Dalbert committed
195
  "website_url": "",
196
  "organization": "",
197 198
  "last_sign_in_at": "2012-06-01T11:41:01Z",
  "confirmed_at": "2012-05-23T09:05:22Z",
199
  "color_scheme_id": 2,
200 201 202 203 204 205 206
  "projects_limit": 100,
  "current_sign_in_at": "2012-06-02T06:36:55Z",
  "identities": [
    {"provider": "github", "extern_uid": "2435223452345"},
    {"provider": "bitbucket", "extern_uid": "john.smith"},
    {"provider": "google_oauth2", "extern_uid": "8776128412476123468721346"}
  ],
207
  "can_create_group": true,
208
  "can_create_project": true,
209 210
  "two_factor_enabled": true,
  "external": false
211 212 213
}
```

214
## User creation
215

216
Creates a new user. Note only administrators can create new users. Either `password` or `reset_password` should be specified (`reset_password` takes priority).
217 218 219 220 221 222 223

```
POST /users
```

Parameters:

224
- `email` (required)            - Email
225 226
- `password` (optional)         - Password
- `reset_password` (optional)   - Send user password reset link - true or false(default)
227 228 229
- `username` (required)         - Username
- `name` (required)             - Name
- `skype` (optional)            - Skype ID
Ciro Santilli committed
230
- `linkedin` (optional)         - LinkedIn
231
- `twitter` (optional)          - Twitter account
Ciro Santilli committed
232
- `website_url` (optional)      - Website URL
233
- `organization` (optional)     - Organization name
234 235 236
- `projects_limit` (optional)   - Number of projects user can create
- `extern_uid` (optional)       - External UID
- `provider` (optional)         - External provider name
Ciro Santilli committed
237
- `bio` (optional)              - User's biography
238
- `location` (optional)         - User's location
239 240
- `admin` (optional)            - User is admin - true or false (default)
- `can_create_group` (optional) - User can create groups - true or false
241
- `confirm` (optional)          - Require confirmation - true (default) or false
242
- `external` (optional)         - Flags the user as external - true or false(default)
243

244
## User modification
245 246

Modifies an existing user. Only administrators can change attributes of a user.
247 248 249 250 251 252

```
PUT /users/:id
```

Parameters:
253

Ciro Santilli committed
254 255 256 257 258 259 260 261
- `email`                       - Email
- `username`                    - Username
- `name`                        - Name
- `password`                    - Password
- `skype`                       - Skype ID
- `linkedin`                    - LinkedIn
- `twitter`                     - Twitter account
- `website_url`                 - Website URL
262
- `organization`                - Organization name
Ciro Santilli committed
263 264 265 266
- `projects_limit`              - Limit projects each user can create
- `extern_uid`                  - External UID
- `provider`                    - External provider name
- `bio`                         - User's biography
267
- `location` (optional)         - User's location
Ciro Santilli committed
268 269
- `admin` (optional)            - User is admin - true or false (default)
- `can_create_group` (optional) - User can create groups - true or false
270
- `external` (optional)         - Flags the user as external - true or false(default)
Ciro Santilli committed
271

272
On password update, user will be forced to change it upon next login.
273 274
Note, at the moment this method does only return a `404` error,
even in cases where a `409` (Conflict) would be more appropriate,
Ciro Santilli committed
275
e.g. when renaming the email address to some existing one.
276 277

## User deletion
278

Ciro Santilli committed
279 280
Deletes a user. Available only for administrators.
This is an idempotent function, calling this function for a non-existent user id
281
still returns a status code `200 OK`.
Ciro Santilli committed
282 283
The JSON response differs if the user was actually deleted or not.
In the former the user is returned and in the latter not.
284 285 286 287 288

```
DELETE /users/:id
```

289 290
Parameters:

291
- `id` (required) - The ID of the user
292

293 294 295
## User

### For normal users
296

297
Gets currently authenticated user.
298 299 300 301 302 303 304 305

```
GET /user
```

```json
{
  "id": 1,
306
  "username": "john_smith",
307 308
  "email": "john@example.com",
  "name": "John Smith",
309
  "state": "active",
310
  "avatar_url": "http://localhost:3000/uploads/user/avatar/1/index.jpg",
311
  "web_url": "http://localhost:3000/john_smith",
312
  "created_at": "2012-05-23T08:00:58Z",
313
  "is_admin": false,
314
  "bio": null,
315
  "location": null,
316 317 318
  "skype": "",
  "linkedin": "",
  "twitter": "",
Jerome Dalbert committed
319
  "website_url": "",
320
  "organization": "",
321 322
  "last_sign_in_at": "2012-06-01T11:41:01Z",
  "confirmed_at": "2012-05-23T09:05:22Z",
323
  "color_scheme_id": 2,
324 325 326 327 328 329 330
  "projects_limit": 100,
  "current_sign_in_at": "2012-06-02T06:36:55Z",
  "identities": [
    {"provider": "github", "extern_uid": "2435223452345"},
    {"provider": "bitbucket", "extern_uid": "john_smith"},
    {"provider": "google_oauth2", "extern_uid": "8776128412476123468721346"}
  ],
331
  "can_create_group": true,
332
  "can_create_project": true,
333
  "two_factor_enabled": true,
334
  "external": false
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
### For admins

Parameters:

- `sudo` (required) - the ID of a user

```
GET /user
```

```json
{
  "id": 1,
  "username": "john_smith",
  "email": "john@example.com",
  "name": "John Smith",
  "state": "active",
  "avatar_url": "http://localhost:3000/uploads/user/avatar/1/index.jpg",
  "web_url": "http://localhost:3000/john_smith",
  "created_at": "2012-05-23T08:00:58Z",
  "is_admin": false,
  "bio": null,
  "location": null,
  "skype": "",
  "linkedin": "",
  "twitter": "",
  "website_url": "",
  "organization": "",
  "last_sign_in_at": "2012-06-01T11:41:01Z",
  "confirmed_at": "2012-05-23T09:05:22Z",
  "color_scheme_id": 2,
  "projects_limit": 100,
  "current_sign_in_at": "2012-06-02T06:36:55Z",
  "identities": [
    {"provider": "github", "extern_uid": "2435223452345"},
    {"provider": "bitbucket", "extern_uid": "john_smith"},
    {"provider": "google_oauth2", "extern_uid": "8776128412476123468721346"}
  ],
  "can_create_group": true,
  "can_create_project": true,
  "two_factor_enabled": true,
  "external": false,
  "private_token": "dd34asd13as"
}
```

384 385 386 387 388 389 390 391 392 393 394 395
## List SSH keys

Get a list of currently authenticated user's SSH keys.

```
GET /user/keys
```

```json
[
  {
    "id": 1,
396
    "title": "Public key",
397 398
    "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=",
    "created_at": "2014-08-01T14:47:39.080Z"
399 400 401
  },
  {
    "id": 3,
402
    "title": "Another Public key",
403 404
    "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=",
    "created_at": "2014-08-01T14:47:39.080Z"
405 406 407 408
  }
]
```

409 410
Parameters:

411
- **none**
412

413 414 415 416 417
## List SSH keys for user

Get a list of a specified user's SSH keys. Available only for admin

```
418
GET /users/:id/keys
419 420 421 422
```

Parameters:

423
- `id` (required) - id of specified user
424

425 426 427 428 429
## Single SSH key

Get a single key.

```
430
GET /user/keys/:key_id
431 432 433 434
```

Parameters:

435
- `key_id` (required) - The ID of an SSH key
436 437 438 439

```json
{
  "id": 1,
440
  "title": "Public key",
441 442
  "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=",
  "created_at": "2014-08-01T14:47:39.080Z"
443 444
}
```
445

446 447
## Add SSH key

448
Creates a new key owned by the currently authenticated user.
449 450 451 452 453 454 455

```
POST /user/keys
```

Parameters:

456
- `title` (required) - new SSH Key's title
Ciro Santilli committed
457
- `key` (required)   - new SSH key
458

459 460 461 462 463 464 465 466 467
```json
{
  "created_at": "2015-01-21T17:44:33.512Z",
  "key": "ssh-dss AAAAB3NzaC1kc3MAAACBAMLrhYgI3atfrSD6KDas1b/3n6R/HP+bLaHHX6oh+L1vg31mdUqK0Ac/NjZoQunavoyzqdPYhFz9zzOezCrZKjuJDS3NRK9rspvjgM0xYR4d47oNZbdZbwkI4cTv/gcMlquRy0OvpfIvJtjtaJWMwTLtM5VhRusRuUlpH99UUVeXAAAAFQCVyX+92hBEjInEKL0v13c/egDCTQAAAIEAvFdWGq0ccOPbw4f/F8LpZqvWDydAcpXHV3thwb7WkFfppvm4SZte0zds1FJ+Hr8Xzzc5zMHe6J4Nlay/rP4ewmIW7iFKNBEYb/yWa+ceLrs+TfR672TaAgO6o7iSRofEq5YLdwgrwkMmIawa21FrZ2D9SPao/IwvENzk/xcHu7YAAACAQFXQH6HQnxOrw4dqf0NqeKy1tfIPxYYUZhPJfo9O0AmBW2S36pD2l14kS89fvz6Y1g8gN/FwFnRncMzlLY/hX70FSc/3hKBSbH6C6j8hwlgFKfizav21eS358JJz93leOakJZnGb8XlWvz1UJbwCsnR2VEY8Dz90uIk1l/UqHkA= loic@call",
  "title": "ABC",
  "id": 4
}
```

468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483
Will return created key with status `201 Created` on success. If an
error occurs a `400 Bad Request` is returned with a message explaining the error:

```json
{
  "message": {
    "fingerprint": [
      "has already been taken"
    ],
    "key": [
      "has already been taken"
    ]
  }
}
```

484 485 486 487 488 489 490 491 492 493
## Add SSH key for user

Create new key owned by specified user. Available only for admin

```
POST /users/:id/keys
```

Parameters:

Ciro Santilli committed
494
- `id` (required)    - id of specified user
495
- `title` (required) - new SSH Key's title
Ciro Santilli committed
496
- `key` (required)   - new SSH key
497

498
## Delete SSH key for current user
499

Ciro Santilli committed
500 501
Deletes key owned by currently authenticated user.
This is an idempotent function and calling it on a key that is already deleted
502
or not available results in `200 OK`.
503 504

```
505
DELETE /user/keys/:key_id
506 507 508 509
```

Parameters:

510
- `key_id` (required) - SSH key ID
511

512
## Delete SSH key for given user
513 514 515 516

Deletes key owned by a specified user. Available only for admin.

```
517
DELETE /users/:id/keys/:key_id
518 519 520 521
```

Parameters:

522 523
- `id` (required) - id of specified user
- `key_id` (required)  - SSH key ID
524

525
Will return `200 OK` on success, or `404 Not found` if either user or key cannot be found.
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
## List emails

Get a list of currently authenticated user's emails.

```
GET /user/emails
```

```json
[
  {
    "id": 1,
    "email": "email@example.com"
  },
  {
    "id": 3,
    "email": "email2@example.com"
  }
]
```

Parameters:

- **none**

## List emails for user

Get a list of a specified user's emails. Available only for admin

```
557
GET /users/:id/emails
558 559 560 561
```

Parameters:

562
- `id` (required) - id of specified user
563

Douwe Maan committed
564
## Single email
565

Douwe Maan committed
566
Get a single email.
567 568

```
569
GET /user/emails/:email_id
570 571 572 573
```

Parameters:

574
- `email_id` (required) - email ID
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

```json
{
  "id": 1,
  "email": "email@example.com"
}
```

## Add email

Creates a new email owned by the currently authenticated user.

```
POST /user/emails
```

Parameters:

- `email` (required) - email address

```json
{
  "id": 4,
  "email": "email@example.com"
}
```

Douwe Maan committed
602
Will return created email with status `201 Created` on success. If an
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
error occurs a `400 Bad Request` is returned with a message explaining the error:

```json
{
  "message": {
    "email": [
      "has already been taken"
    ]
  }
}
```

## Add email for user

Create new email owned by specified user. Available only for admin

```
POST /users/:id/emails
```

Parameters:

- `id` (required)    - id of specified user
- `email` (required) - email address

## Delete email for current user

Deletes email owned by currently authenticated user.
This is an idempotent function and calling it on a email that is already deleted
or not available results in `200 OK`.

```
635
DELETE /user/emails/:email_id
636 637 638 639
```

Parameters:

640
- `email_id` (required) - email ID
641 642 643 644 645 646

## Delete email for given user

Deletes email owned by a specified user. Available only for admin.

```
647
DELETE /users/:id/emails/:email_id
648 649 650 651
```

Parameters:

652 653
- `id` (required) - id of specified user
- `email_id` (required)  - email ID
654

Douwe Maan committed
655
Will return `200 OK` on success, or `404 Not found` if either user or email cannot be found.
656

657 658 659 660 661
## Block user

Blocks the specified user.  Available only for admin.

```
662
POST /users/:id/block
663 664 665 666
```

Parameters:

667
- `id` (required) - id of specified user
668

669
Will return `201 OK` on success, `404 User Not Found` is user cannot be found or
670
`403 Forbidden` when trying to block an already blocked user by LDAP synchronization.
671 672 673 674 675 676

## Unblock user

Unblocks the specified user.  Available only for admin.

```
677
POST /users/:id/unblock
678 679 680 681
```

Parameters:

682
- `id` (required) - id of specified user
683

684
Will return `201 OK` on success, `404 User Not Found` is user cannot be found or
685
`403 Forbidden` when trying to unblock a user blocked by LDAP synchronization.
686 687 688

### Get user contribution events

689
Get the contribution events for the specified user, sorted from newest to oldest.
690 691 692 693 694 695 696 697 698 699 700 701

```
GET /users/:id/events
```

Parameters:

| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id` | integer | yes | The ID of the user |

```bash
702
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/users/:id/events
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723
```

Example response:

```json
[
  {
    "title": null,
    "project_id": 15,
    "action_name": "closed",
    "target_id": 830,
    "target_type": "Issue",
    "author_id": 1,
    "data": null,
    "target_title": "Public project search field",
    "author": {
      "name": "Dmitriy Zaporozhets",
      "username": "root",
      "id": 1,
      "state": "active",
      "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
724
      "web_url": "http://localhost:3000/root"
725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740
    },
    "author_username": "root"
  },
  {
    "title": null,
    "project_id": 15,
    "action_name": "opened",
    "target_id": null,
    "target_type": null,
    "author_id": 1,
    "author": {
      "name": "Dmitriy Zaporozhets",
      "username": "root",
      "id": 1,
      "state": "active",
      "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
741
      "web_url": "http://localhost:3000/root"
742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786
    },
    "author_username": "john",
    "data": {
      "before": "50d4420237a9de7be1304607147aec22e4a14af7",
      "after": "c5feabde2d8cd023215af4d2ceeb7a64839fc428",
      "ref": "refs/heads/master",
      "user_id": 1,
      "user_name": "Dmitriy Zaporozhets",
      "repository": {
        "name": "gitlabhq",
        "url": "git@dev.gitlab.org:gitlab/gitlabhq.git",
        "description": "GitLab: self hosted Git management software. \r\nDistributed under the MIT License.",
        "homepage": "https://dev.gitlab.org/gitlab/gitlabhq"
      },
      "commits": [
        {
          "id": "c5feabde2d8cd023215af4d2ceeb7a64839fc428",
          "message": "Add simple search to projects in public area",
          "timestamp": "2013-05-13T18:18:08+00:00",
          "url": "https://dev.gitlab.org/gitlab/gitlabhq/commit/c5feabde2d8cd023215af4d2ceeb7a64839fc428",
          "author": {
            "name": "Dmitriy Zaporozhets",
            "email": "dmitriy.zaporozhets@gmail.com"
          }
        }
      ],
      "total_commits_count": 1
    },
    "target_title": null
  },
  {
    "title": null,
    "project_id": 15,
    "action_name": "closed",
    "target_id": 840,
    "target_type": "Issue",
    "author_id": 1,
    "data": null,
    "target_title": "Finish & merge Code search PR",
    "author": {
      "name": "Dmitriy Zaporozhets",
      "username": "root",
      "id": 1,
      "state": "active",
      "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
787
      "web_url": "http://localhost:3000/root"
788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810
    },
    "author_username": "root"
  },
  {
    "title": null,
    "project_id": 15,
    "action_name": "commented on",
    "target_id": 1312,
    "target_type": "Note",
    "author_id": 1,
    "data": null,
    "target_title": null,
    "created_at": "2015-12-04T10:33:58.089Z",
    "note": {
      "id": 1312,
      "body": "What an awesome day!",
      "attachment": null,
      "author": {
        "name": "Dmitriy Zaporozhets",
        "username": "root",
        "id": 1,
        "state": "active",
        "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
811
        "web_url": "http://localhost:3000/root"
812 813 814 815 816 817 818 819 820 821 822 823
      },
      "created_at": "2015-12-04T10:33:56.698Z",
      "system": false,
      "noteable_id": 377,
      "noteable_type": "Issue"
    },
    "author": {
      "name": "Dmitriy Zaporozhets",
      "username": "root",
      "id": 1,
      "state": "active",
      "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
824
      "web_url": "http://localhost:3000/root"
825 826 827 828 829
    },
    "author_username": "root"
  }
]
```