Skip to content

Curl Cookbook

Copy-paste HTTP commands for every Privitty Edge operation.
Replace host, chat IDs, and paths as needed.

Base URL: http://127.0.0.1:7200
Account ID: always 1

Set a helper to reduce repetition:

RPC='curl -s -X POST http://127.0.0.1:7200/rpc -H Content-Type:application/json'

Health

curl -s http://127.0.0.1:7200/health | jq .

Status

# Account e-mail address
$RPC -d '{"jsonrpc":"2.0","method":"get_config","params":[1,"addr"],"id":1}'

# Display name
$RPC -d '{"jsonrpc":"2.0","method":"get_config","params":[1,"displayname"],"id":2}'

# Technical info
$RPC -d '{"jsonrpc":"2.0","method":"get_info","params":[1],"id":3}'

# Connectivity (0=unconfigured, 4000+=connected)
$RPC -d '{"jsonrpc":"2.0","method":"get_connectivity","params":[1],"id":4}'

# Peer count
$RPC -d '{"jsonrpc":"2.0","method":"get_contact_ids","params":[1,0,null],"id":5}'

Invite a peer

$RPC -d '{"jsonrpc":"2.0","method":"get_chat_securejoin_qr_code","params":[1,null],"id":1}'

Share the returned URL with the remote operator.


Join a peer (accept invite)

$RPC -d '{"jsonrpc":"2.0","method":"secure_join","params":[1,"OPENPGP4FPR:…"],"id":1}'

Or pass the https://i.privittytech.com/#… short link.


Send a text message

$RPC -d '{"jsonrpc":"2.0","method":"send_msg","params":[1,7,{"text":"Batch complete"}],"id":1}'
# 1. Lookup contact
$RPC -d '{"jsonrpc":"2.0","method":"lookup_contact_id_by_addr","params":[1,"ops@example.com"],"id":1}'

# 2. Create chat (use contact_id from step 1)
$RPC -d '{"jsonrpc":"2.0","method":"create_chat_by_contact_id","params":[1,12],"id":2}'

# 3. Send (use chat_id from step 2)
$RPC -d '{"jsonrpc":"2.0","method":"send_msg","params":[1,7,{"text":"Batch complete"}],"id":3}'

Send an encrypted file

File must exist at the path inside the container (e.g. /data/report.csv).

# 1. Get peer contact ID from chat
$RPC -d '{"jsonrpc":"2.0","method":"get_chat_contacts","params":[1,7],"id":1}'

# 2. Encrypt file (peer_contact_id=12, 60 min access window)
$RPC -d '{"jsonrpc":"2.0","method":"privitty_send_file","params":[1,7,12,"/data/report.csv",false,false,60],"id":2}'

# 3. Deliver .prv attachment (use encrypted_path from step 2)
$RPC -d '{"jsonrpc":"2.0","method":"send_msg","params":[1,7,{"text":"Report attached","file":"/data/report.csv.prv","viewtype":"File"}],"id":3}'

License required

Steps 2–3 require an active license. See License Management.


List chats

# Get chat IDs
$RPC -d '{"jsonrpc":"2.0","method":"get_chatlist_entries","params":[1,null,null,null],"id":1}'

# Get chat details (replace [5,7,9] with IDs from above)
$RPC -d '{"jsonrpc":"2.0","method":"get_chatlist_items_by_entries","params":[1,[5,7,9]],"id":2}'

List messages

# Message IDs in chat 7
$RPC -d '{"jsonrpc":"2.0","method":"get_message_ids","params":[1,7,false,false],"id":1}'

# Fetch messages (replace IDs)
$RPC -d '{"jsonrpc":"2.0","method":"get_messages","params":[1,[84,85,86]],"id":2}'

Revoke file access

# 1. Load message to get .prv path
$RPC -d '{"jsonrpc":"2.0","method":"get_messages","params":[1,[42]],"id":1}'

# 2. Resolve file ID (use file path from message)
$RPC -d '{"jsonrpc":"2.0","method":"privitty_get_file_id_by_path","params":[1,"/path/to/file.prv"],"id":2}'

# 3. Revoke (chat_id=7, file_id=42, peer_contact_id=12)
$RPC -d '{"jsonrpc":"2.0","method":"privitty_revoke_file_access","params":[1,7,42,12],"id":3}'

SSE event stream

curl -N http://127.0.0.1:7200/events

See Example D · SSE Streaming for filtered Python/shell clients.


License (via CLI inside container)

docker exec privitty-edged \
  privitty-edge --accounts /var/lib/privitty license status

docker exec privitty-edged \
  privitty-edge --accounts /var/lib/privitty \
  license activate "https://license.privitty.com/v1/license/TOKEN"

See License Management.


End-to-end examples

Walkthrough Link
A · First boot examples/first-boot.md
B · Invite & send examples/invite-and-send.md
C · Send a file examples/send-file.md
D · SSE streaming examples/sse-streaming.md
E · License examples/license.md