|
| 1 | +openapi: 3.0.0 |
| 2 | +info: |
| 3 | + title: polyproto chat APIs |
| 4 | + license: |
| 5 | + name: MIT License |
| 6 | + url: https://raw.githubusercontent.com/polyphony-chat/docs/refs/heads/main/LICENSE |
| 7 | + version: v0.1.0-alpha.0 |
| 8 | +tags: |
| 9 | + - name: Guild |
| 10 | +paths: |
| 11 | + /.p2/chat/v1/guilds: |
| 12 | + post: |
| 13 | + operationId: guilds_createGuild |
| 14 | + summary: Create new Guild |
| 15 | + parameters: [] |
| 16 | + responses: |
| 17 | + '201': |
| 18 | + description: The request has succeeded and a new resource has been created as a result. |
| 19 | + content: |
| 20 | + application/json: |
| 21 | + schema: |
| 22 | + $ref: '#/components/schemas/models.guild.Guild' |
| 23 | + '400': |
| 24 | + description: |- |
| 25 | + Invalid request submitted. Root causes may be: |
| 26 | +
|
| 27 | + - not including required body fields |
| 28 | + - a name or description that is too long or too short |
| 29 | + - inclusion of unexpected parameters. |
| 30 | +
|
| 31 | + A human readable reason will be returned as a response body. |
| 32 | + content: |
| 33 | + text/plain: |
| 34 | + schema: |
| 35 | + type: string |
| 36 | + '401': |
| 37 | + description: Access is unauthorized. |
| 38 | + '403': |
| 39 | + description: Access is forbidden. |
| 40 | + tags: |
| 41 | + - Guild |
| 42 | + requestBody: |
| 43 | + required: true |
| 44 | + content: |
| 45 | + application/json: |
| 46 | + schema: |
| 47 | + type: object |
| 48 | + properties: |
| 49 | + name: |
| 50 | + type: string |
| 51 | + description: |
| 52 | + type: string |
| 53 | + private: |
| 54 | + type: boolean |
| 55 | + required: |
| 56 | + - name |
| 57 | + - private |
| 58 | + security: |
| 59 | + - BearerAuth: [] |
| 60 | + get: |
| 61 | + operationId: guilds_getGuildInformation |
| 62 | + summary: Get Guild Information |
| 63 | + parameters: |
| 64 | + - name: guild_id |
| 65 | + in: query |
| 66 | + required: true |
| 67 | + schema: |
| 68 | + type: string |
| 69 | + explode: false |
| 70 | + responses: |
| 71 | + '201': |
| 72 | + description: The request has succeeded and a new resource has been created as a result. |
| 73 | + content: |
| 74 | + application/json: |
| 75 | + schema: |
| 76 | + $ref: '#/components/schemas/models.guild.Guild' |
| 77 | + '404': |
| 78 | + description: Guild is private or does not exist. |
| 79 | + tags: |
| 80 | + - Guild |
| 81 | + security: |
| 82 | + - BearerAuth: [] |
| 83 | +components: |
| 84 | + schemas: |
| 85 | + Version: |
| 86 | + type: string |
| 87 | + enum: |
| 88 | + - v0.1.0-alpha.0 |
| 89 | + models.EncryptedMessageData: |
| 90 | + type: object |
| 91 | + required: |
| 92 | + - data |
| 93 | + - dest_id |
| 94 | + properties: |
| 95 | + data: |
| 96 | + type: string |
| 97 | + dest_id: |
| 98 | + type: string |
| 99 | + description: |- |
| 100 | + "EncryptedMessageData" is encrypted message data with unencrypted metadata. The amount of |
| 101 | + metadata that is not encrypted is kept to an absolute minimum but is required, so that the |
| 102 | + server can know who to attempt to deliver the message to. |
| 103 | +
|
| 104 | + Namely, this unencrypted metadata is the `dest_id`, short for "destination identifer". |
| 105 | + This is the identifier of the channel, group or user to which the message should be |
| 106 | + delivered. |
| 107 | + models.actor.Actor: |
| 108 | + type: object |
| 109 | + required: |
| 110 | + - fid |
| 111 | + - availability |
| 112 | + properties: |
| 113 | + fid: |
| 114 | + type: string |
| 115 | + display_name: |
| 116 | + type: string |
| 117 | + pronouns: |
| 118 | + type: string |
| 119 | + about: |
| 120 | + type: string |
| 121 | + avatar: |
| 122 | + type: string |
| 123 | + format: uri |
| 124 | + availability: |
| 125 | + $ref: '#/components/schemas/models.actor.Availability' |
| 126 | + status: |
| 127 | + type: string |
| 128 | + timezone: |
| 129 | + type: string |
| 130 | + models.actor.Availability: |
| 131 | + type: number |
| 132 | + enum: |
| 133 | + - 0 |
| 134 | + - 1 |
| 135 | + - 2 |
| 136 | + - 3 |
| 137 | + models.channel.Channel: |
| 138 | + type: object |
| 139 | + required: |
| 140 | + - id |
| 141 | + - data |
| 142 | + properties: |
| 143 | + id: |
| 144 | + type: string |
| 145 | + data: |
| 146 | + anyOf: |
| 147 | + - $ref: '#/components/schemas/models.channel.ChannelData' |
| 148 | + - $ref: '#/components/schemas/models.EncryptedMessageData' |
| 149 | + models.channel.ChannelData: |
| 150 | + type: object |
| 151 | + required: |
| 152 | + - parent_id |
| 153 | + - type |
| 154 | + - position |
| 155 | + - name |
| 156 | + - description |
| 157 | + - permissions |
| 158 | + properties: |
| 159 | + parent_id: |
| 160 | + type: string |
| 161 | + type: |
| 162 | + type: integer |
| 163 | + format: uint8 |
| 164 | + position: |
| 165 | + type: integer |
| 166 | + format: uint32 |
| 167 | + name: |
| 168 | + type: string |
| 169 | + description: |
| 170 | + type: string |
| 171 | + permissions: |
| 172 | + type: string |
| 173 | + models.channel.ChannelType: |
| 174 | + type: number |
| 175 | + enum: |
| 176 | + - 1 |
| 177 | + - 2 |
| 178 | + - 3 |
| 179 | + models.guild.Guild: |
| 180 | + type: object |
| 181 | + required: |
| 182 | + - id |
| 183 | + - display_name |
| 184 | + - owner_id |
| 185 | + - created_at |
| 186 | + properties: |
| 187 | + id: |
| 188 | + type: string |
| 189 | + display_name: |
| 190 | + type: string |
| 191 | + description: |
| 192 | + type: string |
| 193 | + icon: |
| 194 | + type: string |
| 195 | + format: uri |
| 196 | + owner_id: |
| 197 | + type: string |
| 198 | + created_at: |
| 199 | + type: string |
| 200 | + format: date-time |
| 201 | + models.message.Embed: |
| 202 | + type: object |
| 203 | + required: |
| 204 | + - title |
| 205 | + - content |
| 206 | + properties: |
| 207 | + title: |
| 208 | + type: string |
| 209 | + subtitle: |
| 210 | + type: string |
| 211 | + color: |
| 212 | + type: string |
| 213 | + content: |
| 214 | + type: string |
| 215 | + attachments: |
| 216 | + type: array |
| 217 | + items: |
| 218 | + type: string |
| 219 | + format: uri |
| 220 | + models.message.Message: |
| 221 | + type: object |
| 222 | + required: |
| 223 | + - version |
| 224 | + - uid |
| 225 | + - author |
| 226 | + - content |
| 227 | + - timestamp |
| 228 | + - signature |
| 229 | + properties: |
| 230 | + version: |
| 231 | + type: integer |
| 232 | + format: uint64 |
| 233 | + uid: |
| 234 | + type: string |
| 235 | + author: |
| 236 | + type: string |
| 237 | + content: |
| 238 | + type: string |
| 239 | + timestamp: |
| 240 | + type: integer |
| 241 | + format: uint64 |
| 242 | + attachments: |
| 243 | + type: array |
| 244 | + items: |
| 245 | + type: string |
| 246 | + format: uri |
| 247 | + embeds: |
| 248 | + type: array |
| 249 | + items: |
| 250 | + $ref: '#/components/schemas/models.message.Embed' |
| 251 | + reactions: |
| 252 | + type: array |
| 253 | + items: |
| 254 | + $ref: '#/components/schemas/models.message.Reaction' |
| 255 | + signature: |
| 256 | + type: string |
| 257 | + models.message.Reaction: |
| 258 | + type: object |
| 259 | + required: |
| 260 | + - emoji |
| 261 | + - fid |
| 262 | + properties: |
| 263 | + emoji: |
| 264 | + type: string |
| 265 | + fid: |
| 266 | + type: string |
| 267 | + securitySchemes: |
| 268 | + BearerAuth: |
| 269 | + type: http |
| 270 | + scheme: Bearer |
| 271 | +servers: |
| 272 | + - url: https://example.com |
| 273 | + description: Example endpoint |
| 274 | + variables: {} |
0 commit comments