pub.techne.draft.identity.manageMethods

The identity PDS's signed hook for the sign-in method rules (the account page and sign-in page call it; the rules live on the platform so every client obeys the same ones). Authenticated only by the epds-signature MAC with the identity hook secret; no session, OAuth or service-JWT caller reaches it, and every answer is signed. The PDS vouches for the signed-in account (`did`, which must be hosted on the calling PDS, else 404 UnknownAccount) and for the step-up it just checked (`stepUp`: which method, when; it counts for 10 minutes). Rules: a recovery method acting with a fresh step-up acts at once; anything else removes a method or deletes the account after a 7-day wait with an email notice, if it has any email method, cancellable by any of the account's methods, a frozen one too (`cancel`); a wait re-checks these rules when it runs out (a method marked for recovery meanwhile is not removed; a first mark is dropped once another method is marked; a wait during which any of the account's methods was frozen, even if a recovery method lifted the freeze early or removed the method, is dropped, not completed, since a frozen method can't sign in to cancel it, and every email method gets a `waitDropped` notice naming the change); a freeze is immediate, from a different method with a fresh step-up, and lasts 7 days or until a recovery method lifts it (`unfreeze`); a recovery method is never frozen, removed or unmarked by an unmarked one; the last way to sign in is never removed; marking a recovery method needs a fresh step-up of one, except the account's first, which needs a fresh step-up of any of its methods (else StepUpRequired) and waits 24 hours with an email notice, if the account has any email method. Notices are email only: the platform sends every one itself, wherever the account is hosted, to each of the account's email methods (never by phone or Nostr); the PDS sends none. Ops: `list` (the account's methods, each email and phone also with its full `value` for the owner's own account page, pending changes (an open `moveMethod` onto the account included), `hasRecovery`, and `person`, the other accounts of its person), `signInMethods` (for a sign-in page that knows only the account, "Sign in as @handle": the methods that can sign in now, each a masked `display` for any page and a masked `displayDevice` for the PDS's chooser of the accounts already signed in on that browser, never its full value; no step-up, recovery marks or pending changes), `sendTo` (the full email or phone of one of them, for the PDS to send a sign-in code to; never shown), `remove`, `cancel`, `freeze` (with `signOut`), `unfreeze`, `mark`, `unmark`, `signOut` (sign out everywhere the platform holds a session; the PDS revokes its own), `delete`, `addExternal` (a passkey or Nostr key the PDS proved; always a fresh step-up of one of the account's methods, StepUpRequired without one, and never a program's, ProgramRefused), `newRecoveryCodes` (returned once; a new set ends the old; always a fresh step-up, and on an account with no recovery method the set is its first mark, which waits 24 hours; a first set is refused, MethodFrozen, while one of the account's methods is frozen), `redeemCode`, `setPrograms` ("Programs can sign in with this key" on or off, `on`, for a Nostr key, the only type that supports it: on and off both need a fresh step-up of one of the account's methods that is not a program, not frozen (a step-up by a key with programs on is ProgramRefused, so that key never switches itself off); on is also refused from the key itself, SameMethod, for a recovery method or one whose first mark is waiting, IsRecovery, and while a method of the account is frozen, MethodFrozen), `addChannel` (a `channel` the PDS just proved for `did`, as identity.finishAddMethod does for a session: `added`, `alreadyYours`, or `boundElsewhere`: when both accounts hold something, with the `other` account and its `method` (the account page offers `moveMethod`), else with a fold `offer` (identity.finishAddMethod#offer), single use, 10 minutes, bound to `did` on this hook and to no session; MethodFrozen when the channel is frozen on any account, MethodFrozen when `did` itself has a frozen method and the channel would be new to it (no method is added past a freeze; `addExternal` likewise), and, on the fold path only (one of the two accounts holds nothing, so an `offer` would be made), ProtectedAccount when either account has a recovery mark, a freeze, a pending change, or a passkey, Nostr key or recovery codes; when both hold something the answer names `other` and `method` and moveMethod's own refusals apply), `fold` (take that offer: `token`; needs a fresh step-up of `did`; ProtectedAccount (a live freeze included) and NotEmpty, checked again; `folded` with the kept `did` and the `emptied` one, which is deleted (on the identity PDS too, by `dueDeletes`)), `moveMethod` (link two accounts: move an email or phone method of account `from` onto `did` and make the two accounts one person, every DID of each linked to every other in `alsoKnownAs`; needs a fresh step-up of `did` and one of `from` (`fromStepUp`, else FromStepUpRequired); refused, nothing scheduled, when a method of either person is frozen (Frozen), either has a pending change (PendingChange), the person would hold more than 4 accounts (TooMany), the two are already one person or the same account (Same), or no key can write `alsoKnownAs` for one of their DIDs (NoKey); a method marked for recovery on `from` moves only with a `fromStepUp` of a recovery method of `from` (RecoveryProtected); it is never done inside the call: the answer is `pending` (the change, a pending change of `from`, as a defs#pendingChange as `did`'s `list` shows it) with `due`, its `dueAt`: now for a move such a step-up proved, else 7 days on, a wait `from` is told about by email (a recovery-proven move is told only when it completes), which any method of either account can `cancel`, and which a freeze of either person's methods drops (`waitDropped` to `from`); the platform completes it once due: a move whose key check or `alsoKnownAs` writes fail is tried again after a backoff (2^tries minutes, at most an hour), one refused for good (no key we can ask holds it, or the identity PDS refuses the account) is dropped with a `moveDropped` email to both accounts, one still failing 24 hours past `due` is dropped with `moveTimedOut`, one whose accounts changed meanwhile (the method gone, or marked for recovery since unless a recovery method proved the move; a refusal above other than a freeze; or a recovery-proven requester no longer a recovery method) is dropped with `moveCancelled` to both, and a completed one sends every account of the person a `linked` email), `unlink` (account `other` leaves `did`'s person at once; the removal of the `alsoKnownAs` entries between it and the rest is queued, tried again after a failure, and given up after about a day, or at once when refused for good, with an `akaLeft` email to both accounts of the entry; needs a fresh step-up of `did`; when `other` would be left with no way to sign in, `method`, one of `did`'s email or phone methods, is required (else NeedsMethod) and moves to `other`, which needs a step-up of a recovery method of `did` or of that method itself (NeedsRecoveryMethod), a recovery method's step-up for a method marked for recovery (RecoveryProtected), a method that is not frozen (MethodFrozen) and not `did`'s last way to sign in (LastMethod); NotLinked when `other` is not in `did`'s person; an email handed to `other` is released from `did`'s identity-PDS account, tried again after a failure and given up after about a day with an `emailLeft` email to `did`; both accounts get an `unlinked` email), `link` (retired, answers 400 InvalidRequest: a link is `moveMethod` now), `importBackupEmails` (once per account, recorded: a second call answers `alreadyImported` even after every mark is taken off; the move of the PDS's verified backup emails, `backupEmails`, each with when the PDS verified it: one verified before 2026-11-13T00:00:00Z becomes an email method marked for recovery at once, without step-up or wait, and one verified at or after it is skipped, `afterCutoff`, since only the holder could have added one before these rules; only an account with no recovery method takes one, all of its addresses in one call (each address once, else 400 InvalidRequest), else `hasRecovery`, nothing changes and the import is spent; a call that marks none of them spends it too; MethodFrozen while one of the account's methods is frozen, not spent; `indexOff` while the identity index is off), `notices` and `noticesSent` (no `did`; unused, kept for older clients: `notices` always answers an empty list and `noticesSent` `count: 0`, since the platform sends every notice itself), for a login service that just checked a signature by a Nostr key and knows no account yet (no `did`) `findKey` (`external`, type `nostr` and the 64-character lowercase hex key: `none` when no account the calling PDS hosts has it, else `done` with the account's `did`, the key's `method`, whether that method is `frozen` now, and whether `programs` may sign in with it), and for scheduled account deletions that came due (no `did`; only the accounts the calling PDS hosts) `dueDeletes` (up to 100 accounts the platform has deleted on its side, which the PDS deletes too; one taken and not confirmed is offered again after 5 minutes, without limit) and `dueDeletesDone` (`dids` the PDS deleted), and for a consent screen after sign-in `operator` (`operator`: whether `did` is one of the platform's operators, so the PDS offers the moderate scope, `include:pub.techne.draft.authModerate`, to operators only and drops it from everyone else's grant). Programs: a key with programs on can't be marked (ProgramsOn), and a program never touches account security: when the PDS says a program made the request (`program`), or the step-up names a key with programs on, every op but `list`, `signInMethods` and `sendTo` is 403 ProgramRefused (`operator` included: a program never moderates), `setPrograms` included: such a key's programs are turned off by a step-up of another of the account's methods.

Details · procedure
Kindprocedure
Authorityidentity.draft.techne.pub
Commit rev3n3iob5mtgw2u
Indexed

Procedure

procedure · POST

Input

application/json

importBackupEmails: the account's verified backup email addresses, all of them, each with when the PDS verified it.

  • maxLength: 10
itemsref
Reference

addChannel: the email or phone the PDS just proved (a code it sent and checked).

code

string

A recovery code, for `redeemCode`.

  • maxLength: 64

did

string · did

The signed-in account. Required for every op but `notices`, `noticesSent`, `dueDeletes` and `dueDeletesDone`.

dids

array

dueDeletesDone: the accounts whose PDS account was deleted.

  • maxLength: 100
itemsstring · did

emails

array

Retired, not read: a bare list has no verification dates, so the cutoff can't hold. importBackupEmails without `backupEmails` is 400 InvalidRequest.

  • maxLength: 10
itemsstring
  • maxLength: 320
Reference

from

string · did

moveMethod: the account the method leaves.

moveMethod: what the PDS's step-up of `from` proved (fresh, one of `from`'s methods).

Reference

ids

array

Unused, kept for older clients: notice ids for `noticesSent`, which confirms none.

  • maxLength: 100
itemsinteger

method

string

The method acted on (its `id` in `list` or `signInMethods`). moveMethod: the method of `from` that moves onto `did`. unlink: the method of `did` handed to `other` when `other` would have none left.

  • maxLength: 64

on

boolean

setPrograms: on or off.

op

requiredstring

The op. `link` is retired: it answers 400 InvalidRequest; `moveMethod` links two accounts now.

  • knownValues: list | signInMethods | sendTo | remove | cancel | freeze | unfreeze | mark | unmark | signOut | delete | addExternal | newRecoveryCodes | redeemCode | setPrograms | importBackupEmails | findKey | notices | noticesSent | dueDeletes | dueDeletesDone | addChannel | fold | link | moveMethod | unlink | operator

other

string · did

unlink: the account that leaves `did`'s person.

pending

string

The pending change `cancel` cancels.

  • maxLength: 64

primary

string · did

Retired, not read: it was the retired `link` op's primary account. Linked accounts have no primary.

program

boolean

A program made this request: a session or token the PDS's programmatic sign-in opened. Account security is refused (ProgramRefused).

signOut

boolean

With `freeze`: also sign out everywhere.

Reference

token

string

fold: the offer's token from addChannel. (link, retired, took one too.)

  • maxLength: 128

v

requiredinteger
  • const: 1

Output

application/json

codes

array

newRecoveryCodes: the codes, shown once.

itemsstring

count

integer

dueDeletesDone: how many were confirmed. noticesSent (unused, kept for older clients): always 0.

did

string · did

fold: the kept account. findKey: the account the key signs in to.

due

string · datetime

moveMethod `pending`: when the move is due (now for one a recovery method of `from` proved, else 7 days on). The platform completes it then or after a failed try, unless it is cancelled or dropped.

dueDeletes: accounts to delete on the PDS, oldest first.

itemsref
Reference

emptied

string · did

fold: the account folded in and deleted.

frozen

boolean

findKey: the key's method is frozen now and can't sign in.

importBackupEmails: each address sent, with what happened to it.

itemsref
Reference

method

string

addExternal's new method id, the recovery-code set redeemCode used, or addChannel's method id when `added` or `alreadyYours` (empty while the identity index is off); findKey's method id of the key. addChannel `boundElsewhere` when both accounts hold something: the other account's method id, for `moveMethod` (identity.finishAddMethod's session answer leaves it out).

methods

array

list: the account's methods (`value` on emails and phones; see defs#methodView).

notices

array

Unused, kept for older clients: always empty. The platform emails every notice itself.

itemsref
Reference

addChannel `boundElsewhere`: what `did` can do, with `fold` or `link`.

operator

boolean

operator: whether `did` is one of the platform's operators.

other

string · did

addChannel `boundElsewhere` when both accounts hold something: the account the channel signs in to (for `moveMethod`'s `from`).

addChannel `boundElsewhere` (either form): the other accounts of the person of the account the channel signs in to, now (`did`, `handle` when known), that account itself left out; empty when it is alone.

The change that waits. moveMethod's `pending` answer carries the change here, as `did`'s `list` shows it (`other` and `method`: the account the method comes from and that method), with `due`; `list` answers every pending change of the account as an array.

person

array

list: the other accounts of `did`'s person (empty when it is alone). moveMethod no longer answers `done`, which carried the person's accounts here.

programs

boolean

findKey: "Programs can sign in with this key" is on.

signInMethods: the account's methods that can sign in now (not frozen), oldest first.

itemsref
Reference

status

string

`done`: it happened now. `pending`: it waits (`pending`). `deleted` / `deleting` (`delete` done now): the account is gone / its local half is gone and a sweep finishes the rest (deleteAccount's `deleted` / `pending`; a deletion that could not start answers 503 Unavailable, try again). `bound`: addExternal's key is on another account. `invalid`: redeemCode's code is wrong, used, or the set is not a recovery method or is frozen. `hasRecovery`: importBackupEmails found a recovery method on the account; nothing changed. `indexOff`: importBackupEmails can't mark anything while the identity index is off; nothing changed. `alreadyImported`: importBackupEmails ran for this account before; nothing changed. `added` / `alreadyYours` / `boundElsewhere` / `unavailable`: addChannel, as identity.finishAddMethod. `folded`: fold done. `linked`: retired (the retired `link` op's answer). moveMethod answers `pending` only, with `pending` (the change, a defs#pendingChange) and `due`. `none`: findKey's key is no method of an account the calling PDS hosts.

  • knownValues: done | pending | deleted | deleting | bound | invalid | hasRecovery | indexOff | alreadyImported | added | alreadyYours | boundElsewhere | unavailable | folded | linked | none

to

ref

sendTo: where the code goes, in full.

Reference

v

requiredinteger
  • const: 1

Errors

BadSignature

No description in schema.

InvalidRequest

No description in schema.

UnknownAccount

No description in schema.

RateLimitExceeded

No description in schema.

Unavailable

Try again (`redeemCode` and `newRecoveryCodes` also while the platform's identity keys are not loaded).

NotFound

No such method or pending change on the account (moveMethod: `from` has no such method).

NotYourMethod

The step-up names a method that is not the account's.

LastMethod

It would leave no way to sign in (unlink: the method handed to `other` is `did`'s only one).

RecoveryProtected

Only a recovery method can do this to a recovery method (moveMethod: of `from`; unlink: of `did`).

NeedsRecoveryMethod

Needs a fresh step-up of a recovery method (unlink: or of the method handed to `other` itself).

StepUpRequired

Needs a fresh step-up (an account's first recovery mark, `newRecoveryCodes`, `fold`, `moveMethod` and `unlink` included).

SameMethod

A method cannot freeze itself.

MethodFrozen

The acting method is frozen (for `sendTo`: the method named is; for `addChannel`: the channel is, on whichever account, or the channel would be new to `did` while one of its methods is frozen; for `addExternal`, a first `newRecoveryCodes` set and `importBackupEmails`: one of `did`'s methods is frozen, and the message says so; for `unlink`: the method handed to `other` is).

InvalidToken

fold: the offer is unknown, used, expired, for the other action, or not made to `did` on this hook.

ProtectedAccount

addChannel / fold: one of the two accounts has a recovery mark, a live freeze, a pending change, or a passkey, Nostr key or recovery codes; it is never folded, and addChannel answers this before any `boundElsewhere`, so nothing about the other account is sent (HTTP 409).

NotEmpty

fold: the account to fold gained a record or is 7 days old or more; link it with `moveMethod` instead (HTTP 409).

ProgramRefused

A program asked (`program`, or a step-up by a key with programs on): account security needs a person on a method no program holds.

ProgramsOn

mark: the key has programs on; turn that off first (HTTP 409).

IsRecovery

setPrograms on: the method is a recovery method, or its first mark is waiting (HTTP 409).

FromStepUpRequired

moveMethod: `fromStepUp` is missing, malformed, not fresh, or names none of `from`'s methods (HTTP 403).

Frozen

moveMethod: a method of an account of either person is frozen; nothing is scheduled (HTTP 409).

PendingChange

moveMethod: an account of either person has a pending change, a move included; nothing is scheduled (HTTP 409).

TooMany

moveMethod: the person would hold more than 4 accounts (HTTP 409).

Same

moveMethod: the two accounts are already one person, or the same account (HTTP 409).

NoKey

moveMethod: no key this platform or the identity PDS holds can write `alsoKnownAs` for an account of either person; nothing is scheduled (HTTP 409).

NeedsMethod

unlink: `other` would be left with no way to sign in; name one of `did`'s email or phone methods to hand it (`method`) (HTTP 409).

NotLinked

unlink: `other` is not in `did`'s person, or is `did` (HTTP 404).

#backupEmail

object

One backup email importBackupEmails moves, with when the PDS verified it.

Properties

email

requiredstring
  • maxLength: 320

verifiedAt

requiredstring · datetime

When the PDS verified the address. Only one verified before 2026-11-13T00:00:00Z is imported.

#dueDelete

object

An account whose scheduled deletion ran on the platform: the PDS deletes its PDS account, then confirms (`dueDeletesDone`). An account already gone from the PDS counts as deleted.

Properties

deletedAt

requiredstring · datetime

When the platform deleted its side.

did

requiredstring · did

#external

object

Properties

label

string
  • maxLength: 128

ref

requiredstring

The passkey credential id, or the Nostr key (hex).

  • maxLength: 512

type

requiredstring
  • knownValues: passkey | nostr

#importedEmail

object

One address importBackupEmails was sent, with what happened to it.

Properties

email

requiredstring

status

requiredstring

`marked`: an email method of the account now, marked for recovery. `boundElsewhere`: on another account, left there. `released`: the account removed it; only adding it again binds it back. `invalid`: not an email address. `afterCutoff`: verified at or after 2026-11-13T00:00:00Z, not imported (add it and mark it under the rules).

  • knownValues: marked | boundElsewhere | released | invalid | afterCutoff

#notice

object

Unused, kept for older clients: `notices` always answers an empty list. The platform emails every notice itself, to the account's email methods only.

Properties

createdAt

requiredstring · datetime

did

requiredstring · did

event

requiredstring

What the notice is about: a change that started to wait (`removeMethod`, `deleteAccount`, `markRecovery`, `moveMethod`), a `freeze`, `waitDropped`: the change in `pending` was not completed because one of the account's methods was frozen during its wait, `programsOn`: programs can now sign in with one of the account's Nostr keys (`setPrograms` on; no `pending`), `linked` / `unlinked`: a link (moveMethod completed) or an unlink changed the account's person, `moveDropped` / `moveTimedOut` / `moveCancelled`: a move was dropped because a key can't be used or the identity PDS refused it for good, because it still could not be written 24 hours past due, or because something changed on one of its accounts, or `akaLeft` / `emailLeft`: an `alsoKnownAs` entry or an identity-PDS account email the platform owed removing was given up and is left.

  • knownValues: removeMethod | deleteAccount | markRecovery | freeze | waitDropped | programsOn | moveMethod | linked | unlinked | moveDropped | moveTimedOut | moveCancelled | akaLeft | emailLeft

id

requiredinteger

to

requiredref
Reference

#noticeTo

object

An email or phone number in full: `sendTo`'s `to`. Also the shape of #notice's `to`, which is unused and kept for older clients (notices go to email methods only).

Properties

type

requiredstring
  • knownValues: email | phone | nostr

value

requiredstring

#provedMethod

object

Properties

type

requiredstring
  • knownValues: email | phone | passkey | nostr | recoveryCodes

value

string

The email or E.164 phone, the passkey credential id, or the Nostr key (hex). None for recoveryCodes.

  • maxLength: 512

#signInMethod

object

One way to sign in, as a page may show it before anyone has signed in: masked, never its full value (though an address whose local part is one character is fully implied).

Properties

display

requiredstring

For any page, one reached by typing a handle included: an email keeps its first character and, at a common email provider, its domain (`a•••@gmail.com`), at any other domain only the domain's last part (`a•••@•••.dev`; `a•••@•••` for a domain with no dot); a phone its last two digits (`•••• 97`); a passkey or Nostr key its label.

  • maxLength: 320

Only for the PDS's chooser of the accounts already signed in on that browser, never for a page reached by typing a handle: an email keeps its first character and its whole domain (`a•••@example.dev`), a phone its last four digits (`••• ••• 4242`); a passkey or Nostr key its label, as `display`. Present exactly when `display` is. Absent from a platform older than this field: use `display`.

  • maxLength: 320

id

requiredstring

The method id (for `sendTo`, and the PDS's own passkey or Nostr challenge).

type

requiredstring
  • knownValues: email | phone | passkey | nostr

#stepUp

object

What the PDS's step-up proved.

Properties

method

requiredref
Reference

provedAt

requiredstring · datetime

Similar lexicons

semantic match

Lexicons whose schemas describe something close to this one. Check them before publishing a new one that overlaps.

  • Finish adding a sign-in method with the code identity.beginAddMethod sent. `added`: the method is now bound to the caller's account. `alreadyYours`: it already was (re-issued). `boundElsewhere`: it signs in to another account. When one of the two accounts is empty and new, `offer` (`fold`) says it can be folded into the other with identity.fold; when both hold something, `other` names that account and no offer is made: the two are linked by moving the method (identity.manageMethods moveMethod, o

  • A sign-in channel, normalized: a phone is E.164 (`+` and 7 to 15 digits); an email is trimmed and lower-cased.

  • The caller's sign-in methods (masked, with their recovery mark and freeze), its pending changes, and the other accounts of its person (`links`, each `did`, `since` and `mutual`, always true; linked accounts have no primary). Emails and phones only unless `allTypes` (shipped clients label every row as an email). Signed-in members only.