|
| 1 | +# API Endpoints: Users |
| 2 | + |
| 3 | +## Invite User |
| 4 | + |
| 5 | +* Requires [authentication](/api/about.html#api-key) |
| 6 | +* Requires Administrator user type |
| 7 | + |
| 8 | +#### Request |
| 9 | + |
| 10 | +**POST** `https://webhook.site/users/invite` |
| 11 | + |
| 12 | +* `name` (string) The name of the user. |
| 13 | +* `email` (string) The user's email, and where the invite is sent. |
| 14 | +* `user_type_id` (int) One of: `100` (Administrator), `200` (Member), `300` (Viewer) |
| 15 | + |
| 16 | +```json |
| 17 | +{ |
| 18 | + "name": "Elijah Craig", |
| 19 | + |
| 20 | + "user_type_id": 300, |
| 21 | + "role_id": 20001 |
| 22 | +} |
| 23 | +``` |
| 24 | + |
| 25 | +#### Response |
| 26 | + |
| 27 | +```json |
| 28 | +{ |
| 29 | + "id": 30001 |
| 30 | + "name": "Elijah Craig", |
| 31 | + |
| 32 | + "user_type_id": 300 |
| 33 | + "team_id": 10001, |
| 34 | + "roles": [ |
| 35 | + { |
| 36 | + "id": 20001, |
| 37 | + "team_id": 10001, |
| 38 | + "name": "Test Role", |
| 39 | + "created_at": "2024-10-15T10:19:07.000000Z", |
| 40 | + "updated_at": "2025-02-17T12:00:48.000000Z" |
| 41 | + } |
| 42 | + ] |
| 43 | + "updated_at": "2025-09-29T08:18:56.000000Z", |
| 44 | + "created_at": "2025-09-29T08:18:56.000000Z" |
| 45 | +} |
| 46 | +``` |
| 47 | + |
| 48 | +## Get all Users |
| 49 | + |
| 50 | +* Requires [authentication](/api/about.html#api-key) |
| 51 | +* Requires Administrator user type |
| 52 | + |
| 53 | +#### Request |
| 54 | + |
| 55 | +**GET** `https://webhook.site/users` |
| 56 | + |
| 57 | +#### Response |
| 58 | + |
| 59 | +```json |
| 60 | +{ |
| 61 | + "current_page": 1, |
| 62 | + "data": [ |
| 63 | + { |
| 64 | + "id": 1001, |
| 65 | + "name": "Jim Beam", |
| 66 | + |
| 67 | + "two_factor_enabled": 0, |
| 68 | + "created_at": "2020-01-08T21:34:25.000000Z", |
| 69 | + "updated_at": "2025-02-27T10:50:13.000000Z", |
| 70 | + "last_login_at": "2025-09-29T07:59:15.000000Z", |
| 71 | + "team_id": 10001, |
| 72 | + "user_type_id": 100 |
| 73 | + }, |
| 74 | + { |
| 75 | + "id": 30001 |
| 76 | + "name": "Elijah Craig", |
| 77 | + |
| 78 | + "two_factor_enabled": 0, |
| 79 | + "created_at": "2025-02-13T13:22:48.000000Z", |
| 80 | + "updated_at": "2025-08-01T16:05:20.000000Z", |
| 81 | + "last_login_at": "2025-09-23T07:52:15.000000Z", |
| 82 | + "team_id": 10001, |
| 83 | + "user_type_id": 300 |
| 84 | + } |
| 85 | + ], |
| 86 | + "first_page_url": "https:\/\/webhook.site\/users?page=1", |
| 87 | + "from": 1, |
| 88 | + "last_page": 1, |
| 89 | + "last_page_url": "https:\/\/webhook.site\/users?page=1", |
| 90 | + "links": [ |
| 91 | + { |
| 92 | + "url": null, |
| 93 | + "label": "« Previous", |
| 94 | + "active": false |
| 95 | + }, |
| 96 | + { |
| 97 | + "url": "https:\/\/webhook.site\/users?page=1", |
| 98 | + "label": "1", |
| 99 | + "active": true |
| 100 | + }, |
| 101 | + { |
| 102 | + "url": null, |
| 103 | + "label": "Next »", |
| 104 | + "active": false |
| 105 | + } |
| 106 | + ], |
| 107 | + "next_page_url": null, |
| 108 | + "path": "https:\/\/webhook.site\/users", |
| 109 | + "per_page": 15, |
| 110 | + "prev_page_url": null, |
| 111 | + "to": 2, |
| 112 | + "total": 2 |
| 113 | +} |
| 114 | +``` |
| 115 | + |
| 116 | +## Update User |
| 117 | + |
| 118 | +#### Request |
| 119 | + |
| 120 | +**PUT** <code>https://webhook.site/users/<span class="url-param">userId</span></code> |
| 121 | + |
| 122 | +* `name` (string) The name of the user. |
| 123 | +* `email` (string) |
| 124 | +* `user_type_id` (int) One of: `100` (Administrator), `200` (Member), `300` (Viewer) |
| 125 | + |
| 126 | +```json |
| 127 | +{ |
| 128 | + "name": "Elijah Craig", |
| 129 | + |
| 130 | + "user_type_id": 300, |
| 131 | + "role_id": 20001, |
| 132 | +} |
| 133 | +``` |
| 134 | + |
| 135 | +#### Response |
| 136 | + |
| 137 | +(See *Create User* above for response.) |
| 138 | + |
| 139 | +## Delete User |
| 140 | + |
| 141 | +#### Request |
| 142 | + |
| 143 | +**DELETE** <code>https://webhook.site/users/<span class="url-param">userId</span></code> |
| 144 | + |
| 145 | +#### Response |
| 146 | + |
| 147 | +`204 No content` |
0 commit comments