2 vim:set ts=4 sw=4 tw=82 noet:
10 DBus API for signal-cli - A commandline and dbus interface for the Signal messenger
14 *signal-cli* [--verbose] [--config CONFIG] [-u USERNAME] [-o {plain-text,json}] daemon [--system]
16 *dbus-send* [--system | --session] [--print-reply] --type=method_call --dest="org.asamk.Signal" /org/asamk/Signal[/_<phonenum>] org.asamk.Signal.<method> [string:<string argument>] [array:<type>:<array argument>]
18 Note: when daemon was started without explicit `-u USERNAME`, the `dbus-send` command requires adding the phone number in `/org/asamk/Signal/_<phonenum>`.
22 See signal-cli (1) for details on the application.
24 This documentation handles the supported methods when running signal-cli as a DBus daemon.
26 The method are described as follows:
28 method(arg1<type>, arg2<type>, ...) -> return<type>
30 Where <type> is according to DBus specification:
34 * <aay> : Array of Byte Arrays
36 * <ax> : Array of signed 64 bit integer
38 * <x> : Signed 64 bit integer
39 * <> : no return value
41 Exceptions are the names of the Java Exceptions returned in the body field. They typically contain an additional message with details. All Exceptions begin with "org.asamk.Signal.Error." which is omitted here for better readability.
43 Phone numbers always have the format +<countrycode><regional number>
47 updateGroup(groupId<ay>, newName<s>, members<as>, avatar<s>) -> groupId<ay>::
48 * groupId : Byte array representing the internal group identifier
49 * newName : New name of group (empty if unchanged)
50 * members : String array of new members to be invited to group
51 * avatar : Filename of avatar picture to be set for group (empty if none)
53 Exceptions: AttachmentInvalid, Failure, InvalidNumber, GroupNotFound
55 updateProfile(newName<s>, about <s>, aboutEmoji <s>, avatar<s>, remove<b>) -> <>::
56 * newName : New name for your own profile (empty if unchanged)
57 * about : About message for profile (empty if unchanged)
58 * aboutEmoji : Emoji for profile (empty if unchanged)
59 * avatar : Filename of avatar picture for profile (empty if unchanged)
60 * remove : Set to 1 if the existing avatar picture should be removed
64 setContactBlocked(number<s>, block<b>) -> <>::
65 * number : Phone number affected by method
66 * block : 0=remove block , 1=blocked
68 Messages from blocked numbers will no longer be forwarded via DBus.
70 Exceptions: InvalidNumber
72 setGroupBlocked(groupId<ay>, block<b>) -> <>::
73 * groupId : Byte array representing the internal group identifier
74 * block : 0=remove block , 1=blocked
76 Messages from blocked groups will no longer be forwarded via DBus.
78 Exceptions: GroupNotFound
80 joinGroup(inviteURI<s>) -> <>::
81 * inviteURI : String starting with https://signal.group which is generated when you share a group link via Signal App
85 quitGroup(groupId<ay>) -> <>::
86 * groupId : Byte array representing the internal group identifier
88 Note that quitting a group will not remove the group from the getGroupIds command, but set it inactive which can be tested with isMember()
90 Exceptions: GroupNotFound, Failure
92 isMember(groupId<ay>) -> active<b>::
93 * groupId : Byte array representing the internal group identifier
95 Note that this method does not raise an Exception for a non-existing/unknown group but will simply return 0 (false)
97 sendEndSessionMessage(recipients<as>) -> <>::
98 * recipients : Array of phone numbers
100 Exceptions: Failure, InvalidNumber, UntrustedIdentity
102 sendGroupMessage(message<s>, attachments<as>, groupId<ay>) -> timestamp<x>::
103 * message : Text to send (can be UTF8)
104 * attachments : String array of filenames to send as attachments (passed as filename, so need to be readable by the user signal-cli is running under)
105 * groupId : Byte array representing the internal group identifier
106 * timestamp : Can be used to identify the corresponding signal reply
108 Exceptions: GroupNotFound, Failure, AttachmentInvalid
110 sendContacts() -> <>::
112 Sends a synchronization message with the local contacts list to all linked devices. This command should only be used if this is the primary device.
116 sendSyncRequest() -> <>::
118 Sends a synchronization request to the primary device (for group, contacts, ...). Only works if sent from a secondary device.
122 sendNoteToSelfMessage(message<s>, attachments<as>) -> timestamp<x>::
123 * message : Text to send (can be UTF8)
124 * attachments : String array of filenames to send as attachments (passed as filename, so need to be readable by the user signal-cli is running under)
125 * timestamp : Can be used to identify the corresponding signal reply
127 Exceptions: Failure, AttachmentInvalid
129 sendMessage(message<s>, attachments<as>, recipient<s>) -> timestamp<x>::
130 sendMessage(message<s>, attachments<as>, recipients<as>) -> timestamp<x>::
131 * message : Text to send (can be UTF8)
132 * attachments : String array of filenames to send as attachments (passed as filename, so need to be readable by the user signal-cli is running under)
133 * recipient : Phone number of a single recipient
134 * recipients : Array of phone numbers
135 * timestamp : Can be used to identify the corresponding signal reply
137 Depending on the type of the recipient field this sends a message to one or multiple recipients.
139 Exceptions: AttachmentInvalid, Failure, InvalidNumber, UntrustedIdentity
141 sendTyping(recipient<s>, stop<b>) -> <>::
142 * recipient : Phone number of a single recipient
143 * targetSentTimestamp : True, if typing state should be stopped
145 Exceptions: Failure, GroupNotFound, UntrustedIdentity
148 sendReadReceipt(recipient<s>, targetSentTimestamp<ax>) -> <>::
149 * recipient : Phone number of a single recipient
150 * targetSentTimestamp : Array of Longs to identify the corresponding signal messages
152 Exceptions: Failure, UntrustedIdentity
154 sendGroupMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, groupId<ay>) -> timestamp<x>::
155 * emoji : Unicode grapheme cluster of the emoji
156 * remove : Boolean, whether a previously sent reaction (emoji) should be removed
157 * targetAuthor : String with the phone number of the author of the message to which to react
158 * targetSentTimestamp : Long representing timestamp of the message to which to react
159 * groupId : Byte array with base64 encoded group identifier
160 * timestamp : Long, can be used to identify the corresponding signal reply
162 Exceptions: Failure, InvalidNumber, GroupNotFound
164 sendMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, recipient<s>) -> timestamp<x>::
165 sendMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, recipients<as>) -> timestamp<x>::
166 * emoji : Unicode grapheme cluster of the emoji
167 * remove : Boolean, whether a previously sent reaction (emoji) should be removed
168 * targetAuthor : String with the phone number of the author of the message to which to react
169 * targetSentTimestamp : Long representing timestamp of the message to which to react
170 * recipient : String with the phone number of a single recipient
171 * recipients : Array of strings with phone numbers, should there be more recipients
172 * timestamp : Long, can be used to identify the corresponding signal reply
174 Depending on the type of the recipient(s) field this sends a reaction to one or multiple recipients.
176 Exceptions: Failure, InvalidNumber
178 sendGroupRemoteDeleteMessage(targetSentTimestamp<x>, groupId<ay>) -> timestamp<x>::
179 * targetSentTimestamp : Long representing timestamp of the message to delete
180 * groupId : Byte array with base64 encoded group identifier
181 * timestamp : Long, can be used to identify the corresponding signal reply
183 Exceptions: Failure, GroupNotFound
185 sendRemoteDeleteMessage(targetSentTimestamp<x>, recipient<s>) -> timestamp<x>::
186 sendRemoteDeleteMessage(targetSentTimestamp<x>, recipients<as>) -> timestamp<x>::
187 * targetSentTimestamp : Long representing timestamp of the message to delete
188 * recipient : String with the phone number of a single recipient
189 * recipients : Array of strings with phone numbers, should there be more recipients
190 * timestamp : Long, can be used to identify the corresponding signal reply
192 Depending on the type of the recipient(s) field this deletes a message with one or multiple recipients.
194 Exceptions: Failure, InvalidNumber
196 getContactName(number<s>) -> name<s>::
197 * number : Phone number
198 * name : Contact's name in local storage (from the master device for a linked account, or the one set with setContactName); if not set, contact's profile name is used
200 setContactName(number<s>,name<>) -> <>::
201 * number : Phone number
202 * name : Name to be set in contacts (in local storage with signal-cli)
204 getGroupIds() -> groupList<aay>::
205 groupList : Array of Byte arrays representing the internal group identifiers
207 All groups known are returned, regardless of their active or blocked status. To query that use isMember() and isGroupBlocked()
209 getGroupName(groupId<ay>) -> groupName<s>::
210 groupName : The display name of the group
211 groupId : Byte array representing the internal group identifier
213 Exceptions: None, if the group name is not found an empty string is returned
215 getGroupMembers(groupId<ay>) -> members<as>::
216 members : String array with the phone numbers of all active members of a group
217 groupId : Byte array representing the internal group identifier
219 Exceptions: None, if the group name is not found an empty array is returned
221 listNumbers() -> numbers<as>::
222 numbers : String array of all known numbers
224 This is a concatenated list of all defined contacts as well of profiles known (e.g. peer group members or sender of received messages)
226 getContactNumber(name<s>) -> numbers<as>::
227 * numbers : Array of phone number
228 * name : Contact or profile name ("firstname lastname")
230 Searches contacts and known profiles for a given name and returns the list of all known numbers. May result in e.g. two entries if a contact and profile name is set.
232 isContactBlocked(number<s>) -> state<b>::
233 * number : Phone number
234 * state : 1=blocked, 0=not blocked
236 Exceptions: None, for unknown numbers 0 (false) is returned
238 isGroupBlocked(groupId<ay>) -> state<b>::
239 * groupId : Byte array representing the internal group identifier
240 * state : 1=blocked, 0=not blocked
242 Exceptions: None, for unknown groups 0 (false) is returned
246 Removes registration PIN protection.
250 setPin(pin<s>) -> <>::
251 * pin : PIN you set after registration (resets after 7 days of inactivity)
253 Sets a registration lock PIN, to prevent others from registering your number.
257 version() -> version<s>::
258 * version : Version string of signal-cli
260 isRegistred -> result<b>::
261 * result : Currently always returns 1=true
263 uploadStickerPack(stickerPackPath<s>) -> url<s>::
264 * stickerPackPath : Path to the manifest.json file or a zip file in the same directory
265 * url : URL of sticker pack after successful upload
271 SyncMessageReceived (timestamp<x>, sender<s>, destination<s>, groupId<ay>,message<s>, attachments<as>)::
272 The sync message is received when the user sends a message from a linked device.
274 ReceiptReceived (timestamp<x>, sender<s>)::
275 * timestamp : Integer value that can be used to associate this e.g. with a sendMessage()
276 * sender : Phone number of the sender
278 This signal is sent by each recipient (e.g. each group member) after the message was successfully delivered to the device
280 MessageReceived(timestamp<x>, sender<s>, groupId<ay>, message<s>, attachments<as>)::
281 * timestamp : Integer value that is used by the system to send a ReceiptReceived reply
282 * sender : Phone number of the sender
283 * groupId : Byte array representing the internal group identifier (empty when private message)
284 * message : Message text
285 * attachments : String array of filenames for the attachments. These files are located in the signal-cli storage and the current user needs to have read access there
287 This signal is received whenever we get a private message or a message is posted in a group we are an active member
291 Send a text message (without attachment) to a contact::
292 dbus-send --print-reply --type=method_call --dest="org.asamk.Signal" /org/asamk/Signal org.asamk.Signal.sendMessage string:"Message text goes here" array:string: string:+123456789
294 Send a group message::
295 dbus-send --session --print-reply --type=method_call --dest=org.asamk.Signal /org/asamk/Signal org.asamk.Signal.sendGroupMessage string:'The message goes here' array:string:'/path/to/attachmnt1','/path/to/attachmnt2' array:byte:139,22,72,247,116,32,170,104,205,164,207,21,248,77,185
297 Print the group name corresponding to a groupId; the daemon runs on system bus, and was started without an explicit `-u USERNAME`::
298 dbus-send --system --print-reply --type=method_call --dest='org.asamk.Signal' /org/asamk/Signal/_1234567890 org.asamk.Signal.getGroupName array:byte:139,22,72,247,116,32,170,104,205,164,207,21,248,77,185
302 Maintained by AsamK <asamk@gmx.de>, who is assisted by other open source contributors.
303 For more information about signal-cli development, see
304 <https://github.com/AsamK/signal-cli>.