pub.techne.draft.identity.createLinkToken
Make a link token on the caller's identity PDS: a secret anyone can redeem (redeemLinkToken) once (one-time, the default) or any number of times by different accounts (`reusable`). With `grant`, the platform keeps a write it makes for each account that redeems it: when the identity PDS reports a redemption, the platform writes the redeemer's own pub.techne.draft.identity.linkRedemption record in their personal space and then writes `grant.write` as `grant.actAs` with the redeemer's DID in every "$subject" slot (and their name in every "$name" slot), exactly as identity.holdForPhone releases a hold: the caller must be able to write as `actAs` now and when the link is redeemed, a block either way between the redeemer and the caller or `actAs` writes nothing, and the record must be one permissioned.putRecord would take with the caller's DID in the slot. A one-time link's grant goes after its one write; a reusable link's is written once for each redeemer, under its own record key. A release never writes over a record already at its key: one there stays, and that redeemer's write is not made. A pub.techne.draft.contact grant is likewise not made when any active contact of `actAs` already names the redeemer, by its `did` or by a saved number that resolves to them (an archived one does not count), so a grant like {name: "$name", did: "$subject"} adds each person to the owner's People once. Only an account hosted on the platform's identity PDS can make links. One call spends one of the caller's writes.
Details · procedure
| Kind | procedure |
|---|---|
| Authority | identity.draft.techne.pub |
| Commit rev | 3n3iob56jgo2u |
| Indexed |
Procedure
procedure · POSTInput
application/jsonOutput
application/jsonThe secret to put in the link. Whoever holds it can redeem it.
Errors
InvalidRequest
HTTP 400: a field out of bounds, or a body that is not JSON; 413: the body, or `grant.write`, over its size cap; 415: not application/json; 422: not the input's shape.
Forbidden
HTTP 403: `grant.actAs` is not an account the caller may write as.
NotSupported
HTTP 400: the caller's account is not hosted on the platform's identity PDS, or link tokens are not configured there; or the caller holds its own session (it came through its PDS with a service-auth token): call this method on its identity PDS itself and attach a grant with attachLinkGrant.
RateLimitExceeded
Too many writes from this DID (HTTP 429).
UpstreamFailure
HTTP 502: the identity PDS could not be reached, refused the credential the platform holds for the caller, or answered with a failure; try again.
Similar lexicons
semantic matchLexicons whose schemas describe something close to this one. Check them before publishing a new one that overlaps.
-
Attach a grant to a link token the caller made on their own identity PDS (an app holding its own session calls createLinkToken or resetLinkToken there, then this through its PDS). The platform asks the identity PDS (checkLinkToken) whether `token` is live and the caller's; it then keeps `grant` for that link as createLinkToken with `grant` does. `grant.actAs` must be a collective (`ActAsPerson` otherwise): a person's records are written by their own app, never by the platform for someone else's
-
pub.techne.draft.identity.resetLinkToken
procedureRevoke the caller's live reusable links for `app` and `target` and make a new reusable one. Its grant is `grant` when given (checked as for createLinkToken), else a copy of the newest unrevoked grant the caller made for a reusable link with the same `app` and `target` (a one-time link's grant is never carried); with neither, the new link has no grant. One call spends one of the caller's writes.
-
Redeem a link token as the caller. The identity PDS records it and reports it to the platform, which writes the caller's linkRedemption record and the link's grant, usually before this answers. Redeeming again a link the caller already redeemed answers `repeat` and changes nothing. One call spends one of the caller's writes. An older link (one the served app made before link tokens) writes no linkRedemption record. A caller that holds its own session redeems at its identity PDS and then calls cl
-
pub.techne.draft.identity.claimLinkGrant
procedureRelease, now, the grant of a link the caller redeemed on their own identity PDS (an app holding its own session calls redeemLinkToken there, then this through its PDS, in the same user action). The platform needs the redemption the identity PDS reported for the caller; it writes the grant's record as the grant's `actAs` in this request, under the grant's rules (the link's owner may still write as `actAs`, no block between owner and redeemer). The platform never releases such a grant in the backg
-
pub.techne.draft.identity.listLinkTokens
procedureThe caller's live links for `app` and `target`, each with its token, in no promised order. A procedure so the token never rides a URL. One call spends one of the caller's writes.