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:
32 * <a> : Array of ... (comma-separated list)
33 * (...) : Struct (cannot be sent via `dbus-send`)
34 * <b> : Boolean (false|true) (boolean:)
35 * <i> : Signed 32-bit (int) integer (int32:)
36 * <o> : DBusPath object (objpath:)
37 * <s> : String (string:)
38 * <x> : Signed 64-bit (long) integer (int64:)
39 * <y> : Unsigned 8-bit (byte) integer (byte:)
40 * <> : no return value
42 The final parenthetical value (such as "boolean:") is the type indicator used by `dbus-send`.
44 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.
46 Phone numbers always have the format +<countrycode><regional number>
51 These methods are available if the daemon is started anonymously (without an explicit `-u USERNAME`).
52 Requests are sent to `/org/asamk/Signal`; requests related to individual accounts are sent to
53 `/org/asamk/Signal/_441234567890` where the + dialing code is replaced by an underscore (_).
54 Only `version()` is activated in single-user mode; the rest are disabled.
56 link() -> deviceLinkUri<s>::
57 link(newDeviceName<s>) -> deviceLinkUri<s>::
58 * newDeviceName : Name to give new device (defaults to "cli" if no name is given)
59 * deviceLinkUri : URI of newly linked device
61 Returns a URI of the form "tsdevice:/?uuid=...". This can be piped to a QR encoder to create a display that
62 can be captured by a Signal smartphone client. For example:
64 `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`
68 listAccounts() -> accountList<as>::
69 * accountList : Array of all attached accounts in DBus object path form
73 register(number<s>, voiceVerification<b>) -> <>::
74 * number : Phone number
75 * voiceVerification : true = use voice verification; false = use SMS verification
77 Exceptions: Failure, InvalidNumber, RequiresCaptcha
79 registerWithCaptcha(number<s>, voiceVerification<b>, captcha<s>) -> <>::
80 * number : Phone number
81 * voiceVerification : true = use voice verification; false = use SMS verification
82 * captcha : Captcha string
84 Exceptions: Failure, InvalidNumber, RequiresCaptcha
86 verify(number<s>, verificationCode<s>) -> <>::
87 * number : Phone number
88 * verificationCode : Code received from Signal after successful registration request
90 Command fails if PIN was set after previous registration; use verifyWithPin instead.
92 Exception: Failure, InvalidNumber
94 verifyWithPin(number<s>, verificationCode<s>, pin<s>) -> <>::
95 * number : Phone number
96 * verificationCode : Code received from Signal after successful registration request
97 * pin : PIN you set with setPin command after verifying previous registration
99 Exception: Failure, InvalidNumber
101 version() -> version<s>::
102 * version : Version string of signal-cli
108 updateGroup(groupId<ay>, newName<s>, members<as>, avatar<s>) -> groupId<ay>::
109 * groupId : Byte array representing the internal group identifier
110 * newName : New name of group (empty if unchanged)
111 * members : String array of new members to be invited to group
112 * avatar : Filename of avatar picture to be set for group (empty if none)
114 Exceptions: AttachmentInvalid, Failure, InvalidNumber, GroupNotFound
116 updateProfile(name<s>, about<s>, aboutEmoji <s>, avatar<s>, remove<b>) -> <>::
117 updateProfile(givenName<s>, familyName<s>, about<s>, aboutEmoji <s>, avatar<s>, remove<b>) -> <>::
118 * name : Name for your own profile (empty if unchanged)
119 * givenName : Given name for your own profile (empty if unchanged)
120 * familyName : Family name for your own profile (empty if unchanged)
121 * about : About message for profile (empty if unchanged)
122 * aboutEmoji : Emoji for profile (empty if unchanged)
123 * avatar : Filename of avatar picture for profile (empty if unchanged)
124 * remove : Set to true if the existing avatar picture should be removed
129 setExpirationTimer(number<s>, expiration<i>) -> <>::
130 * number : Phone number of recipient
131 * expiration : int32 for the number of seconds before messages to this recipient disappear. Set to 0 to disable expiration.
135 setContactBlocked(number<s>, block<b>) -> <>::
136 * number : Phone number affected by method
137 * block : 0=remove block , 1=blocked
139 Messages from blocked numbers will no longer be forwarded via DBus.
141 Exceptions: InvalidNumber
143 setGroupBlocked(groupId<ay>, block<b>) -> <>::
144 * groupId : Byte array representing the internal group identifier
145 * block : 0=remove block , 1=blocked
147 Messages from blocked groups will no longer be forwarded via DBus.
149 Exceptions: GroupNotFound
151 joinGroup(inviteURI<s>) -> <>::
152 * inviteURI : String starting with https://signal.group which is generated when you share a group link via Signal App
156 quitGroup(groupId<ay>) -> <>::
157 * groupId : Byte array representing the internal group identifier
159 Note that quitting a group will not remove the group from the getGroupIds command, but set it inactive which can be tested with isMember()
161 Exceptions: GroupNotFound, Failure
163 isMember(groupId<ay>) -> active<b>::
164 * groupId : Byte array representing the internal group identifier
166 Note that this method does not raise an Exception for a non-existing/unknown group but will simply return 0 (false)
168 sendEndSessionMessage(recipients<as>) -> <>::
169 * recipients : Array of phone numbers
171 Exceptions: Failure, InvalidNumber, UntrustedIdentity
173 sendGroupMessage(message<s>, attachments<as>, groupId<ay>) -> timestamp<x>::
174 * message : Text to send (can be UTF8)
175 * 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)
176 * groupId : Byte array representing the internal group identifier
177 * timestamp : Can be used to identify the corresponding signal reply
179 Exceptions: GroupNotFound, Failure, AttachmentInvalid
181 sendContacts() -> <>::
183 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.
187 sendSyncRequest() -> <>::
189 Sends a synchronization request to the primary device (for group, contacts, ...). Only works if sent from a secondary device.
193 sendNoteToSelfMessage(message<s>, attachments<as>) -> timestamp<x>::
194 * message : Text to send (can be UTF8)
195 * 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)
196 * timestamp : Can be used to identify the corresponding signal reply
198 Exceptions: Failure, AttachmentInvalid
200 sendMessage(message<s>, attachments<as>, recipient<s>) -> timestamp<x>::
201 sendMessage(message<s>, attachments<as>, recipients<as>) -> timestamp<x>::
202 * message : Text to send (can be UTF8)
203 * 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)
204 * recipient : Phone number of a single recipient
205 * recipients : Array of phone numbers
206 * timestamp : Can be used to identify the corresponding signal reply
208 Depending on the type of the recipient field this sends a message to one or multiple recipients.
210 Exceptions: AttachmentInvalid, Failure, InvalidNumber, UntrustedIdentity
212 sendTyping(recipient<s>, stop<b>) -> <>::
213 * recipient : Phone number of a single recipient
214 * targetSentTimestamp : True, if typing state should be stopped
216 Exceptions: Failure, GroupNotFound, UntrustedIdentity
219 sendReadReceipt(recipient<s>, targetSentTimestamp<ax>) -> <>::
220 * recipient : Phone number of a single recipient
221 * targetSentTimestamp : Array of Longs to identify the corresponding signal messages
223 Exceptions: Failure, UntrustedIdentity
225 sendGroupMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, groupId<ay>) -> timestamp<x>::
226 * emoji : Unicode grapheme cluster of the emoji
227 * remove : Boolean, whether a previously sent reaction (emoji) should be removed
228 * targetAuthor : String with the phone number of the author of the message to which to react
229 * targetSentTimestamp : Long representing timestamp of the message to which to react
230 * groupId : Byte array with base64 encoded group identifier
231 * timestamp : Long, can be used to identify the corresponding signal reply
233 Exceptions: Failure, InvalidNumber, GroupNotFound
235 sendMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, recipient<s>) -> timestamp<x>::
236 sendMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, recipients<as>) -> timestamp<x>::
237 * emoji : Unicode grapheme cluster of the emoji
238 * remove : Boolean, whether a previously sent reaction (emoji) should be removed
239 * targetAuthor : String with the phone number of the author of the message to which to react
240 * targetSentTimestamp : Long representing timestamp of the message to which to react
241 * recipient : String with the phone number of a single recipient
242 * recipients : Array of strings with phone numbers, should there be more recipients
243 * timestamp : Long, can be used to identify the corresponding signal reply
245 Depending on the type of the recipient(s) field this sends a reaction to one or multiple recipients.
247 Exceptions: Failure, InvalidNumber
249 sendGroupRemoteDeleteMessage(targetSentTimestamp<x>, groupId<ay>) -> timestamp<x>::
250 * targetSentTimestamp : Long representing timestamp of the message to delete
251 * groupId : Byte array with base64 encoded group identifier
252 * timestamp : Long, can be used to identify the corresponding signal reply
254 Exceptions: Failure, GroupNotFound
256 sendRemoteDeleteMessage(targetSentTimestamp<x>, recipient<s>) -> timestamp<x>::
257 sendRemoteDeleteMessage(targetSentTimestamp<x>, recipients<as>) -> timestamp<x>::
258 * targetSentTimestamp : Long representing timestamp of the message to delete
259 * recipient : String with the phone number of a single recipient
260 * recipients : Array of strings with phone numbers, should there be more recipients
261 * timestamp : Long, can be used to identify the corresponding signal reply
263 Depending on the type of the recipient(s) field this deletes a message with one or multiple recipients.
265 Exceptions: Failure, InvalidNumber
267 getContactName(number<s>) -> name<s>::
268 * number : Phone number
269 * 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
271 setContactName(number<s>,name<>) -> <>::
272 * number : Phone number
273 * name : Name to be set in contacts (in local storage with signal-cli)
275 getGroupIds() -> groupList<aay>::
276 groupList : Array of Byte arrays representing the internal group identifiers
278 All groups known are returned, regardless of their active or blocked status. To query that use isMember() and isGroupBlocked()
280 getGroupName(groupId<ay>) -> groupName<s>::
281 groupName : The display name of the group
282 groupId : Byte array representing the internal group identifier
284 Exceptions: None, if the group name is not found an empty string is returned
286 getGroupMembers(groupId<ay>) -> members<as>::
287 members : String array with the phone numbers of all active members of a group
288 groupId : Byte array representing the internal group identifier
290 Exceptions: None, if the group name is not found an empty array is returned
292 listNumbers() -> numbers<as>::
293 numbers : String array of all known numbers
295 This is a concatenated list of all defined contacts as well of profiles known (e.g. peer group members or sender of received messages)
297 getContactNumber(name<s>) -> numbers<as>::
298 * numbers : Array of phone number
299 * name : Contact or profile name ("firstname lastname")
301 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.
303 isContactBlocked(number<s>) -> state<b>::
304 * number : Phone number
305 * state : 1=blocked, 0=not blocked
307 Exceptions: None, for unknown numbers 0 (false) is returned
309 isGroupBlocked(groupId<ay>) -> state<b>::
310 * groupId : Byte array representing the internal group identifier
311 * state : 1=blocked, 0=not blocked
313 Exceptions: None, for unknown groups 0 (false) is returned
317 Removes registration PIN protection.
321 setPin(pin<s>) -> <>::
322 * pin : PIN you set after registration (resets after 7 days of inactivity)
324 Sets a registration lock PIN, to prevent others from registering your number.
328 version() -> version<s>::
329 * version : Version string of signal-cli
331 isRegistered() -> result<b>::
332 isRegistered(number<s>) -> result<b>::
333 isRegistered(numbers<as>) -> results<ab>::
334 * number : Phone number
335 * numbers : String array of phone numbers
336 * result : true=number is registered, false=number is not registered
337 * results : Boolean array of results
339 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).
341 addDevice(deviceUri<s>) -> <>::
342 * deviceUri : URI in the form of tsdevice:/?uuid=... Normally received from Signal desktop or smartphone app
344 Exception: InvalidUri
346 listDevices() -> devices<a(oxs)>::
347 * devices : Array of structs (objectPath, id, name)
348 ** objectPath : DBusPath representing the device's object path
349 ** id : Long representing the deviceId
350 ** name : String representing the device's name
354 removeDevice(deviceId<i>) -> <>::
355 * deviceId : Device ID to remove, obtained from listDevices() command
359 updateDeviceName(deviceName<s>) -> <>::
360 * deviceName : New name
362 Set a new name for this device (main or linked).
366 uploadStickerPack(stickerPackPath<s>) -> url<s>::
367 * stickerPackPath : Path to the manifest.json file or a zip file in the same directory
368 * url : URL of sticker pack after successful upload
372 submitRateLimitChallenge(challenge<s>, captcha<s>) -> <>::
373 * challenge : The challenge token taken from the proof required error.
374 * captcha : The captcha token from the solved captcha on the Signal website..
375 Can be used to lift some rate-limits by solving a captcha.
377 Exception: IOErrorException
380 SyncMessageReceived (timestamp<x>, sender<s>, destination<s>, groupId<ay>,message<s>, attachments<as>)::
381 The sync message is received when the user sends a message from a linked device.
383 ReceiptReceived (timestamp<x>, sender<s>)::
384 * timestamp : Integer value that can be used to associate this e.g. with a sendMessage()
385 * sender : Phone number of the sender
387 This signal is sent by each recipient (e.g. each group member) after the message was successfully delivered to the device
389 MessageReceived(timestamp<x>, sender<s>, groupId<ay>, message<s>, attachments<as>)::
390 * timestamp : Integer value that is used by the system to send a ReceiptReceived reply
391 * sender : Phone number of the sender
392 * groupId : Byte array representing the internal group identifier (empty when private message)
393 * message : Message text
394 * 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
396 This signal is received whenever we get a private message or a message is posted in a group we are an active member
400 Send a text message (without attachment) to a contact::
401 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
403 Send a group message::
404 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
406 Print the group name corresponding to a groupId; the daemon runs on system bus, and was started without an explicit `-u USERNAME`::
407 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
411 Maintained by AsamK <asamk@gmx.de>, who is assisted by other open source contributors.
412 For more information about signal-cli development, see
413 <https://github.com/AsamK/signal-cli>.