JSON-RPC Methods¶
All methods are called via POST /rpc. account_id is always 1 on edge devices.
Parameters are positional arrays — not named objects.
Request format¶
get_config¶
Retrieve a configuration value.
Params: [account_id, key]
| Key | Returns |
|---|---|
"addr" |
Account e-mail address |
"displayname" |
Display name |
curl -s -X POST http://127.0.0.1:7200/rpc \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"get_config","params":[1,"addr"],"id":1}'
get_info¶
Technical account details map.
Params: [account_id]
Notable keys: deltachat_core_version, dbsize, blobdir, configured_addr, n_msgs_in_db.
get_connectivity¶
Network connectivity level.
Params: [account_id]
| Value | Meaning |
|---|---|
0 |
Not configured |
1–1999 |
Not connected |
2000–2999 |
Connecting |
3000–3999 |
Connected (working) |
4000+ |
Fully connected |
get_contact_ids¶
List contact IDs.
Params: [account_id, list_flags, query]
Use [1, 0, null] for all contacts.
get_chat_securejoin_qr_code¶
Generate an invite link / QR payload for a new peer.
Params: [account_id, chat_id]
Use null for 1:1 invite.
Returns: OPENPGP4FPR:… URL string.
secure_join¶
Accept an invite link and connect to a peer.
Params: [account_id, invite_link]
The link must come from a different account (the peer you want to connect to).
lookup_contact_id_by_addr¶
Find a contact by e-mail address.
Params: [account_id, addr]
Returns: u32 | null
create_chat_by_contact_id¶
Get or create a 1:1 chat.
Params: [account_id, contact_id]
Returns: u32 chat ID.
send_msg¶
Send a text or file message.
Params: [account_id, chat_id, MessageData]
Text message:
File message (after Privitty encryption):
Returns: u32 message ID.
privitty_send_file¶
Encrypt a file for a 1:1 chat.
Params: [account_id, chat_id, peer_contact_id, plaintext_path, allow_download, allow_forward, duration_minutes]
| Param | Type | Notes |
|---|---|---|
plaintext_path |
string | Absolute path on the daemon host |
allow_download |
bool | Recipient can save decrypted file |
allow_forward |
bool | Recipient can forward |
duration_minutes |
i32 | Access window; 0 = unlimited |
Requires active license.
Returns: PrivittySendFileResult:
{
"encrypted_path": "/data/report.csv.prv",
"plaintext_hash": "…",
"prv_file_hash": "…",
"file_pdu_b64": "…",
"otk_pdu_b64": "…",
"file_id": 42
}
Follow with send_msg using encrypted_path as the file attachment.
privitty_send_group_file¶
Encrypt a file for a group chat.
Params: [account_id, chat_id, plaintext_path, allow_download, allow_forward, duration_minutes]
Same result structure as privitty_send_file.
get_chat_contacts¶
List member contact IDs for a chat.
Params: [account_id, chat_id]
Returns: u32[] — includes 1 (self). Filter self to find the peer.
get_chatlist_entries¶
List chat IDs.
Params: [account_id, list_flags, query_string, query_contact_id]
Use [1, null, null, null] for all chats.
get_chatlist_items_by_entries¶
Fetch chat metadata for a list of IDs.
Params: [account_id, chat_ids[]]
Returns: map keyed by chat ID string with name, chatType, freshMessageCounter, etc.
chatType |
Meaning |
|---|---|
100 |
1:1 |
120 |
Group |
get_message_ids¶
List message IDs in a chat.
Params: [account_id, chat_id, info_only, add_daymarker]
Use [1, chat_id, false, false].
get_messages¶
Fetch message objects.
Params: [account_id, message_ids[]]
Key fields: id, chatId, fromId, text, timestamp, state, file, viewtype, sender.
state |
Meaning |
|---|---|
1 |
Fresh (unread) |
10 |
Pending |
20 |
Delivered to server |
26 |
Delivered to device |
28 |
Read |
privitty_get_file_id_by_path¶
Resolve a Privitty file ID from a .prv path.
Params: [account_id, file_path]
Used by revoke.
privitty_revoke_file_access¶
Revoke a peer's access to a sent file.
Params: [account_id, chat_id, file_id, peer_contact_id]
Requires active license.
Typical call sequences¶
Send text to new peer (by e-mail)¶
lookup_contact_id_by_addr(1, "peer@example.com")create_chat_by_contact_id(1, contact_id)send_msg(1, chat_id, {"text": "…"})
Send encrypted file (1:1)¶
lookup_contact_id_by_addr+create_chat_by_contact_id(if needed)get_chat_contacts(1, chat_id)→ find peer contact IDprivitty_send_file(1, chat_id, peer_id, "/data/file.csv", false, false, 60)send_msg(1, chat_id, {"file": "…prv", "viewtype": "File"})
Copy-paste curl versions: Curl Cookbook