Paper key

Paper key

The org’s way back in when every passkey is lost.

An SDK signs every request with your key: Authentication. To sign one yourself, see Calling the API without an SDK.

On this page
  1. paperkey.status
  2. paperkey.rotate

paperkey.status

Show whether the org’s paper key needs replacing.

POST/v1/paperkey.status

Owner

Parameters

It takes no input: send an empty object.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

Returns

data is an object with:

  • fingerprintnullable string

    Enough to compare with the paper. Null: the org has no paper key.

  • neededSincenullable number

    When an owner left. Null: nothing asks for a new key.

  • rotatingboolean
  • donenumber
  • totalnumber

In the CLIErrors

import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.paperkey.status();
console.log(answer);
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.paperkey.status()
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.Paperkey.Status(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.paperkey.status
p answer
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->paperkey->status();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.PaperKeyStatus;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

PaperKeyStatus answer = mailset.paperkey().status();
System.out.println(answer);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.paperkey().status().await?;
println!("{answer:?}");
curl https://mailset.app/v1/paperkey.status \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{},"org":"org_3f9a1c0e7b2d"}'

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 paperkey status
Response
{
  "ok": true,
  "data": {
    "fingerprint": "text",
    "neededSince": 1796048940000,
    "rotating": true,
    "done": 1,
    "total": 12
  }
}

paperkey.rotate

Replace the org’s paper key. The CLI makes the new one and shows it once.

POST/v1/paperkey.rotate

OwnerPasskey

Parameters

  • recipientstringrequired

    The new paper key’s public half. The CLI makes the key and sends only this.

    At most 200 characters.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

  • approvalstringoptional

    An approval’s id, once someone approved it with their passkey. Without one, the answer is step_up_required and names what to approve.

Returns

data is an object with:

  • fingerprintnullable string

    Enough to compare with the paper. Null: the org has no paper key.

  • neededSincenullable number

    When an owner left. Null: nothing asks for a new key.

  • rotatingboolean
  • donenumber
  • totalnumber

In the CLIErrors

import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.paperkey.rotate({
	recipient: "<recipient>",
});
console.log(answer);
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.paperkey.rotate(
    {"recipient": "<recipient>"}
)
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()
	params := &mailset.PaperkeyRotateParams{
		Recipient: "<recipient>",
	}
	answer, err := client.Paperkey.Rotate(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.paperkey.rotate(recipient: '<recipient>')
p answer
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->paperkey->rotate([
    'recipient' => '<recipient>',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.PaperKeyStatus;
import app.mailset.model.PaperkeyRotateParams;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = PaperkeyRotateParams.builder()
        .recipient("<recipient>")
        .build();
PaperKeyStatus answer = mailset.paperkey().rotate(params);
System.out.println(answer);
use mailset::types::PaperkeyRotateParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .paperkey()
    .rotate(PaperkeyRotateParams {
        recipient: "<recipient>".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/paperkey.rotate \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"recipient":"<recipient>"},"org":"org_3f9a1c0e7b2d"}'

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 paperkey rotate --out acme-paper-key.txt
Response
{
  "ok": true,
  "data": {
    "fingerprint": "text",
    "neededSince": 1796048940000,
    "rotating": true,
    "done": 1,
    "total": 12
  }
}