Skip to content
Brennan Novak edited this page May 11, 2014 · 21 revisions

Mailpile URL map (autogenerated by mailpile/urlmap.py)

The URL space is divided into three main classes:

  1. Versioned API endpoints
  2. Nice looking shortcuts to common data
  3. Shorthand paths to API endpoints (current version only)

Depending on the endpoint, it is often possible to request alternate rendering templates or generate output in a variety of machine readable formats, such as JSON, XML or VCard. This is done by appending a psuedo-filename to the path. If ending in .html, the full filename is used to choose an alternate rendering template, for other extensions the name is ignored but the extension used to choose an output format.

The default rendering for API endpoints is JSON, for other endpoints it is HTML. It is strongly recommended that only the versioned API endpoints be used for automation.

The API paths (version=0, JSON output)

GET (also accept POST)

/api/0/contact/           [<email>]/
/api/0/contact/add/       <msgs>/
                          ?@contactemail=[e-mail address]&@contactname=[Contact name]
/api/0/contact/import/    [<parameters>]/
/api/0/contact/importers/
/api/0/contact/list/      [--lines]/[<terms>]/
                          ?q=[search terms]&count=[how many to display (default=40)]&offset=[skip how many in the display (default=0)]&format=[lines or mpCard (default)]
/api/0/crypto/gpg/searchkey/<terms>/
                            ?q=[search terms]
/api/0/eventlog/          [incomplete]/[wait]/[<count>]/[<field>=<val>/...]/
                          ?private_data=[var:value]&source=[source class]&flag=[require a flag]&flags=[match all flags]&since=[wait for new data?]&data=[var:value]&incomplete=[incomplete events only?]&wait=[wait for new data?]
/api/0/filter/list/       [<search>|=<id>|@<type>]/
/api/0/help/              [<command-group>]/
/api/0/help/splash/
/api/0/help/urlmap/
/api/0/help/variables/
/api/0/jsapi/
/api/0/message/           [raw]/<message>/
                          ?mid=[metadata-ID]
/api/0/message/download/  <msgs>/<att>/[><fn>]/
/api/0/message/draft/     [<messages>]/
                          ?mid=[metadata-ID]
/api/0/page/
/api/0/plugins/           [<plugins>]/
/api/0/plugins/disable/   <plugin>/
/api/0/plugins/load/      <plugin>/
/api/0/search/            [@<start>]/<terms>/
                          ?qr=[search refinements]&end=[end position]&q=[search terms]&start=[start position]&full=[return all metadata]&order=[sort order]
/api/0/search/address/    [<terms>]/
                          ?q=[search terms]&count=[number of results]&offset=[offset results]
/api/0/settings/          <var>/
                          ?var=[section.variable]
/api/0/tag/list/          [<wanted>|!<wanted>]/[...]/

POST

/api/0/contact/add/       <msgs>/
                          ?@contactemail=[e-mail address]&@contactname=[Contact name]
/api/0/contact/addline/   <email>/<lines>/
/api/0/contact/remove/    <email>/
/api/0/crypto/gpg/importkey/<key_file>/
                            ?key_data=[Contents of public key to be imported]&key_file=[Location of file containing the public key]
/api/0/crypto/gpg/receivekey/<keyid>/
                             ?keyid=[ID of key to fetch]
/api/0/crypto/nicknym/getkey/<address>/[<keytype>]/[<server>]/
                             ?keytype=[What type of key to import (defaults to OpenPGP)]&server=[The Nicknym server to use (defaults to autodetect)]&address=[The nick/address to fetch a key for]
/api/0/crypto/nicknym/refreshkeys/
/api/0/message/attach/    <messages>/[<path/to/file>]/
... POST only: file-data=[file data]&mid=[metadata-ID]
/api/0/message/compose/   [ephemeral]/
... POST only: body=[..]&to=[..]&from=[..]&cc=[..]&encryption=[..]&bcc=[..]&mid=[metadata-ID]&subject=[..]
/api/0/message/forward/   [att|ephemeral]/<messages>/
                          ?atts=[forward attachments]&ephemeral=[ephemerality]&mid=[metadata-ID]
/api/0/message/reply/     [all|ephemeral]/<messages>/
                          ?reply_all=[reply to all]&ephemeral=[ephemerality]&mid=[metadata-ID]
/api/0/message/send/      <messages>/[<emails>]/
... POST only: to=[recipients]&mid=[metadata-ID]
/api/0/message/unthread/
... POST only: mid=[message-id]
/api/0/message/update/    <messages>/<<filename>/
... POST only: body=[..]&file-data=[file data]&from=[..]&cc=[..]&encryption=[..]&mid=[metadata-ID]&bcc=[..]&to=[..]&subject=[..]
/api/0/message/update/send/
... POST only: body=[..]&file-data=[file data]&from=[..]&cc=[..]&encryption=[..]&mid=[metadata-ID]&bcc=[..]&to=[..]&subject=[..]
/api/0/settings/add/      <section.variable>/<value>/
... POST only: section.variable=[value|json-string]
/api/0/settings/set/      <section.variable>/<value>/
... POST only: section.variable=[value|json-string]
/api/0/settings/unset/    <var>/
... POST only: var=[section.variables]
/api/0/tag/               <[+|-]tags>/<msgs>/
... POST only: add=[tags]&del=[tags]&mid=[message-ids]
/api/0/tag/add/           <tag>/
... POST only: parent=[parent tag ID]&label_color=[label color]&name=[tag name]&template=[tag template type]&display=[tag display type]&label=[display as label in search results, or not]&search_terms=[magic search terms associated with this tag]&slug=[tag slug]&icon=[tag icon]
/api/0/tag/delete/        <tag>/

UPDATE

/api/0/contact/addline/   <email>/<lines>/
/api/0/message/attach/    <messages>/[<path/to/file>]/
... POST only: file-data=[file data]&mid=[metadata-ID]
/api/0/message/unthread/
... POST only: mid=[message-id]
/api/0/message/update/    <messages>/<<filename>/
... POST only: body=[..]&file-data=[file data]&from=[..]&cc=[..]&encryption=[..]&mid=[metadata-ID]&bcc=[..]&to=[..]&subject=[..]
/api/0/message/update/send/
... POST only: body=[..]&file-data=[file data]&from=[..]&cc=[..]&encryption=[..]&mid=[metadata-ID]&bcc=[..]&to=[..]&subject=[..]
/api/0/settings/add/      <section.variable>/<value>/
... POST only: section.variable=[value|json-string]
/api/0/settings/set/      <section.variable>/<value>/
... POST only: section.variable=[value|json-string]

DELETE

/api/0/contact/remove/    <email>/
/api/0/tag/delete/        <tag>/

Pretty shortcuts (HTML output)

/           Redirects to /in/inbox/ for now.  (FIXME)
/in/        Map /in/TAG_NAME/[@<pos>]/ to tag searches.
/static/    RESERVED FOR LATER.
/thread/    Map /thread/METADATA_ID/... to view or extract commands.

Default command URLs (HTML output)

These accept the same arguments as the API calls above.

/contact/
/contact/add/
/contact/addline/
/contact/import/
/contact/importers/
/contact/list/
/contact/remove/
/crypto/gpg/importkey/
/crypto/gpg/receivekey/
/crypto/gpg/searchkey/
/crypto/nicknym/getkey/
/crypto/nicknym/refreshkeys/
/eventlog/
/filter/list/
/help/
/help/splash/
/help/urlmap/
/help/variables/
/jsapi/
/message/
/message/attach/
/message/compose/
/message/download/
/message/draft/
/message/forward/
/message/reply/
/message/send/
/message/unthread/
/message/update/
/message/update/send/
/page/
/plugins/
/plugins/disable/
/plugins/load/
/search/
/search/address/
/settings/
/settings/add/
/settings/set/
/settings/unset/
/tag/
/tag/add/
/tag/delete/
/tag/list/

[?1034h

Clone this wiki locally