openapi.json 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. {
  2. "openapi": "3.0.0",
  3. "info": {
  4. "description": "## Retrieving objects\nThe HTTP GET method may be dereferenced against an object's `id` property to retrieve the activity.\nThe plugin supports HTTP content negotiation as defined in [RFC7231](https://tools.ietf.org/html/rfc7231) in every endpoint suffixed with .json .\nThe plugin always presents ActivityStreams object representation in response to every request.\nThe client MUST specify an `Accept` header with the `application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"` media type in order to retrieve the activity.\n\n## Selecting ranges\n\nFor most `GET` operations that return arrays, the query parameters `max_id` and `since_id` can be used to specify the range of IDs to return.\nAPI methods that return collections of items can return a `Link` header containing URLs for the `next` and `prev` pages.\nSee the [Link header RFC](https://tools.ietf.org/html/rfc5988) for more information.\n\n## Pretty output\n\nFor most operations if the `pretty` parameter is set a formated output will be generated (useful for learning about the API or debuging purposes).\n\n## Errors\n\nIf the request you make doesn't go through, the plugin will usually respond with an [Error](#error).\n\n___\n\n> **Note:** Some attributes in the payload can have ``null`` value and are marked as _nullable_ on the tables below. Attributes that are not nullable are guaranteed to return a valid value.",
  5. "version": "1.0.0",
  6. "title": "ActivityPub plugin for GNU Social",
  7. "contact": {
  8. "email": "diogo@fc.up.pt"
  9. },
  10. "license": {
  11. "name": "AGPLv3",
  12. "url": "https://git.gnu.io/gnu/GS-ActivityPub-plugin/blob/COPYING"
  13. }
  14. },
  15. "externalDocs": {
  16. "description": "For a complete definition of the objects and activities available click here.",
  17. "url": "https://git.gnu.io/gnu/GS-ActivityPub-plugin/doc/objects_and_activities.md"
  18. },
  19. "paths": {
  20. "/{nickname}": {
  21. "get": {
  22. "summary": "Fetching an Actor's profile",
  23. "description": "Returns a Profile.",
  24. "responses": {
  25. "200": {
  26. "description": "Returns a Profile",
  27. "content": {
  28. "application/json": {
  29. "schema": {
  30. "type": "array",
  31. "items": {
  32. "$ref": "#/components/schemas/Profile"
  33. }
  34. }
  35. }
  36. }
  37. }
  38. },
  39. "parameters": [
  40. {
  41. "name": "Content-Type",
  42. "in": "header",
  43. "required": true,
  44. "schema": {
  45. "type": "string",
  46. "default": "application/json"
  47. }
  48. },
  49. {
  50. "name": "Accept",
  51. "in": "header",
  52. "required": true,
  53. "schema": {
  54. "type": "string",
  55. "default": "application/activity+json"
  56. }
  57. }
  58. ]
  59. }
  60. },
  61. "/{nickname}/inbox.json": {
  62. "post": {
  63. "summary": "Actor Inbox endpoint",
  64. "description": "Allows the publish of activities with attention to a given Actor",
  65. "parameters": [
  66. {
  67. "name": "Content-Type",
  68. "in": "header",
  69. "required": true,
  70. "schema": {
  71. "type": "string",
  72. "default": "application/json"
  73. }
  74. },
  75. {
  76. "name": "Accept",
  77. "in": "header",
  78. "required": true,
  79. "schema": {
  80. "type": "string",
  81. "default": "application/activity+json"
  82. }
  83. }
  84. ],
  85. "responses": {
  86. "200": {
  87. "description": "Returns the same activity it received"
  88. }
  89. }
  90. }
  91. },
  92. "/{nickname}/liked.json": {
  93. "get": {
  94. "summary": "Liked Collection",
  95. "description": "Getting an Actor's Liked Collection",
  96. "parameters": [
  97. {
  98. "name": "Content-Type",
  99. "in": "header",
  100. "required": true,
  101. "schema": {
  102. "type": "string",
  103. "default": "application/json"
  104. }
  105. },
  106. {
  107. "name": "Accept",
  108. "in": "header",
  109. "required": true,
  110. "schema": {
  111. "type": "string",
  112. "default": "application/activity+json"
  113. }
  114. },
  115. {
  116. "name": "max_id",
  117. "in": "query",
  118. "required": false,
  119. "schema": {
  120. "type": "integer",
  121. "format": "int32"
  122. },
  123. "description": "Get a list of likes with ID less than this value",
  124. "format": "int32"
  125. },
  126. {
  127. "name": "since_id",
  128. "in": "query",
  129. "required": false,
  130. "schema": {
  131. "type": "integer",
  132. "format": "int32"
  133. },
  134. "description": "Get a list of likes with ID greater than this value"
  135. },
  136. {
  137. "name": "limit",
  138. "in": "query",
  139. "required": false,
  140. "schema": {
  141. "type": "integer",
  142. "format": "int32",
  143. "default": "40"
  144. },
  145. "description": "Maximum number of likes to get (Max 80)"
  146. }
  147. ],
  148. "responses": {
  149. "200": {
  150. "description": "Returns Actor's Liked Collection",
  151. "content": {
  152. "application/json": {
  153. "schema": {
  154. "type": "array",
  155. "items": {
  156. "$ref": "#/components/schemas/Liked Collection"
  157. }
  158. }
  159. }
  160. }
  161. }
  162. }
  163. }
  164. },
  165. "/{nickname}/followers.json": {
  166. "get": {
  167. "summary": "Followers Collection",
  168. "description": "Getting an Actor's Followers Collection",
  169. "parameters": [
  170. {
  171. "name": "Content-Type",
  172. "in": "header",
  173. "required": true,
  174. "schema": {
  175. "type": "string",
  176. "default": "application/json"
  177. }
  178. },
  179. {
  180. "name": "Accept",
  181. "in": "header",
  182. "required": true,
  183. "schema": {
  184. "type": "string",
  185. "default": "application/activity+json"
  186. }
  187. },
  188. {
  189. "name": "page",
  190. "in": "query",
  191. "required": false,
  192. "schema": {
  193. "type": "integer",
  194. "format": "int32",
  195. "default": "1"
  196. },
  197. "description": "Page index (starts in 1)"
  198. }
  199. ],
  200. "responses": {
  201. "200": {
  202. "description": "Returns Actor's Followers Collection",
  203. "content": {
  204. "application/json": {
  205. "schema": {
  206. "type": "array",
  207. "items": {
  208. "$ref": "#/components/schemas/Follow Collection"
  209. }
  210. }
  211. }
  212. }
  213. }
  214. }
  215. }
  216. },
  217. "/{nickname}/following.json": {
  218. "get": {
  219. "summary": "Following Collection",
  220. "description": "Getting an Actor's Following Collection",
  221. "parameters": [
  222. {
  223. "name": "Content-Type",
  224. "in": "header",
  225. "required": true,
  226. "schema": {
  227. "type": "string",
  228. "default": "application/json"
  229. }
  230. },
  231. {
  232. "name": "Accept",
  233. "in": "header",
  234. "required": true,
  235. "schema": {
  236. "type": "string",
  237. "default": "application/activity+json"
  238. }
  239. },
  240. {
  241. "name": "page",
  242. "in": "query",
  243. "required": false,
  244. "schema": {
  245. "type": "integer",
  246. "format": "int32",
  247. "default": "1"
  248. },
  249. "description": "Page index (starts in 1)"
  250. }
  251. ],
  252. "responses": {
  253. "200": {
  254. "description": "Returns Actor's Following Collection",
  255. "content": {
  256. "application/json": {
  257. "schema": {
  258. "type": "array",
  259. "items": {
  260. "$ref": "#/components/schemas/Follow Collection"
  261. }
  262. }
  263. }
  264. }
  265. }
  266. }
  267. }
  268. },
  269. "/inbox.json": {
  270. "post": {
  271. "summary": "SharedInbox endpoint",
  272. "description": "Allows the publish of activities",
  273. "parameters": [
  274. {
  275. "name": "Content-Type",
  276. "in": "header",
  277. "required": true,
  278. "schema": {
  279. "type": "string",
  280. "default": "application/json"
  281. }
  282. },
  283. {
  284. "name": "Accept",
  285. "in": "header",
  286. "required": true,
  287. "schema": {
  288. "type": "string",
  289. "default": "application/activity+json"
  290. }
  291. }
  292. ],
  293. "responses": {
  294. "200": {
  295. "description": "Returns the same activity it received"
  296. }
  297. }
  298. }
  299. }
  300. },
  301. "components": {
  302. "schemas": {
  303. "Note": {
  304. "type": "object",
  305. "required": [
  306. "@context",
  307. "id",
  308. "type",
  309. "actor",
  310. "published",
  311. "to",
  312. "cc",
  313. "content",
  314. "url",
  315. "reply_to",
  316. "is_local",
  317. "conversation",
  318. "attachment",
  319. "tag"
  320. ],
  321. "properties": {
  322. "@context": {
  323. "type": "string",
  324. "value": "https://www.w3.org/ns/activitystreams",
  325. "default": "https://www.w3.org/ns/activitystreams"
  326. },
  327. "id": {
  328. "description": "Notice's URI",
  329. "type": "string"
  330. },
  331. "type": {
  332. "description": "Notice's Type",
  333. "type": "string"
  334. },
  335. "actor": {
  336. "description": "URL of Notice owner profile page (can be remote)",
  337. "type": "string"
  338. },
  339. "published": {
  340. "description": "DateTime of notice creation",
  341. "type": "string",
  342. "format": "date-time"
  343. },
  344. "to": {
  345. "description": "To",
  346. "type": "string"
  347. },
  348. "cc": {
  349. "description": "CC",
  350. "type": "string"
  351. },
  352. "content": {
  353. "description": "Notice's Content in plain text",
  354. "type": "string"
  355. },
  356. "url": {
  357. "description": "Notice's URL",
  358. "type": "string"
  359. },
  360. "reply_to": {
  361. "description": "ID of the notice this replies",
  362. "type": "string"
  363. },
  364. "is_local": {
  365. "description": "true if local, false otherwise",
  366. "type": "string"
  367. },
  368. "conversation": {
  369. "description": "Notice conversation id",
  370. "type": "integer",
  371. "format": "int32"
  372. },
  373. "attachment": {
  374. "description": "Array of Attachments",
  375. "type": "Array of Attachments"
  376. },
  377. "tag": {
  378. "description": "Array of Tags",
  379. "type": "Array of Tags"
  380. }
  381. },
  382. "xml": {
  383. "name": "Note"
  384. }
  385. },
  386. "Image": {
  387. "type": "object",
  388. "required": [
  389. "@context",
  390. "type",
  391. "width",
  392. "height",
  393. "url"
  394. ],
  395. "properties": {
  396. "@context": {
  397. "type": "string",
  398. "value": "https://www.w3.org/ns/activitystreams",
  399. "default": "https://www.w3.org/ns/activitystreams"
  400. },
  401. "type": {
  402. "description": "Image",
  403. "type": "string"
  404. },
  405. "width": {
  406. "description": "Image's width",
  407. "type": "integer",
  408. "format": "int32"
  409. },
  410. "height": {
  411. "description": "Image's height",
  412. "type": "integer",
  413. "format": "int32"
  414. },
  415. "url": {
  416. "description": "Image URL",
  417. "type": "string"
  418. }
  419. },
  420. "xml": {
  421. "name": "Image"
  422. }
  423. },
  424. "Attachment": {
  425. "type": "object",
  426. "required": [
  427. "@context",
  428. "id",
  429. "mimetype",
  430. "url",
  431. "title"
  432. ],
  433. "properties": {
  434. "@context": {
  435. "type": "string",
  436. "value": "https://www.w3.org/ns/activitystreams",
  437. "default": "https://www.w3.org/ns/activitystreams"
  438. },
  439. "id": {
  440. "type": "integer",
  441. "format": "int32",
  442. "description": "Id of the Attachment"
  443. },
  444. "mimetype": {
  445. "type": "string",
  446. "description": "Mimetype"
  447. },
  448. "url": {
  449. "type": "string",
  450. "description": "URL of locally hosted version of the attachment"
  451. },
  452. "meta": {
  453. "type": "array",
  454. "description": "Attachment metadata:\n\nImages may contain *width*, *height*, *size*.",
  455. "items": {}
  456. },
  457. "title": {
  458. "type": "string",
  459. "description": "Attachment title"
  460. }
  461. },
  462. "xml": {
  463. "name": "Attachment"
  464. }
  465. },
  466. "Profile": {
  467. "type": "object",
  468. "required": [
  469. "@context",
  470. "id",
  471. "nickname",
  472. "is_local",
  473. "inbox",
  474. "outbox",
  475. "display_name",
  476. "followers",
  477. "followers_count",
  478. "following",
  479. "following_count",
  480. "liked",
  481. "liked_count",
  482. "summary",
  483. "url",
  484. "avatar"
  485. ],
  486. "properties": {
  487. "@context": {
  488. "type": "string",
  489. "value": "https://www.w3.org/ns/activitystreams",
  490. "default": "https://www.w3.org/ns/activitystreams"
  491. },
  492. "id": {
  493. "type": "string",
  494. "description": "Local URI"
  495. },
  496. "type": "Person",
  497. "nickname": {
  498. "type": "string",
  499. "description": "Actor's nickname"
  500. },
  501. "is_local": {
  502. "type": "boolean",
  503. "description": "True if local, false otherwise"
  504. },
  505. "inbox": {
  506. "type": "string",
  507. "description": "URL to Actor's inbox endpoint"
  508. },
  509. "sharedInbox": {
  510. "type": "string",
  511. "description": "URL to Actor's sharedInbox endpoint"
  512. },
  513. "outbox": {
  514. "type": "string",
  515. "description": "URL to Actor's outbox endpoint"
  516. },
  517. "display_name": {
  518. "type": "string",
  519. "description": "The Actor's display name"
  520. },
  521. "followers": {
  522. "type": "string",
  523. "description": "URL to Actor's followers collection"
  524. },
  525. "followers_count": {
  526. "type": "integer",
  527. "format": "int32",
  528. "description": "Total number of followers"
  529. },
  530. "following": {
  531. "type": "string",
  532. "description": "URL to Actor's following collection"
  533. },
  534. "following_count": {
  535. "type": "integer",
  536. "format": "int32",
  537. "description": "Total number of following"
  538. },
  539. "liked": {
  540. "type": "string",
  541. "description": "URL to Actor's Liked collection"
  542. },
  543. "liked_count": {
  544. "type": "integer",
  545. "format": "int32",
  546. "description": "Total number of favorites"
  547. },
  548. "summary": {
  549. "type": "string",
  550. "description": "Actor's biography"
  551. },
  552. "url": {
  553. "type": "string",
  554. "description": "URL of the Actor's profile page (can be remote)"
  555. },
  556. "avatar": {
  557. "type": "Image",
  558. "description": "Actor's avatar"
  559. }
  560. },
  561. "xml": {
  562. "name": "Profile"
  563. }
  564. },
  565. "Tag": {
  566. "type": "object",
  567. "required": [
  568. "@context",
  569. "name",
  570. "url"
  571. ],
  572. "properties": {
  573. "@context": {
  574. "type": "string",
  575. "value": "https://www.w3.org/ns/activitystreams",
  576. "default": "https://www.w3.org/ns/activitystreams"
  577. },
  578. "name": {
  579. "type": "string",
  580. "description": "The hashtag, not including the preceding #"
  581. },
  582. "url": {
  583. "type": "string",
  584. "description": "The URL of the hashtag"
  585. }
  586. },
  587. "xml": {
  588. "name": "Tag"
  589. }
  590. },
  591. "Liked Collection": {
  592. "type": "object",
  593. "required": [
  594. "@context",
  595. "id",
  596. "type",
  597. "totalItems",
  598. "orderedItems"
  599. ],
  600. "properties": {
  601. "@context": {
  602. "type": "string",
  603. "value": "https://www.w3.org/ns/activitystreams",
  604. "default": "https://www.w3.org/ns/activitystreams"
  605. },
  606. "id": {
  607. "type": "string",
  608. "description": "URL for current endpoint"
  609. },
  610. "type": {
  611. "type": "string",
  612. "description": "OrderedCollection"
  613. },
  614. "totalItems": {
  615. "type": "integer",
  616. "format": "int32",
  617. "description": "Total number of favorites"
  618. },
  619. "orderedItems": {
  620. "type": "Array of Notices",
  621. "description": "Array of Notices"
  622. }
  623. }
  624. },
  625. "Follow Collection": {
  626. "type": "object",
  627. "required": [
  628. "@context",
  629. "id",
  630. "type",
  631. "totalItems",
  632. "orderedItems"
  633. ],
  634. "properties": {
  635. "@context": {
  636. "type": "string",
  637. "value": "https://www.w3.org/ns/activitystreams",
  638. "default": "https://www.w3.org/ns/activitystreams"
  639. },
  640. "id": {
  641. "type": "string",
  642. "description": "URL for current endpoint"
  643. },
  644. "type": {
  645. "type": "string",
  646. "description": "OrderedCollection"
  647. },
  648. "totalItems": {
  649. "type": "integer",
  650. "format": "int32",
  651. "description": "Total number of items"
  652. },
  653. "prev": {
  654. "type": "string",
  655. "description": "Previous page URL"
  656. },
  657. "next": {
  658. "type": "string",
  659. "description": "Next page URL"
  660. },
  661. "orderedItems": {
  662. "type": "Array of string",
  663. "description": "The URL of each profile"
  664. }
  665. }
  666. }
  667. },
  668. "links": {},
  669. "callbacks": {}
  670. },
  671. "security": [],
  672. "servers": []
  673. }