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>
48 These methods are available if the daemon is started anonymously (without an explicit `-u USERNAME`).
49 Requests are sent to `/org/asamk/Signal`; requests related to individual accounts are sent to
50 `/org/asamk/Signal/_441234567890` where the + dialing code is replaced by an underscore (_).
51 Only `version()` is activated in single-user mode; the rest are disabled.
53 link() -> deviceLinkUri<s>::
54 link(newDeviceName<s>) -> deviceLinkUri<s>::
55 * newDeviceName : Name to give new device (defaults to "cli" if no name is given)
56 * deviceLinkUri : URI of newly linked device
58 Returns a URI of the form "tsdevice:/?uuid=...". This can be piped to a QR encoder to create a display that
59 can be captured by a Signal smartphone client. For example:
61 `dbus-send --session --dest=org.asamk.Signal --type=method_call --print-reply /org/asamk/Signal org.asamk.Signal.link string:"My secondary client"|tr '\n' '\0'|sed 's/.*string //g'|sed 's/\"//g'|qrencode -s10 -tANSI256`
65 listAccounts() -> accountList<as>::
66 * accountList : Array of all attached accounts in DBus object path form
70 register(number<s>, voiceVerification<b>) -> <>::
71 * number : Phone number
72 * voiceVerification : true = use voice verification; false = use SMS verification
74 Exceptions: Failure, InvalidNumber, RequiresCaptcha
76 registerWithCaptcha(number<s>, voiceVerification<b>, captcha<s>) -> <>::
77 * number : Phone number
78 * voiceVerification : true = use voice verification; false = use SMS verification
79 * captcha : Captcha string
81 Exceptions: Failure, InvalidNumber, RequiresCaptcha
83 verify(number<s>, verificationCode<s>) -> <>::
84 * number : Phone number
85 * verificationCode : Code received from Signal after successful registration request
87 Command fails if PIN was set after previous registration; use verifyWithPin instead.
89 Exception: Failure, InvalidNumber
91 verifyWithPin(number<s>, verificationCode<s>, pin<s>) -> <>::
92 * number : Phone number
93 * verificationCode : Code received from Signal after successful registration request
94 * pin : PIN you set with setPin command after verifying previous registration
96 Exception: Failure, InvalidNumber
98 version() -> version<s>::
99 * version : Version string of signal-cli
105 updateGroup(groupId<ay>, newName<s>, members<as>, avatar<s>) -> groupId<ay>::
106 * groupId : Byte array representing the internal group identifier
107 * newName : New name of group (empty if unchanged)
108 * members : String array of new members to be invited to group
109 * avatar : Filename of avatar picture to be set for group (empty if none)
111 Exceptions: AttachmentInvalid, Failure, InvalidNumber, GroupNotFound
113 updateProfile(name<s>, about<s>, aboutEmoji <s>, avatar<s>, remove<b>) -> <>::
114 updateProfile(givenName<s>, familyName<s>, about<s>, aboutEmoji <s>, avatar<s>, remove<b>) -> <>::
115 * name : Name for your own profile (empty if unchanged)
116 * givenName : Given name for your own profile (empty if unchanged)
117 * familyName : Family name for your own profile (empty if unchanged)
118 * about : About message for profile (empty if unchanged)
119 * aboutEmoji : Emoji for profile (empty if unchanged)
120 * avatar : Filename of avatar picture for profile (empty if unchanged)
121 * remove : Set to true if the existing avatar picture should be removed
126 setExpirationTimer(number<s>, expiration<i>) -> <>::
127 * number : Phone number of recipient
128 * expiration : int32 for the number of seconds before messages to this recipient disappear. Set to 0 to disable expiration.
132 setContactBlocked(number<s>, block<b>) -> <>::
133 * number : Phone number affected by method
134 * block : 0=remove block , 1=blocked
136 Messages from blocked numbers will no longer be forwarded via DBus.
138 Exceptions: InvalidNumber
140 setGroupBlocked(groupId<ay>, block<b>) -> <>::
141 * groupId : Byte array representing the internal group identifier
142 * block : 0=remove block , 1=blocked
144 Messages from blocked groups will no longer be forwarded via DBus.
146 Exceptions: GroupNotFound
148 joinGroup(inviteURI<s>) -> <>::
149 * inviteURI : String starting with https://signal.group which is generated when you share a group link via Signal App
153 quitGroup(groupId<ay>) -> <>::
154 * groupId : Byte array representing the internal group identifier
156 Note that quitting a group will not remove the group from the getGroupIds command, but set it inactive which can be tested with isMember()
158 Exceptions: GroupNotFound, Failure
160 isMember(groupId<ay>) -> active<b>::
161 * groupId : Byte array representing the internal group identifier
163 Note that this method does not raise an Exception for a non-existing/unknown group but will simply return 0 (false)
165 sendEndSessionMessage(recipients<as>) -> <>::
166 * recipients : Array of phone numbers
168 Exceptions: Failure, InvalidNumber, UntrustedIdentity
170 sendGroupMessage(message<s>, attachments<as>, groupId<ay>) -> timestamp<x>::
171 * message : Text to send (can be UTF8)
172 * 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)
173 * groupId : Byte array representing the internal group identifier
174 * timestamp : Can be used to identify the corresponding signal reply
176 Exceptions: GroupNotFound, Failure, AttachmentInvalid
178 sendContacts() -> <>::
180 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.
184 sendSyncRequest() -> <>::
186 Sends a synchronization request to the primary device (for group, contacts, ...). Only works if sent from a secondary device.
190 sendNoteToSelfMessage(message<s>, attachments<as>) -> timestamp<x>::
191 * message : Text to send (can be UTF8)
192 * 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)
193 * timestamp : Can be used to identify the corresponding signal reply
195 Exceptions: Failure, AttachmentInvalid
197 sendMessage(message<s>, attachments<as>, recipient<s>) -> timestamp<x>::
198 sendMessage(message<s>, attachments<as>, recipients<as>) -> timestamp<x>::
199 * message : Text to send (can be UTF8)
200 * 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)
201 * recipient : Phone number of a single recipient
202 * recipients : Array of phone numbers
203 * timestamp : Can be used to identify the corresponding signal reply
205 Depending on the type of the recipient field this sends a message to one or multiple recipients.
207 Exceptions: AttachmentInvalid, Failure, InvalidNumber, UntrustedIdentity
209 sendTyping(recipient<s>, stop<b>) -> <>::
210 * recipient : Phone number of a single recipient
211 * targetSentTimestamp : True, if typing state should be stopped
213 Exceptions: Failure, GroupNotFound, UntrustedIdentity
215 sendReadReceipt(recipient<s>, targetSentTimestamp<ax>) -> <>::
216 * recipient : Phone number of a single recipient
217 * targetSentTimestamp : Array of Longs to identify the corresponding signal messages
219 Exceptions: Failure, UntrustedIdentity
221 sendViewedReceipt(recipient<s>, targetSentTimestamp<ax>) -> <>::
222 * recipient : Phone number of a single recipient
223 * targetSentTimestamp : Array of Longs to identify the corresponding signal messages
225 Exceptions: Failure, UntrustedIdentity
227 sendGroupMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, groupId<ay>) -> timestamp<x>::
228 * emoji : Unicode grapheme cluster of the emoji
229 * remove : Boolean, whether a previously sent reaction (emoji) should be removed
230 * targetAuthor : String with the phone number of the author of the message to which to react
231 * targetSentTimestamp : Long representing timestamp of the message to which to react
232 * groupId : Byte array with base64 encoded group identifier
233 * timestamp : Long, can be used to identify the corresponding signal reply
235 Exceptions: Failure, InvalidNumber, GroupNotFound
237 sendMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, recipient<s>) -> timestamp<x>::
238 sendMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, recipients<as>) -> timestamp<x>::
239 * emoji : Unicode grapheme cluster of the emoji
240 * remove : Boolean, whether a previously sent reaction (emoji) should be removed
241 * targetAuthor : String with the phone number of the author of the message to which to react
242 * targetSentTimestamp : Long representing timestamp of the message to which to react
243 * recipient : String with the phone number of a single recipient
244 * recipients : Array of strings with phone numbers, should there be more recipients
245 * timestamp : Long, can be used to identify the corresponding signal reply
247 Depending on the type of the recipient(s) field this sends a reaction to one or multiple recipients.
249 Exceptions: Failure, InvalidNumber
251 sendGroupRemoteDeleteMessage(targetSentTimestamp<x>, groupId<ay>) -> timestamp<x>::
252 * targetSentTimestamp : Long representing timestamp of the message to delete
253 * groupId : Byte array with base64 encoded group identifier
254 * timestamp : Long, can be used to identify the corresponding signal reply
256 Exceptions: Failure, GroupNotFound
258 sendRemoteDeleteMessage(targetSentTimestamp<x>, recipient<s>) -> timestamp<x>::
259 sendRemoteDeleteMessage(targetSentTimestamp<x>, recipients<as>) -> timestamp<x>::
260 * targetSentTimestamp : Long representing timestamp of the message to delete
261 * recipient : String with the phone number of a single recipient
262 * recipients : Array of strings with phone numbers, should there be more recipients
263 * timestamp : Long, can be used to identify the corresponding signal reply
265 Depending on the type of the recipient(s) field this deletes a message with one or multiple recipients.
267 Exceptions: Failure, InvalidNumber
269 getContactName(number<s>) -> name<s>::
270 * number : Phone number
271 * 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
273 setContactName(number<s>,name<>) -> <>::
274 * number : Phone number
275 * name : Name to be set in contacts (in local storage with signal-cli)
277 getGroupIds() -> groupList<aay>::
278 groupList : Array of Byte arrays representing the internal group identifiers
280 All groups known are returned, regardless of their active or blocked status. To query that use isMember() and isGroupBlocked()
282 getGroupName(groupId<ay>) -> groupName<s>::
283 groupName : The display name of the group
284 groupId : Byte array representing the internal group identifier
286 Exceptions: None, if the group name is not found an empty string is returned
288 getGroupMembers(groupId<ay>) -> members<as>::
289 members : String array with the phone numbers of all active members of a group
290 groupId : Byte array representing the internal group identifier
292 Exceptions: None, if the group name is not found an empty array is returned
294 listNumbers() -> numbers<as>::
295 numbers : String array of all known numbers
297 This is a concatenated list of all defined contacts as well of profiles known (e.g. peer group members or sender of received messages)
299 getContactNumber(name<s>) -> numbers<as>::
300 * numbers : Array of phone number
301 * name : Contact or profile name ("firstname lastname")
303 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.
305 isContactBlocked(number<s>) -> state<b>::
306 * number : Phone number
307 * state : 1=blocked, 0=not blocked
309 Exceptions: None, for unknown numbers 0 (false) is returned
311 isGroupBlocked(groupId<ay>) -> state<b>::
312 * groupId : Byte array representing the internal group identifier
313 * state : 1=blocked, 0=not blocked
315 Exceptions: None, for unknown groups 0 (false) is returned
319 Removes registration PIN protection.
323 setPin(pin<s>) -> <>::
324 * pin : PIN you set after registration (resets after 7 days of inactivity)
326 Sets a registration lock PIN, to prevent others from registering your number.
330 version() -> version<s>::
331 * version : Version string of signal-cli
333 isRegistered() -> result<b>::
334 isRegistered(number<s>) -> result<b>::
335 isRegistered(numbers<as>) -> results<ab>::
336 * number : Phone number
337 * numbers : String array of phone numbers
338 * result : true=number is registered, false=number is not registered
339 * results : Boolean array of results
341 Exception: InvalidNumber for an incorrectly formatted phone number. For unknown numbers, false is returned, but no exception is raised. If no number is given, returns whether you are registered (presumably true).
343 addDevice(deviceUri<s>) -> <>::
344 * deviceUri : URI in the form of tsdevice:/?uuid=... Normally received from Signal desktop or smartphone app
346 Exception: InvalidUri
348 listDevices() -> devices<as>::
349 * devices : String array of linked devices
353 removeDevice(deviceId<i>) -> <>::
354 * deviceId : Device ID to remove, obtained from listDevices() command
358 updateDeviceName(deviceName<s>) -> <>::
359 * deviceName : New name
361 Set a new name for this device (main or linked).
365 uploadStickerPack(stickerPackPath<s>) -> url<s>::
366 * stickerPackPath : Path to the manifest.json file or a zip file in the same directory
367 * url : URL of sticker pack after successful upload
373 SyncMessageReceived (timestamp<x>, sender<s>, destination<s>, groupId<ay>,message<s>, attachments<as>)::
374 The sync message is received when the user sends a message from a linked device.
376 ReceiptReceived (timestamp<x>, sender<s>)::
377 * timestamp : Integer value that can be used to associate this e.g. with a sendMessage()
378 * sender : Phone number of the sender
380 This signal is sent by each recipient (e.g. each group member) after the message was successfully delivered to the device
382 MessageReceived(timestamp<x>, sender<s>, groupId<ay>, message<s>, attachments<as>)::
383 * timestamp : Integer value that is used by the system to send a ReceiptReceived reply
384 * sender : Phone number of the sender
385 * groupId : Byte array representing the internal group identifier (empty when private message)
386 * message : Message text
387 * 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
389 This signal is received whenever we get a private message or a message is posted in a group we are an active member
393 Send a text message (without attachment) to a contact::
394 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
396 Send a group message::
397 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
399 Print the group name corresponding to a groupId; the daemon runs on system bus, and was started without an explicit `-u USERNAME`::
400 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
404 Maintained by AsamK <asamk@gmx.de>, who is assisted by other open source contributors.
405 For more information about signal-cli development, see
406 <https://github.com/AsamK/signal-cli>.