Live video on the AT Protocol
1{
2 "lexicon": 1,
3 "id": "place.stream.server.createWebhook",
4 "defs": {
5 "main": {
6 "type": "procedure",
7 "description": "Create a new webhook for receiving Streamplace events.",
8 "input": {
9 "encoding": "application/json",
10 "schema": {
11 "type": "object",
12 "required": ["url", "events"],
13 "properties": {
14 "url": {
15 "type": "string",
16 "format": "uri",
17 "description": "The webhook URL where events will be sent."
18 },
19
20 "events": {
21 "type": "array",
22 "items": {
23 "type": "string",
24 "enum": ["chat", "livestream", "follow", "mention"]
25 },
26 "description": "The types of events this webhook should receive."
27 },
28 "active": {
29 "type": "boolean",
30 "default": false,
31 "description": "Whether this webhook should be active upon creation."
32 },
33 "prefix": {
34 "type": "string",
35 "maxLength": 100,
36 "description": "Text to prepend to webhook messages."
37 },
38 "suffix": {
39 "type": "string",
40 "maxLength": 100,
41 "description": "Text to append to webhook messages."
42 },
43 "rewrite": {
44 "type": "array",
45 "items": {
46 "type": "ref",
47 "ref": "place.stream.server.defs#rewriteRule"
48 },
49 "description": "Text replacement rules for webhook messages."
50 },
51 "name": {
52 "type": "string",
53 "maxLength": 100,
54 "description": "A user-friendly name for this webhook."
55 },
56 "description": {
57 "type": "string",
58 "maxLength": 500,
59 "description": "A description of what this webhook is used for."
60 }
61 }
62 }
63 },
64 "output": {
65 "encoding": "application/json",
66 "schema": {
67 "type": "object",
68 "required": ["webhook"],
69 "properties": {
70 "webhook": {
71 "type": "ref",
72 "ref": "place.stream.server.defs#webhook"
73 }
74 }
75 }
76 },
77 "errors": [
78 {
79 "name": "InvalidUrl",
80 "description": "The provided webhook URL is invalid or unreachable."
81 },
82 {
83 "name": "DuplicateWebhook",
84 "description": "A webhook with this URL already exists for this user."
85 },
86 {
87 "name": "TooManyWebhooks",
88 "description": "The user has reached their maximum number of webhooks."
89 }
90 ]
91 }
92 }
93}