Fetching Mail API

This endpoints return all mail under your account for domains that had enabled mailllog.

Endpoint

Root API URL: https://api.hanami.run/v1/mails

Query Params

  • domain: only find mail of this particular domain. If you aren't the owner of that domain, a 401 is returned.
  • status: can be 'sent', or 'spam'. Default is sent to only include email that pass spam filter.
  • limit: A limit on the number of objects to be returned, between 1 and 100. 20 by default.
  • after: A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the previous page of the list.
  • before A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include before=obj_bar in order to fetch the next page of the list.

Let's take an example we request mail and received 5 documents

  data: [
   {id: 4597, subject: "foo", ...},
   {id: 4592, subject: "foo", ...},
   {id: 4567, subject: "foo", ...},
   {id: 4566, subject: "foo", ...},
   {id: 4565, subject: "foo", ...},
  ]
Then we can fetch more by making a request and pass `before` like this:
  ?limit=5&before=4565
Which will return email before that id like this:
  data: [
   {id: 4560, subject: "foo", ...},
   {id: 4522, subject: "foo", ...},
   {id: 4501, subject: "foo", ...},
   {id: 4482, subject: "foo", ...},
   {id: 4480, subject: "foo", ...},
  ]
And if you want to load more, pass `?before=4480` and so one.