4 * [Using the APIs](help/api)
8 Friendica provides the following specific endpoints.
10 Authentication is the same as described in [Using the APIs](help/api#Authentication).
14 These endpoints uses the [Friendica API entities](help/API-Entities).
18 ### GET api/friendica/events
20 Returns a list of [Event](help/API-Entities#Event) entities for the current logged in user.
24 - `since_id`: (optional) minimum event id for pagination
25 - `count`: maximum number of items returned, default 20
27 ### POST api/friendica/event_create
29 Create a new event for the current logged in user.
33 - `id` : (optional) id of event, event will be amended if supplied
34 - `name` : name of the event (required)
35 - `start_time` : start of the event (ISO), required
36 - `end_time` : (optional) end of the event, event is open end, if not supplied
37 - `desc` : (optional) description of the event
38 - `place` : (optional) location of the event
39 - `publish` : (optional) create message for event
40 - `allow_cid` : (optional) ACL-formatted list of allowed contact ids if private event
41 - `allow_gid` : (optional) ACL-formatted list of disallowed contact ids if private event
42 - `deny_cid` : (optional) ACL-formatted list of allowed group ids if private event
43 - `deny_gid` : (optional) ACL-formatted list of disallowed group ids if private event
45 ### POST api/friendica/event_delete
47 Delete event from calendar (not the message)
51 - `id` : id of event to be deleted
53 ### GET api/externalprofile/show
55 Returns a [Contact](help/API-Entities#Contact) entity for the provided profile URL.
59 - `profileurl`: Profile URL
61 ### GET api/statuses/public_timeline
63 Returns a list of public [Items](help/API-Entities#Item) posted on this node.
64 Equivalent of the local community page.
68 * `count`: Items per page (default: 20)
70 * `since_id`: minimum id
71 * `max_id`: maximum id
72 * `exclude_replies`: don't show replies (default: false)
73 * `conversation_id`: Shows all statuses of a given conversation.
74 * `include_entities`: "true" shows entities for pictures and links (Default: false)
76 #### Unsupported parameters
80 ### GET api/statuses/networkpublic_timeline
82 Returns a list of public [Items](help/API-Entities#Item) this node is aware of.
83 Equivalent of the global community page.
87 * `count`: Items per page (default: 20)
89 * `since_id`: minimum id
90 * `max_id`: maximum id
91 * `exclude_replies`: don't show replies (default: false)
92 * `conversation_id`: Shows all statuses of a given conversation.
93 * `include_entities`: "true" shows entities for pictures and links (Default: false)
95 ### GET api/statuses/replies
99 * `count`: Items per page (default: 20)
100 * `page`: page number
101 * `since_id`: minimum id
102 * `max_id`: maximum id
103 * `include_entities`: "true" shows entities for pictures and links (Default: false)
105 #### Unsupported parameters
109 * `contributor_details`
113 ### GET api/conversation/show
115 Unofficial Twitter command. It shows all direct answers (excluding the original post) to a given id.
119 * `id`: id of the post
120 * `count`: Items per page (default: 20)
121 * `page`: page number
122 * `since_id`: minimum id
123 * `max_id`: maximum id
124 * `include_entities`: "true" shows entities for pictures and links (Default: false)
126 #### Unsupported parameters
130 * `contributor_details`
132 ### GET api/statusnet/conversation
134 Alias of [`api/conversation/show`](#GET+api%2Fconversation%2Fshow).
136 ### GET api/statusnet/config
138 Returns the public Friendica node configuration.
140 ### GET api/gnusocial/config
142 Alias of [`api/statusnet/config`](#GET+api%2Fstatusnet%2Fconfig).
144 ### GET api/statusnet/version
146 Returns a fake static StatusNet protocol version.
148 ### GET api/gnusocial/version
150 Alias of [`api/statusnet/version`](#GET+api%2Fstatusnet%2Fversion).
154 ### POST api/friendica/activity/[verb]
156 Add or remove an activity from an item.
157 'verb' can be one of:
165 To remove an activity, prepend the verb with "un", eg. "unlike" or "undislike"
166 Attend verbs disable each other: that means that if "attendyes" was added to an item, adding "attendno" remove previous "attendyes".
167 Attend verbs should be used only with event-related items (there is no check at the moment).
189 ### GET api/direct_messages
191 Deprecated Twitter received direct message list endpoint.
195 * `count`: Items per page (default: 20)
196 * `page`: page number
197 * `since_id`: minimum id
198 * `max_id`: maximum id
199 * `getText`: Defines the format of the status field. Can be "html" or "plain"
200 * `include_entities`: "true" shows entities for pictures and links (Default: false)
201 * `friendica_verbose`: "true" enables different error returns (default: "false")
203 #### Unsupported parameters
207 ### GET api/direct_messages/all
209 Returns all [Private Messages](help/API-Entities#Private+message).
213 * `count`: Items per page (default: 20)
214 * `page`: page number
215 * `since_id`: minimum id
216 * `max_id`: maximum id
217 * `getText`: Defines the format of the status field. Can be "html" or "plain"
218 * `friendica_verbose`: "true" enables different error returns (default: "false")
220 ### GET api/direct_messages/conversation
222 Returns all replies of a single private message conversation. Returns [Private Messages](help/API-Entities#Private+message)
226 * `count`: Items per page (default: 20)
227 * `page`: page number
228 * `since_id`: minimum id
229 * `max_id`: maximum id
230 * `getText`: Defines the format of the status field. Can be "html" or "plain"
231 * `uri`: URI of the conversation
232 * `friendica_verbose`: "true" enables different error returns (default: "false")
234 ### GET api/direct_messages/sent
236 Deprecated Twitter sent direct message list endpoint. Returns [Private Messages](help/API-Entities#Private+message).
240 * `count`: Items per page (default: 20)
241 * `page`: page number
242 * `since_id`: minimum id
243 * `max_id`: maximum id
244 * `getText`: Defines the format of the status field. Can be "html" or "plain"
245 * `include_entities`: "true" shows entities for pictures and links (Default: false)
246 * `friendica_verbose`: "true" enables different error returns (default: "false")
249 ### POST api/direct_messages/new
251 Deprecated Twitter direct message submission endpoint.
255 * `user_id`: id of the user
256 * `screen_name`: screen name (for technical reasons, this value is not unique!)
257 * `text`: The message
258 * `replyto`: ID of the replied direct message
259 * `title`: Title of the direct message
261 ### POST api/direct_messages/destroy
263 Deprecated Twitter direct message deletion endpoint.
267 * `id`: id of the message to be deleted
268 * `include_entities`: optional, currently not yet implemented
269 * `friendica_parenturi`: optional, can be used for increased safety to delete only intended messages
270 * `friendica_verbose`: "true" enables different error returns (default: "false")
276 * JSON return as defined for Twitter API not yet implemented
277 * on friendica_verbose=true: JSON return {"result":"ok","message":"message deleted"}
282 * on friendica_verbose=true: different JSON returns {"result":"error","message":"xyz"}
284 ### GET api/friendica/direct_messages_setseen
288 * `id`: id of the message to be updated as seen
294 * JSON return `{"result": "ok", "message": "message set to seen"}`
298 * different JSON returns `{"result": "error", "message": "xyz"}`
301 ### GET api/friendica/direct_messages_search (GET; AUTH)
303 Returns [Private Messages](help/API-Entities#Private+message) matching the provided search string.
307 * `searchstring`: string for which the API call should search as '%searchstring%' in field 'body' of all messages of the authenticated user (caption ignored)
308 * `getText` (optional): `plain`|`html` If omitted, the title is prepended to the plaintext body in the `text` attribute of the private message objects.
309 * `getUserObjects` (optional): `true`|`false` If `false`, the `sender` and `recipient` attributes of the private message object are absent.
313 Returns only tested with JSON, XML might work as well.
317 * JSON return `{"success":"true", "search_results": array of found messages}`
318 * JSOn return `{"success":"false", "search_results": "nothing found"}`
322 * different JSON returns `{"result": "error", "message": "searchstring not specified"}`
326 ### GET api/friendica/group_show
328 Return all or a specified group of the user with the containing contacts as array.
332 * `gid`: optional, if not given, API returns all groups of the user
338 * `name`: name of the group
339 * `gid`: id of the group
340 * `user`: array of [Contacts](help/API-Entities#Contact)
342 ### POST api/friendica/group_create
344 Create the group with the posted array of contacts as members.
348 * `name`: name of the group to be created
352 JSON data as Array like the result of [GET api/friendica/group_show](#GET+api%2Ffriendica%2Fgroup_show):
356 * List of [Contacts](help/API-Entities#Contact)
362 * `success`: true if successfully created or reactivated
363 * `gid`: gid of the created group
364 * `name`: name of the created group
365 * `status`: "missing user" | "reactivated" | "ok"
366 * `wrong users`: array of users, which were not available in the contact table
368 ### POST api/friendica/group_update
370 Update the group with the posted array of contacts as members (post all members of the group to the call; function will remove members not posted).
374 * `gid`: id of the group to be changed
375 * `name`: name of the group to be changed
379 JSON data as array like the result of [GET api/friendica/group_show](#GET+api%2Ffriendica%2Fgroup_show):
383 * List of [Contacts](help/API-Entities#Contact)
389 * `success`: true if successfully updated
390 * `gid`: gid of the changed group
391 * `name`: name of the changed group
392 * `status`: "missing user" | "ok"
393 * `wrong users`: array of users, which were not available in the contact table
395 ### POST api/friendica/group_delete
397 Delete the specified group of contacts; API call need to include the correct gid AND name of the group to be deleted.
401 * `gid`: id of the group to be deleted
402 * `name`: name of the group to be deleted
408 * `success`: true if successfully deleted
409 * `gid`: gid of the deleted group
410 * `name`: name of the deleted group
411 * `status`: "deleted" if successfully deleted
412 * `wrong users`: empty array
416 ### GET api/friendica/notifications
418 Return last 50 [Notifications](help/API-Entities#Notification) for the current user, ordered by date with unseen item on top.
424 ### POST api/friendica/notifications/seen
426 Set notification as seen.
430 - `id`: id of the notification to set seen
434 If the note is linked to an item, returns an [Item](help/API-Entities#Item).
436 Otherwise, a success status is returned:
438 * `success` (json) | `<status>success</status>` (xml)
442 ### GET api/friendica/photo
444 Returns a [Photo](help/API-Entities#Photo).
448 * `photo_id`: Resource id of a photo.
449 * `scale`: (optional) scale value of the photo
451 Returns data of a picture with the given resource.
452 If 'scale' isn't provided, returned data include full url to each scale of the photo.
453 If 'scale' is set, returned data include image data base64 encoded.
455 possibile scale value are:
457 * 0: original or max size by server settings
458 * 1: image with or height at <= 640
459 * 2: image with or height at <= 320
460 * 3: thumbnail 160x160
461 * 4: Profile image at 300x300
462 * 5: Profile image at 80x80
463 * 6: Profile image at 48x48
465 An image used as profile image has only scale 4-6, other images only 0-3
474 "created": "date(YYYY-MM-DD HH:MM:SS)",
475 "edited": "date(YYYY-MM-DD HH:MM:SS)",
476 "title": "photo title",
477 "desc": "photo description",
478 "album": "album name",
479 "filename": "original file name",
483 "profile": "1 if is profile photo",
485 "<scale>": "url to image",
489 "datasize": "size in byte",
490 "data": "base64 encoded image data"
499 <created>date(YYYY-MM-DD HH:MM:SS)</created>
500 <edited>date(YYYY-MM-DD HH:MM:SS)</edited>
501 <title>photo title</title>
502 <desc>photo description</desc>
503 <album>album name</album>
504 <filename>original file name</filename>
505 <type>mime type</type>
506 <height>number</height>
507 <width>number</width>
508 <profile>1 if is profile photo</profile>
510 <link type="mime type" scale="scale number" href="image url"/>
516 ### GET api/friendica/photos/list
518 Returns the API user's [Photo List Items](help/API-Entities#Photo+List+Item).
528 "album": "album name",
529 "filename": "original file name",
530 "type": "image mime type",
531 "thumb": "url to thumb sized image"
540 <photos type="array">
541 <photo id="resource_id"
543 filename="original file name"
544 type="image mime type">
545 "url to thumb sized image"
551 ### POST api/friendica/photo/create
553 Alias of [`api/friendica/photo/update`](#POST+api%2Ffriendica%2Fphoto%2Fupdate)
555 ### POST api/friendica/photo/update
557 Saves data for the scales 0-2 to database (see above for scale description).
558 Call adds non-public entries to items table to enable authenticated contacts to comment/like the photo.
559 Client should pay attention to the fact that updated access rights are not transferred to the contacts. i.e. public photos remain publicly visible if they have been commented/liked before setting visibility back to a limited group.
560 Currently it is best to inform user that updating rights is not the right way to do this, and offer a solution to add photo as a new photo with the new rights instead.
564 * `photo_id` (optional): if specified the photo with this id will be updated
565 * `media` (optional): image data as base64, only optional if photo_id is specified (new upload must have media)
566 * `desc` (optional): description for the photo, updated when photo_id is specified
567 * `album`: name of the album to be deleted (always necessary)
568 * `album_new` (optional): can be used to change the album of a single photo if photo_id is specified
569 * `allow_cid`/`allow_gid`/`deny_cid`/`deny_gid` (optional):
570 - on create: empty string or omitting = public photo, specify in format ```<x><y><z>``` for private photo
571 - on update: keys need to be present with empty values for changing a private photo to public
577 * new photo uploaded: JSON return with photo data (see [GET api/friendica/photo](#GET+api%2Ffriendica%2Fphoto))
578 * photo updated - changed photo data: JSON return with photo data (see [GET api/friendica/photo](#GET+api%2Ffriendica%2Fphoto))
579 * photo updated - changed info: JSON return `{"result": "updated", "message":"Image id 'xyz' has been updated."}`
580 * photo updated - nothing changed: JSON return `{"result": "cancelled","message": "Nothing to update for image id 'xyz'."}`
584 * 403 FORBIDDEN: if not authenticated
585 * 400 BADREQUEST: "no albumname specified", "no media data submitted", "photo not available", "acl data invalid"
586 * 500 INTERNALSERVERERROR: "image size exceeds PHP config settings, file was rejected by server",
587 "image size exceeds Friendica Config setting (uploaded size: x)",
588 "unable to process image data",
589 "image upload failed",
590 "unknown error - uploading photo failed, see Friendica log for more information",
591 "unknown error - update photo entry in database failed",
592 "unknown error - this error on uploading or updating a photo should never happen"
594 ### POST api/friendica/photo/delete
596 Deletes a single image with the specified id, is not reversible -> ensure that client is asking user for being sure to do this
597 Sets item table entries for this photo to deleted = 1.
601 * `photo_id`: id of the photo to be deleted
612 "message": "photo with id 'xyz' has been deleted from server."
618 * 403 FORBIDDEN: if not authenticated
619 * 400 BADREQUEST: "no photo_id specified", "photo not available"
620 * 500 INTERNALSERVERERROR: "unknown error on deleting photo", "problem with deleting items occurred"
624 ### POST api/friendica/photoalbum/delete
626 Deletes all images with the specified album name, is not reversible -> ensure that client is asking user for being sure to do this.
630 * `album`: name of the album to be deleted
641 "message": "album 'xyz' with all containing photos has been deleted."
647 * 403 FORBIDDEN: if not authenticated
648 * 400 BADREQUEST: "no albumname specified", "album not available"
649 * 500 INTERNALSERVERERROR: "problem with deleting item occurred", "unknown error - deleting from database failed"
651 ### POST api/friendica/photoalbum/update
653 Changes the album name to album_new for all photos in album.
657 * `album`: name of the album to be updated
658 * `album_new`: new name of the album
669 "message":"album 'abc' with all containing photos has been renamed to 'xyz'."
675 * 403 FORBIDDEN: if not authenticated
676 * 400 BADREQUEST: "no albumname specified", "no new albumname specified", "album not available"
677 * 500 INTERNALSERVERERROR: "unknown error - updating in database failed"
679 ### GET api/friendica/photoalbums
681 Get a list of photo albums for the user
688 On success a list of photo album objects:
693 "name": "Wall Photos",
694 "created": "2023-01-22 02:03:19",
698 "name": "Profile photos",
699 "created": "2022-11-20 14:40:06",
705 ### GET api/friendica/photoalbum
707 Get a list of images in a photo album
710 * `album` (Required): name of the album to be deleted
711 * `limit` (Optional): Maximum number of items to get, defaults to 50, max 500
712 * `offset`(Optional): Offset in results to page through total items, defaults to 0
713 * `latest_first` (Optional): Reverse the order so the most recent images are first, defaults to false
719 * JSON return with the list of Photo items
722 `https://<server>/api/friendica/photoalbum?album=Wall Photos&limit=10&offset=2`
727 "created": "2023-02-14 14:31:06",
728 "edited": "2023-02-14 14:31:14",
731 "album": "Wall Photos",
732 "filename": "image.png",
742 "id": "899184972463eb9b2ae3dc2580502826",
749 "link": "https://<server>/photo/899184972463eb9b2ae3dc2580502826-0.png",
756 "thumb": "https://<server>/photo/899184972463eb9b2ae3dc2580502826-2.png"
765 ### GET api/friendica/profile/show
767 Returns the [Profile](help/API-Entities#Profile) data of the authenticated user.
771 On success: Array of:
773 * `global_dir`: URL of the global directory set in server settings
774 * `friendica_owner`: user data of the authenticated user
775 * `profiles`: array of the profile data
778 HTTP 403 Forbidden: when no authentication was provided
779 HTTP 400 Bad Request: if given profile_id is not in the database or is not assigned to the authenticated user
781 General description of profile data in API returns:
782 - hide_friends: true if friends are hidden
785 - publish: true if published on the server's local directory
786 - net_publish: true if published to global_dir
798 - custom_fields: list of public custom fields
802 ### POST api/friendica/statuses/:id/dislike
804 Marks the given status as disliked by this user
808 * `id`: the status ID that is being marked
812 A Mastodon [Status Entity](https://docs.joinmastodon.org/entities/Status/)
815 `https://<server_name>/api/friendica/statuses/341/dislike`
820 "created_at": "2023-02-23T01:50:00.000Z",
821 "in_reply_to_id": null,
822 "in_reply_to_status": null,
823 "in_reply_to_account_id": null,
826 "visibility": "public",
831 "username": "testuser2",
834 "media_attachments": [],
849 ### GET api/friendica/statuses/:id/disliked_by
851 Returns the list of accounts that have disliked the status as known by the current server
855 * `id`: the status ID that is being marked
859 A list of [Mastodon Account](https://docs.joinmastodon.org/entities/Account/) objects
860 in the body and next/previous link headers in the header
863 `https://<server_name>/api/friendica/statuses/341/disliked_by`
869 "username": "testuser1",
877 ### POST api/friendica/statuses/:id/undislike
879 Removes the dislike mark (if it exists) on this status for this user
883 * `id`: the status ID that is being marked
887 A Mastodon [Status Entity](https://docs.joinmastodon.org/entities/Status/)
890 `https://<server_name>/api/friendica/statuses/341/undislike`
895 "created_at": "2023-02-23T01:50:00.000Z",
896 "in_reply_to_id": null,
897 "in_reply_to_status": null,
898 "in_reply_to_account_id": null,
901 "visibility": "public",
906 "username": "testuser2",
909 "media_attachments": [],
925 ## Deprecated endpoints
927 - POST api/statuses/mediap