Storage
How much email each of your mailboxes holds.
An SDK signs every request with your key: Authentication. To sign one yourself, see Calling the API without an SDK.
On this page
storage.usage
Show how much mail each mailbox holds.
POST/v1/storage.usage
API token
Parameters
It takes no input: send an empty object.
Returns
data is an object with:
Photos saved on contacts, which belong to the person and not a mailbox.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.storage.usage();
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.storage.usage()
print(answer)
package main
import (
"context"
"fmt"
"log"
mailset "mailset.app/go"
)
func main() {
// Reads MAILSET_TOKEN from the environment.
client, err := mailset.NewClient()
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
answer, err := client.Storage.Usage(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println(answer)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.storage.usage
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->storage->usage();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Storage;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
Storage answer = mailset.storage().usage();
System.out.println(answer);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset.storage().usage().await?;
println!("{answer:?}");
curl https://mailset.app/v1/storage.usage \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{}}'
curl can’t sign a request. $TOKEN is your credential’s token, and $MS_TIME and $MS_PROOF sign this exact body: Calling the API without an SDK shows how.
mailset storage usage
{
"ok": true,
"data": {
"mailboxes": [
{
"address": "moc.elpmaxe@olleh",
"messages": 1,
"bytes": 20480
}
],
"contactPhotos": 1,
"bytes": 20480,
"messages": 1
}
}