@hailer/mcp 1.1.13 → 1.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/.claude/.context-watchdog.json +1 -0
  2. package/.claude/.session-checked +1 -0
  3. package/.claude/CLAUDE.md +370 -0
  4. package/.claude/agents/agent-ada-skill-builder.md +94 -0
  5. package/.claude/agents/agent-alejandro-function-fields.md +342 -0
  6. package/.claude/agents/agent-bjorn-config-audit.md +103 -0
  7. package/.claude/agents/agent-builder-agent-creator.md +130 -0
  8. package/.claude/agents/agent-code-simplifier.md +53 -0
  9. package/.claude/agents/agent-dmitri-activity-crud.md +159 -0
  10. package/.claude/agents/agent-giuseppe-app-builder.md +208 -0
  11. package/.claude/agents/agent-gunther-mcp-tools.md +39 -0
  12. package/.claude/agents/agent-helga-workflow-config.md +204 -0
  13. package/.claude/agents/agent-igor-activity-mover-automation.md +125 -0
  14. package/.claude/agents/agent-ingrid-doc-templates.md +261 -0
  15. package/.claude/agents/agent-ivan-monolith.md +154 -0
  16. package/.claude/agents/agent-kenji-data-reader.md +86 -0
  17. package/.claude/agents/agent-lars-code-inspector.md +102 -0
  18. package/.claude/agents/agent-marco-mockup-builder.md +110 -0
  19. package/.claude/agents/agent-marcus-api-documenter.md +323 -0
  20. package/.claude/agents/agent-marketplace-publisher.md +280 -0
  21. package/.claude/agents/agent-marketplace-reviewer.md +309 -0
  22. package/.claude/agents/agent-permissions-handler.md +208 -0
  23. package/.claude/agents/agent-simple-writer.md +48 -0
  24. package/.claude/agents/agent-svetlana-code-review.md +171 -0
  25. package/.claude/agents/agent-tanya-test-runner.md +333 -0
  26. package/.claude/agents/agent-ui-designer.md +100 -0
  27. package/.claude/agents/agent-viktor-sql-insights.md +212 -0
  28. package/.claude/agents/agent-web-search.md +55 -0
  29. package/.claude/agents/agent-yevgeni-discussions.md +45 -0
  30. package/.claude/agents/agent-zara-zapier.md +159 -0
  31. package/.claude/agents/ragnar.md +68 -0
  32. package/.claude/commands/app-squad.md +135 -0
  33. package/.claude/commands/audit-squad.md +158 -0
  34. package/.claude/commands/autoplan.md +563 -0
  35. package/.claude/commands/cleanup-squad.md +98 -0
  36. package/.claude/commands/config-squad.md +106 -0
  37. package/.claude/commands/crud-squad.md +87 -0
  38. package/.claude/commands/data-squad.md +97 -0
  39. package/.claude/commands/debug-squad.md +303 -0
  40. package/.claude/commands/doc-squad.md +65 -0
  41. package/.claude/commands/handoff.md +137 -0
  42. package/.claude/commands/health.md +49 -0
  43. package/.claude/commands/help.md +29 -0
  44. package/.claude/commands/help:agents.md +151 -0
  45. package/.claude/commands/help:commands.md +78 -0
  46. package/.claude/commands/help:faq.md +79 -0
  47. package/.claude/commands/help:plugins.md +50 -0
  48. package/.claude/commands/help:skills.md +93 -0
  49. package/.claude/commands/help:tools.md +75 -0
  50. package/.claude/commands/hotfix-squad.md +112 -0
  51. package/.claude/commands/integration-squad.md +82 -0
  52. package/.claude/commands/janitor-squad.md +167 -0
  53. package/.claude/commands/learn-auto.md +120 -0
  54. package/.claude/commands/learn.md +120 -0
  55. package/.claude/commands/mcp-list.md +27 -0
  56. package/.claude/commands/onboard-squad.md +140 -0
  57. package/.claude/commands/plan-workspace.md +732 -0
  58. package/.claude/commands/prd.md +130 -0
  59. package/.claude/commands/project-status.md +82 -0
  60. package/.claude/commands/publish.md +138 -0
  61. package/.claude/commands/recap.md +69 -0
  62. package/.claude/commands/restore.md +64 -0
  63. package/.claude/commands/review-squad.md +152 -0
  64. package/.claude/commands/save.md +24 -0
  65. package/.claude/commands/stats.md +19 -0
  66. package/.claude/commands/swarm.md +210 -0
  67. package/.claude/commands/tool-builder.md +39 -0
  68. package/.claude/commands/ws-pull.md +44 -0
  69. package/.claude/skills/SDK-activity-patterns/SKILL.md +428 -0
  70. package/.claude/skills/SDK-document-templates/SKILL.md +1033 -0
  71. package/.claude/skills/SDK-function-fields/SKILL.md +542 -0
  72. package/.claude/skills/SDK-generate-skill/SKILL.md +92 -0
  73. package/.claude/skills/SDK-init-skill/SKILL.md +127 -0
  74. package/.claude/skills/SDK-insight-queries/SKILL.md +787 -0
  75. package/.claude/skills/SDK-ws-config-skill/SKILL.md +1139 -0
  76. package/.claude/skills/agent-structure/SKILL.md +98 -0
  77. package/.claude/skills/api-documentation-patterns/SKILL.md +474 -0
  78. package/.claude/skills/chrome-mcp-reference/SKILL.md +370 -0
  79. package/.claude/skills/delegation-routing/SKILL.md +202 -0
  80. package/.claude/skills/frontend-design/SKILL.md +254 -0
  81. package/.claude/skills/hailer-activity-mover/SKILL.md +213 -0
  82. package/.claude/skills/hailer-api-client/SKILL.md +518 -0
  83. package/.claude/skills/hailer-app-builder/SKILL.md +1440 -0
  84. package/.claude/skills/hailer-apps-pictures/SKILL.md +269 -0
  85. package/.claude/skills/hailer-design-system/SKILL.md +231 -0
  86. package/.claude/skills/hailer-monolith-automations/SKILL.md +686 -0
  87. package/.claude/skills/hailer-permissions-system/SKILL.md +121 -0
  88. package/.claude/skills/hailer-project-protocol/SKILL.md +488 -0
  89. package/.claude/skills/hailer-rest-api/SKILL.md +61 -0
  90. package/.claude/skills/hailer-rest-api/hailer-activities.md +184 -0
  91. package/.claude/skills/hailer-rest-api/hailer-admin.md +473 -0
  92. package/.claude/skills/hailer-rest-api/hailer-calendar.md +256 -0
  93. package/.claude/skills/hailer-rest-api/hailer-feed.md +249 -0
  94. package/.claude/skills/hailer-rest-api/hailer-insights.md +195 -0
  95. package/.claude/skills/hailer-rest-api/hailer-messaging.md +276 -0
  96. package/.claude/skills/hailer-rest-api/hailer-workflows.md +283 -0
  97. package/.claude/skills/insight-join-patterns/SKILL.md +174 -0
  98. package/.claude/skills/integration-patterns/SKILL.md +421 -0
  99. package/.claude/skills/json-only-output/SKILL.md +72 -0
  100. package/.claude/skills/lsp-setup/SKILL.md +160 -0
  101. package/.claude/skills/mcp-direct-tools/SKILL.md +153 -0
  102. package/.claude/skills/optional-parameters/SKILL.md +72 -0
  103. package/.claude/skills/publish-hailer-app/SKILL.md +221 -0
  104. package/.claude/skills/testing-patterns/SKILL.md +630 -0
  105. package/.claude/skills/tool-builder/SKILL.md +250 -0
  106. package/.claude/skills/tool-parameter-usage/SKILL.md +126 -0
  107. package/.claude/skills/tool-response-verification/SKILL.md +92 -0
  108. package/.claude/skills/zapier-hailer-patterns/SKILL.md +581 -0
  109. package/.opencode/agent/agent-ada-skill-builder.md +35 -0
  110. package/.opencode/agent/agent-alejandro-function-fields.md +39 -0
  111. package/.opencode/agent/agent-bjorn-config-audit.md +36 -0
  112. package/.opencode/agent/agent-builder-agent-creator.md +39 -0
  113. package/.opencode/agent/agent-code-simplifier.md +31 -0
  114. package/.opencode/agent/agent-dmitri-activity-crud.md +40 -0
  115. package/.opencode/agent/agent-giuseppe-app-builder.md +37 -0
  116. package/.opencode/agent/agent-gunther-mcp-tools.md +39 -0
  117. package/.opencode/agent/agent-helga-workflow-config.md +204 -0
  118. package/.opencode/agent/agent-igor-activity-mover-automation.md +46 -0
  119. package/.opencode/agent/agent-ingrid-doc-templates.md +39 -0
  120. package/.opencode/agent/agent-ivan-monolith.md +46 -0
  121. package/.opencode/agent/agent-kenji-data-reader.md +53 -0
  122. package/.opencode/agent/agent-lars-code-inspector.md +28 -0
  123. package/.opencode/agent/agent-marco-mockup-builder.md +42 -0
  124. package/.opencode/agent/agent-marcus-api-documenter.md +53 -0
  125. package/.opencode/agent/agent-marketplace-publisher.md +44 -0
  126. package/.opencode/agent/agent-marketplace-reviewer.md +42 -0
  127. package/.opencode/agent/agent-permissions-handler.md +50 -0
  128. package/.opencode/agent/agent-simple-writer.md +45 -0
  129. package/.opencode/agent/agent-svetlana-code-review.md +39 -0
  130. package/.opencode/agent/agent-tanya-test-runner.md +57 -0
  131. package/.opencode/agent/agent-ui-designer.md +56 -0
  132. package/.opencode/agent/agent-viktor-sql-insights.md +34 -0
  133. package/.opencode/agent/agent-web-search.md +42 -0
  134. package/.opencode/agent/agent-yevgeni-discussions.md +37 -0
  135. package/.opencode/agent/agent-zara-zapier.md +53 -0
  136. package/.opencode/commands/app-squad.md +135 -0
  137. package/.opencode/commands/audit-squad.md +158 -0
  138. package/.opencode/commands/autoplan.md +563 -0
  139. package/.opencode/commands/cleanup-squad.md +98 -0
  140. package/.opencode/commands/config-squad.md +106 -0
  141. package/.opencode/commands/crud-squad.md +87 -0
  142. package/.opencode/commands/data-squad.md +97 -0
  143. package/.opencode/commands/debug-squad.md +303 -0
  144. package/.opencode/commands/doc-squad.md +65 -0
  145. package/.opencode/commands/handoff.md +137 -0
  146. package/.opencode/commands/health.md +49 -0
  147. package/.opencode/commands/help-agents.md +151 -0
  148. package/.opencode/commands/help-commands.md +32 -0
  149. package/.opencode/commands/help-faq.md +29 -0
  150. package/.opencode/commands/help-plugins.md +28 -0
  151. package/.opencode/commands/help-skills.md +7 -0
  152. package/.opencode/commands/help-tools.md +40 -0
  153. package/.opencode/commands/help.md +28 -0
  154. package/.opencode/commands/hotfix-squad.md +112 -0
  155. package/.opencode/commands/integration-squad.md +82 -0
  156. package/.opencode/commands/janitor-squad.md +167 -0
  157. package/.opencode/commands/learn-auto.md +120 -0
  158. package/.opencode/commands/learn.md +120 -0
  159. package/.opencode/commands/mcp-list.md +27 -0
  160. package/.opencode/commands/onboard-squad.md +140 -0
  161. package/.opencode/commands/plan-workspace.md +732 -0
  162. package/.opencode/commands/prd.md +131 -0
  163. package/.opencode/commands/project-status.md +82 -0
  164. package/.opencode/commands/publish.md +138 -0
  165. package/.opencode/commands/recap.md +69 -0
  166. package/.opencode/commands/restore.md +64 -0
  167. package/.opencode/commands/review-squad.md +152 -0
  168. package/.opencode/commands/save.md +24 -0
  169. package/.opencode/commands/stats.md +19 -0
  170. package/.opencode/commands/swarm.md +210 -0
  171. package/.opencode/commands/tool-builder.md +39 -0
  172. package/.opencode/commands/ws-pull.md +44 -0
  173. package/.opencode/opencode.json +21 -0
  174. package/package.json +1 -1
  175. package/scripts/postinstall.cjs +64 -0
  176. package/scripts/test-hal-tools.ts +154 -0
@@ -0,0 +1,256 @@
1
+ # Hailer Calendar API
2
+
3
+ Execute Hailer calendar and event operations via REST API.
4
+
5
+ ## Base URL
6
+ - **Production:** `https://api.hailer.com/api`
7
+ - **Staging:** `https://api.hailer.biz/api`
8
+
9
+ ## Authentication
10
+ All requests require `hlrkey` header with session key.
11
+
12
+ ---
13
+
14
+ ## Calendars
15
+
16
+ ### List All Calendars
17
+ ```bash
18
+ curl -X POST "https://api.hailer.com/api/calendar/list_all" \
19
+ -H "Content-Type: application/json" \
20
+ -H "hlrkey: YOUR_SESSION_KEY" \
21
+ -d '[{}]'
22
+ ```
23
+
24
+ ### Create Calendar
25
+ ```bash
26
+ curl -X POST "https://api.hailer.com/api/calendar/create_calendar" \
27
+ -H "Content-Type: application/json" \
28
+ -H "hlrkey: YOUR_SESSION_KEY" \
29
+ -d '[{"name": "My Calendar", "color": "#3498db", "cid": "WORKSPACE_ID"}]'
30
+ ```
31
+
32
+ ### Update Calendar
33
+ ```bash
34
+ curl -X POST "https://api.hailer.com/api/calendar/update_calendar" \
35
+ -H "Content-Type: application/json" \
36
+ -H "hlrkey: YOUR_SESSION_KEY" \
37
+ -d '[{"_id": "CALENDAR_ID", "name": "Updated Name", "color": "#e74c3c"}]'
38
+ ```
39
+
40
+ ### Remove Calendar
41
+ ```bash
42
+ curl -X POST "https://api.hailer.com/api/calendar/remove_calendar" \
43
+ -H "Content-Type: application/json" \
44
+ -H "hlrkey: YOUR_SESSION_KEY" \
45
+ -d '["CALENDAR_ID"]'
46
+ ```
47
+
48
+ ### Set Calendar Permissions
49
+ ```bash
50
+ curl -X POST "https://api.hailer.com/api/calendar/calendar_permission" \
51
+ -H "Content-Type: application/json" \
52
+ -H "hlrkey: YOUR_SESSION_KEY" \
53
+ -d '[{"calendarId": "CALENDAR_ID", "userId": "USER_ID", "permission": "edit"}]'
54
+ ```
55
+
56
+ ### Save Selected Calendars (user preference)
57
+ ```bash
58
+ curl -X POST "https://api.hailer.com/api/calendar/save_selected_calendars" \
59
+ -H "Content-Type: application/json" \
60
+ -H "hlrkey: YOUR_SESSION_KEY" \
61
+ -d '[["CALENDAR_ID_1", "CALENDAR_ID_2"]]'
62
+ ```
63
+
64
+ ---
65
+
66
+ ## Events
67
+
68
+ ### Create Event
69
+ ```bash
70
+ curl -X POST "https://api.hailer.com/api/calendar/create_event" \
71
+ -H "Content-Type: application/json" \
72
+ -H "hlrkey: YOUR_SESSION_KEY" \
73
+ -d '[{
74
+ "calendarId": "CALENDAR_ID",
75
+ "subject": "Team Meeting",
76
+ "description": "Weekly sync",
77
+ "start": 1705400000000,
78
+ "end": 1705403600000,
79
+ "allDay": false,
80
+ "location": "Conference Room A",
81
+ "invites": ["USER_ID_1", "USER_ID_2"]
82
+ }]'
83
+ ```
84
+
85
+ ### Update Event
86
+ ```bash
87
+ curl -X POST "https://api.hailer.com/api/calendar/update_event" \
88
+ -H "Content-Type: application/json" \
89
+ -H "hlrkey: YOUR_SESSION_KEY" \
90
+ -d '[{
91
+ "_id": "EVENT_ID",
92
+ "subject": "Updated Meeting Title",
93
+ "start": 1705410000000,
94
+ "end": 1705413600000
95
+ }]'
96
+ ```
97
+
98
+ ### Load Single Event
99
+ ```bash
100
+ curl -X POST "https://api.hailer.com/api/calendar/load_event" \
101
+ -H "Content-Type: application/json" \
102
+ -H "hlrkey: YOUR_SESSION_KEY" \
103
+ -d '[{"eventId": "EVENT_ID"}]'
104
+ ```
105
+
106
+ ### Load Events (date range)
107
+ ```bash
108
+ curl -X POST "https://api.hailer.com/api/calendar/load_events" \
109
+ -H "Content-Type: application/json" \
110
+ -H "hlrkey: YOUR_SESSION_KEY" \
111
+ -d '[{
112
+ "start": 1704067200000,
113
+ "end": 1706745600000,
114
+ "calendarIds": ["CALENDAR_ID_1", "CALENDAR_ID_2"]
115
+ }]'
116
+ ```
117
+
118
+ ### Remove Event
119
+ ```bash
120
+ curl -X POST "https://api.hailer.com/api/calendar/remove_event" \
121
+ -H "Content-Type: application/json" \
122
+ -H "hlrkey: YOUR_SESSION_KEY" \
123
+ -d '["EVENT_ID"]'
124
+ ```
125
+
126
+ ### Get Upcoming Events
127
+ ```bash
128
+ curl -X POST "https://api.hailer.com/api/calendar/upcoming_events" \
129
+ -H "Content-Type: application/json" \
130
+ -H "hlrkey: YOUR_SESSION_KEY" \
131
+ -d '[{"limit": 10}]'
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Recurring Events
137
+
138
+ ### Load Repeat Series
139
+ ```bash
140
+ curl -X POST "https://api.hailer.com/api/calendar/load_repeat_series" \
141
+ -H "Content-Type: application/json" \
142
+ -H "hlrkey: YOUR_SESSION_KEY" \
143
+ -d '["SERIES_ID"]'
144
+ ```
145
+
146
+ ### Create Recurring Event
147
+ ```bash
148
+ curl -X POST "https://api.hailer.com/api/calendar/create_event" \
149
+ -H "Content-Type: application/json" \
150
+ -H "hlrkey: YOUR_SESSION_KEY" \
151
+ -d '[{
152
+ "calendarId": "CALENDAR_ID",
153
+ "subject": "Daily Standup",
154
+ "start": 1705395600000,
155
+ "end": 1705396500000,
156
+ "repeat": {
157
+ "frequency": "daily",
158
+ "interval": 1,
159
+ "until": 1707984000000
160
+ }
161
+ }]'
162
+ ```
163
+
164
+ Repeat frequency options: `daily`, `weekly`, `monthly`, `yearly`
165
+
166
+ ---
167
+
168
+ ## Event Invitations
169
+
170
+ ### Invite User to Event
171
+ Include `invites` array when creating/updating event:
172
+ ```bash
173
+ curl -X POST "https://api.hailer.com/api/calendar/update_event" \
174
+ -H "Content-Type: application/json" \
175
+ -H "hlrkey: YOUR_SESSION_KEY" \
176
+ -d '[{
177
+ "_id": "EVENT_ID",
178
+ "invites": ["USER_ID_1", "USER_ID_2", "USER_ID_3"]
179
+ }]'
180
+ ```
181
+
182
+ ### Remove Invite
183
+ ```bash
184
+ curl -X POST "https://api.hailer.com/api/calendar/remove_invite" \
185
+ -H "Content-Type: application/json" \
186
+ -H "hlrkey: YOUR_SESSION_KEY" \
187
+ -d '["EVENT_ID", "USER_ID"]'
188
+ ```
189
+
190
+ ### Respond to Invite
191
+ ```bash
192
+ curl -X POST "https://api.hailer.com/api/calendar/invite_respond" \
193
+ -H "Content-Type: application/json" \
194
+ -H "hlrkey: YOUR_SESSION_KEY" \
195
+ -d '[{"EVENT_ID": true}]'
196
+ # true = accept, false = decline, null = maybe
197
+ ```
198
+
199
+ ---
200
+
201
+ ## iCal Integration
202
+
203
+ ### Generate iCal Link
204
+ ```bash
205
+ curl -X POST "https://api.hailer.com/api/calendar/generate_ical_link" \
206
+ -H "Content-Type: application/json" \
207
+ -H "hlrkey: YOUR_SESSION_KEY" \
208
+ -d '["CALENDAR_ID"]'
209
+ ```
210
+ Returns a URL that can be subscribed to in external calendar apps.
211
+
212
+ ### Remove iCal Link
213
+ ```bash
214
+ curl -X POST "https://api.hailer.com/api/calendar/remove_ical_link" \
215
+ -H "Content-Type: application/json" \
216
+ -H "hlrkey: YOUR_SESSION_KEY" \
217
+ -d '["CALENDAR_ID", {}]'
218
+ ```
219
+
220
+ ---
221
+
222
+ ## Event Object Structure
223
+
224
+ ```json
225
+ {
226
+ "_id": "event_id",
227
+ "calendarId": "calendar_id",
228
+ "subject": "Meeting Title",
229
+ "description": "Meeting description",
230
+ "start": 1705400000000,
231
+ "end": 1705403600000,
232
+ "allDay": false,
233
+ "location": "Room 101",
234
+ "invites": ["user_id_1", "user_id_2"],
235
+ "responses": {
236
+ "user_id_1": true,
237
+ "user_id_2": null
238
+ },
239
+ "repeat": {
240
+ "frequency": "weekly",
241
+ "interval": 1,
242
+ "until": 1707984000000
243
+ },
244
+ "created": 1705123456789,
245
+ "createdBy": "user_id"
246
+ }
247
+ ```
248
+
249
+ ---
250
+
251
+ ## Notes
252
+ - Timestamps are milliseconds since Unix epoch
253
+ - `allDay: true` events ignore time portion of start/end
254
+ - Each workspace can have multiple calendars
255
+ - Events can be linked to activities via the activity's calendar field
256
+ - Invite responses: `true` = accepted, `false` = declined, `null` = maybe/pending
@@ -0,0 +1,249 @@
1
+ # Hailer Feed (Wall) API
2
+
3
+ Execute Hailer feed/wall post operations via REST API.
4
+
5
+ ## Base URL
6
+ - **Production:** `https://api.hailer.com/api`
7
+ - **Staging:** `https://api.hailer.biz/api`
8
+
9
+ ## Authentication
10
+ All requests require `hlrkey` header with session key.
11
+
12
+ ---
13
+
14
+ ## Posts
15
+
16
+ ### Create New Post
17
+ ```bash
18
+ curl -X POST "https://api.hailer.com/api/wall2/new_post" \
19
+ -H "Content-Type: application/json" \
20
+ -H "hlrkey: YOUR_SESSION_KEY" \
21
+ -d '[{
22
+ "subject": "Announcement Title",
23
+ "text": "Post content goes here. Supports **markdown**.",
24
+ "files": ["FILE_ID_1", "FILE_ID_2"]
25
+ }]'
26
+ ```
27
+
28
+ ### Create Post to Specific Target
29
+ ```bash
30
+ # Post to team
31
+ curl -X POST "https://api.hailer.com/api/wall2/new_post" \
32
+ -H "Content-Type: application/json" \
33
+ -H "hlrkey: YOUR_SESSION_KEY" \
34
+ -d '[
35
+ {"subject": "Team Update", "text": "Content here"},
36
+ {"teamId": "TEAM_ID"}
37
+ ]'
38
+
39
+ # Post to workspace
40
+ curl -X POST "https://api.hailer.com/api/wall2/new_post" \
41
+ -H "Content-Type: application/json" \
42
+ -H "hlrkey: YOUR_SESSION_KEY" \
43
+ -d '[
44
+ {"subject": "Company Announcement", "text": "Content here"},
45
+ {"networkId": "WORKSPACE_ID"}
46
+ ]'
47
+
48
+ # Post to group
49
+ curl -X POST "https://api.hailer.com/api/wall2/new_post" \
50
+ -H "Content-Type: application/json" \
51
+ -H "hlrkey: YOUR_SESSION_KEY" \
52
+ -d '[
53
+ {"subject": "Group News", "text": "Content here"},
54
+ {"groupId": "GROUP_ID"}
55
+ ]'
56
+ ```
57
+
58
+ ### Edit Post
59
+ ```bash
60
+ curl -X POST "https://api.hailer.com/api/wall2/edit_post" \
61
+ -H "Content-Type: application/json" \
62
+ -H "hlrkey: YOUR_SESSION_KEY" \
63
+ -d '["POST_ID", {
64
+ "subject": "Updated Title",
65
+ "text": "Updated content"
66
+ }]'
67
+ ```
68
+
69
+ ### Remove Post
70
+ ```bash
71
+ curl -X POST "https://api.hailer.com/api/wall2/remove_post" \
72
+ -H "Content-Type: application/json" \
73
+ -H "hlrkey: YOUR_SESSION_KEY" \
74
+ -d '["POST_ID"]'
75
+ ```
76
+
77
+ ---
78
+
79
+ ## Loading Posts
80
+
81
+ ### Load Posts (Feed)
82
+ ```bash
83
+ curl -X POST "https://api.hailer.com/api/wall2/load_posts" \
84
+ -H "Content-Type: application/json" \
85
+ -H "hlrkey: YOUR_SESSION_KEY" \
86
+ -d '[null, {"limit": 20}]'
87
+ ```
88
+
89
+ ### Load More Posts (Pagination)
90
+ ```bash
91
+ curl -X POST "https://api.hailer.com/api/wall2/load_posts" \
92
+ -H "Content-Type: application/json" \
93
+ -H "hlrkey: YOUR_SESSION_KEY" \
94
+ -d '["LAST_POST_ID", {"limit": 20}]'
95
+ ```
96
+
97
+ ---
98
+
99
+ ## Comments
100
+
101
+ ### Add Comment
102
+ ```bash
103
+ curl -X POST "https://api.hailer.com/api/wall2/save_comment" \
104
+ -H "Content-Type: application/json" \
105
+ -H "hlrkey: YOUR_SESSION_KEY" \
106
+ -d '[{
107
+ "text": "Great post!",
108
+ "files": []
109
+ }, "POST_ID"]'
110
+ ```
111
+
112
+ ### Load Comments
113
+ ```bash
114
+ curl -X POST "https://api.hailer.com/api/wall2/load_comments" \
115
+ -H "Content-Type: application/json" \
116
+ -H "hlrkey: YOUR_SESSION_KEY" \
117
+ -d '["POST_ID"]'
118
+ ```
119
+
120
+ ### Load More Comments (Pagination)
121
+ ```bash
122
+ curl -X POST "https://api.hailer.com/api/wall2/load_comments" \
123
+ -H "Content-Type: application/json" \
124
+ -H "hlrkey: YOUR_SESSION_KEY" \
125
+ -d '["POST_ID", "LAST_COMMENT_ID"]'
126
+ ```
127
+
128
+ ### Edit Comment
129
+ ```bash
130
+ curl -X POST "https://api.hailer.com/api/wall2/edit_comment" \
131
+ -H "Content-Type: application/json" \
132
+ -H "hlrkey: YOUR_SESSION_KEY" \
133
+ -d '["POST_ID", "COMMENT_ID", {
134
+ "text": "Updated comment text"
135
+ }]'
136
+ ```
137
+
138
+ ### Remove Comment
139
+ ```bash
140
+ curl -X POST "https://api.hailer.com/api/wall2/remove_comment" \
141
+ -H "Content-Type: application/json" \
142
+ -H "hlrkey: YOUR_SESSION_KEY" \
143
+ -d '["POST_ID", "COMMENT_ID"]'
144
+ ```
145
+
146
+ ---
147
+
148
+ ## Interactions
149
+
150
+ ### Like/Unlike Post
151
+ ```bash
152
+ curl -X POST "https://api.hailer.com/api/wall2/like_post" \
153
+ -H "Content-Type: application/json" \
154
+ -H "hlrkey: YOUR_SESSION_KEY" \
155
+ -d '["POST_ID", {"like": true}]'
156
+ # like: true = like, false = unlike
157
+ ```
158
+
159
+ ### Pin/Unpin Post
160
+ ```bash
161
+ curl -X POST "https://api.hailer.com/api/wall2/pin_post" \
162
+ -H "Content-Type: application/json" \
163
+ -H "hlrkey: YOUR_SESSION_KEY" \
164
+ -d '["POST_ID", true]'
165
+ # true = pin, false = unpin
166
+ ```
167
+
168
+ ### Follow Post (get notifications)
169
+ ```bash
170
+ curl -X POST "https://api.hailer.com/api/wall2/follow_post" \
171
+ -H "Content-Type: application/json" \
172
+ -H "hlrkey: YOUR_SESSION_KEY" \
173
+ -d '["POST_ID"]'
174
+ ```
175
+
176
+ ### Unfollow Post
177
+ ```bash
178
+ curl -X POST "https://api.hailer.com/api/wall2/unfollow_post" \
179
+ -H "Content-Type: application/json" \
180
+ -H "hlrkey: YOUR_SESSION_KEY" \
181
+ -d '["POST_ID"]'
182
+ ```
183
+
184
+ ---
185
+
186
+ ## Read Status
187
+
188
+ ### Mark Posts as Seen
189
+ ```bash
190
+ curl -X POST "https://api.hailer.com/api/wall2/seen" \
191
+ -H "Content-Type: application/json" \
192
+ -H "hlrkey: YOUR_SESSION_KEY" \
193
+ -d '[{"postIds": ["POST_ID_1", "POST_ID_2"]}]'
194
+ ```
195
+
196
+ ### Get Unread Posts
197
+ ```bash
198
+ curl -X POST "https://api.hailer.com/api/wall2/unread" \
199
+ -H "Content-Type: application/json" \
200
+ -H "hlrkey: YOUR_SESSION_KEY" \
201
+ -d '[{}]'
202
+ ```
203
+
204
+ ---
205
+
206
+ ## Post Object Structure
207
+
208
+ ```json
209
+ {
210
+ "_id": "post_id",
211
+ "subject": "Post Title",
212
+ "text": "Post content with **markdown** support",
213
+ "files": ["file_id_1", "file_id_2"],
214
+ "target": {
215
+ "type": "network",
216
+ "id": "workspace_id"
217
+ },
218
+ "likes": ["user_id_1", "user_id_2"],
219
+ "likeCount": 2,
220
+ "commentCount": 5,
221
+ "pinned": false,
222
+ "created": 1705123456789,
223
+ "createdBy": "user_id",
224
+ "modified": 1705123456789
225
+ }
226
+ ```
227
+
228
+ ## Comment Object Structure
229
+
230
+ ```json
231
+ {
232
+ "_id": "comment_id",
233
+ "postId": "post_id",
234
+ "text": "Comment text",
235
+ "files": [],
236
+ "created": 1705123456789,
237
+ "createdBy": "user_id"
238
+ }
239
+ ```
240
+
241
+ ---
242
+
243
+ ## Notes
244
+ - Posts support markdown formatting in `text` field
245
+ - Files must be uploaded first via `/upload` endpoint
246
+ - Pinned posts appear at top of feed
247
+ - Following a post triggers notifications for new comments
248
+ - Target types: `user`, `team`, `network` (workspace), `group`
249
+ - Default target is the user's primary workspace feed
@@ -0,0 +1,195 @@
1
+ # Hailer Insights API (v3)
2
+
3
+ Execute Hailer insight (SQL views/reports) operations via REST API.
4
+
5
+ ## Base URL
6
+ - **Production:** `https://api.hailer.com/api`
7
+ - **Staging:** `https://api.hailer.biz/api`
8
+
9
+ ## Authentication
10
+ All requests require `hlrkey` header with session key.
11
+
12
+ ---
13
+
14
+ ## Insight CRUD
15
+
16
+ ### Create Insight
17
+ ```bash
18
+ curl -X POST "https://api.hailer.com/api/v3/insight/create" \
19
+ -H "Content-Type: application/json" \
20
+ -H "hlrkey: YOUR_SESSION_KEY" \
21
+ -d '["WORKSPACE_ID", {"name": "My Report", "sql": "SELECT * FROM activities WHERE workflow_id = :workflowId"}]'
22
+ ```
23
+
24
+ ### Update Insight
25
+ ```bash
26
+ curl -X POST "https://api.hailer.com/api/v3/insight/update" \
27
+ -H "Content-Type: application/json" \
28
+ -H "hlrkey: YOUR_SESSION_KEY" \
29
+ -d '["INSIGHT_ID", {"name": "Updated Report", "sql": "SELECT name, created FROM activities"}]'
30
+ ```
31
+
32
+ ### List Insights
33
+ ```bash
34
+ curl -X POST "https://api.hailer.com/api/v3/insight/list" \
35
+ -H "Content-Type: application/json" \
36
+ -H "hlrkey: YOUR_SESSION_KEY" \
37
+ -d '["WORKSPACE_ID"]'
38
+ ```
39
+
40
+ ### Copy Insight
41
+ ```bash
42
+ curl -X POST "https://api.hailer.com/api/v3/insight/copy" \
43
+ -H "Content-Type: application/json" \
44
+ -H "hlrkey: YOUR_SESSION_KEY" \
45
+ -d '["INSIGHT_ID", {"name": "Copy of Report"}]'
46
+ ```
47
+
48
+ ### Remove Insight
49
+ ```bash
50
+ curl -X POST "https://api.hailer.com/api/v3/insight/remove" \
51
+ -H "Content-Type: application/json" \
52
+ -H "hlrkey: YOUR_SESSION_KEY" \
53
+ -d '["INSIGHT_ID"]'
54
+ ```
55
+
56
+ ---
57
+
58
+ ## Execute Insights
59
+
60
+ ### Get Insight Data
61
+ ```bash
62
+ curl -X POST "https://api.hailer.com/api/v3/insight/data" \
63
+ -H "Content-Type: application/json" \
64
+ -H "hlrkey: YOUR_SESSION_KEY" \
65
+ -d '["INSIGHT_ID", {"params": {"workflowId": "WF_ID"}, "limit": 100, "offset": 0}]'
66
+ ```
67
+
68
+ ### Preview Insight (test SQL without saving)
69
+ ```bash
70
+ curl -X POST "https://api.hailer.com/api/v3/insight/preview" \
71
+ -H "Content-Type: application/json" \
72
+ -H "hlrkey: YOUR_SESSION_KEY" \
73
+ -d '["WORKSPACE_ID", {"sql": "SELECT COUNT(*) as total FROM activities", "params": {}}]'
74
+ ```
75
+
76
+ ---
77
+
78
+ ## Public Insights
79
+
80
+ ### Get Public Insight Data (no auth required)
81
+ ```bash
82
+ curl -X POST "https://api.hailer.com/api/v3/insight/public" \
83
+ -H "Content-Type: application/json" \
84
+ -d '["PUBLIC_INSIGHT_KEY"]'
85
+ ```
86
+
87
+ Note: Public insights use a special key, not the insight ID. The key is generated when making an insight public.
88
+
89
+ ---
90
+
91
+ ## Insight Members
92
+
93
+ ### Add Member
94
+ ```bash
95
+ curl -X POST "https://api.hailer.com/api/v3/insight/member/add" \
96
+ -H "Content-Type: application/json" \
97
+ -H "hlrkey: YOUR_SESSION_KEY" \
98
+ -d '["INSIGHT_ID", {"userId": "USER_ID"}]'
99
+ # Also supports: {"teamId": "TEAM_ID"}, {"groupId": "GROUP_ID"}, {"networkId": "WORKSPACE_ID"}
100
+ ```
101
+
102
+ ### Remove Member
103
+ ```bash
104
+ curl -X POST "https://api.hailer.com/api/v3/insight/member/remove" \
105
+ -H "Content-Type: application/json" \
106
+ -H "hlrkey: YOUR_SESSION_KEY" \
107
+ -d '["INSIGHT_ID", {"userId": "USER_ID"}]'
108
+ ```
109
+
110
+ ---
111
+
112
+ ## SQL Reference
113
+
114
+ Hailer insights use a SQL-like syntax with these tables:
115
+
116
+ ### Available Tables
117
+ - `activities` - All activities (rows) across workflows
118
+ - `workflows` - Workflow definitions
119
+ - `phases` - Phase definitions
120
+ - `users` - Workspace users
121
+ - `teams` - Teams in workspace
122
+
123
+ ### Common Columns (activities)
124
+ - `_id` - Activity ID
125
+ - `name` - Activity name
126
+ - `workflow_id` - Parent workflow
127
+ - `phase_id` - Current phase
128
+ - `created` - Creation timestamp
129
+ - `modified` - Last modified timestamp
130
+ - `created_by` - Creator user ID
131
+ - `fields.FIELD_ID` - Custom field values
132
+
133
+ ### Example Queries
134
+
135
+ **Count by phase:**
136
+ ```sql
137
+ SELECT phase_id, COUNT(*) as count
138
+ FROM activities
139
+ WHERE workflow_id = :workflowId
140
+ GROUP BY phase_id
141
+ ```
142
+
143
+ **Recent activities:**
144
+ ```sql
145
+ SELECT name, created, phase_id
146
+ FROM activities
147
+ WHERE workflow_id = :workflowId
148
+ ORDER BY created DESC
149
+ LIMIT 10
150
+ ```
151
+
152
+ **Activities with field filter:**
153
+ ```sql
154
+ SELECT * FROM activities
155
+ WHERE workflow_id = :workflowId
156
+ AND fields.status = 'active'
157
+ ```
158
+
159
+ **Join with users:**
160
+ ```sql
161
+ SELECT a.name, u.firstname, u.lastname
162
+ FROM activities a
163
+ JOIN users u ON a.created_by = u._id
164
+ WHERE a.workflow_id = :workflowId
165
+ ```
166
+
167
+ ---
168
+
169
+ ## Insight Object Structure
170
+
171
+ ```json
172
+ {
173
+ "_id": "insight_id",
174
+ "name": "Report Name",
175
+ "sql": "SELECT * FROM activities",
176
+ "cid": "workspace_id",
177
+ "public": false,
178
+ "publicKey": null,
179
+ "members": [
180
+ {"type": "user", "id": "user_id"},
181
+ {"type": "team", "id": "team_id"}
182
+ ],
183
+ "created": 1705123456789,
184
+ "modified": 1705123456789
185
+ }
186
+ ```
187
+
188
+ ---
189
+
190
+ ## Notes
191
+ - Parameters in SQL use `:paramName` syntax
192
+ - Pass params via options object when calling data endpoint
193
+ - Public insights can be accessed without authentication
194
+ - Insights are scoped to a workspace (networkId/cid)
195
+ - Member types: `user_<id>`, `team_<id>`, `group_<id>`, `network_<id>`