PRINTDECKDOCS

Architecture · Appendix A

API routes

All routes are under /api/v1/. The largest body is 64 KB. A request with no valid auth gets 401, and a missing thing gets 410. A reply that links to files of a project also sets the signed cookies of that project. The routes of the Action need a new OIDC token of GitHub for each request.

RouteAuthWhat it does
GET healthnoneReports that the API runs.
POST decksenrollment codeEnrolls a deck with its public key.
GET, DELETE decks/selfdeck signatureShows the deck, or removes it (Disconnect).
POST owner/codedeck signatureMakes an owner code (10 minutes).
POST auth/owner/begin, finishowner codeMakes an owner passkey.
POST invites/viewinvite codeShows the project and the owner of an invite.
POST auth/invite/begin, finishinvite codeMakes a member passkey, and joins.
POST auth/login/begin, finishpasskey; finish accepts an optional invite codeSigns in, and gives a session token. With an invite code, a member passkey also joins the project of the invite.
GET mesessionShows the person of the session.
GET, POST printersowner or deckLists the printers. A deck registers its printer.
GET names/<slug>sessionFinds the project of a slug. With ?view=1, it also gives the view of the project, so a project page needs one request.
GET, POST projectssession or deckLists the projects, or makes one (owner). A member gets each project of the session that still has the member.
projects/<id> and belowsession or deckView, rename, delete; invites, members, public address; prints, live tiles, photos. The rows below are the routes of the notes, the prints, the photos, the queue and the builds.
PATCH projects/<id>/notessessionChanges the notes of the project.
PATCH projects/<id>/prints/<print>session; owner for title, marks, sourceChanges the title, the notes, the marks Test, Ready, Delivered, In use and Rejected (with a note of why), or the source of a print. A member changes the notes only.
PUT projects/<id>/photos/<photo>session or deck; a member moves only their own photosMoves a photo to another print of the project, or to no print.
PATCH projects/<id>/members/<member>owner or deckSets the GitHub username of a member who joined.
PUT projects/<id>/repoowner or deckLinks a GitHub repository, or removes the link with "".
GET projects/<id>/plans/<plan>sessionShows a plan with the paths of its models, and its builds.
GET projects/<id>/planssessionLists the plans of pull requests and of tags.
POST projects/<id>/plans/<plan>/buildsowner or deckMakes a build with the plates, and starts the slice run with the GitHub App.
GET projects/<id>/builds/<build>sessionShows a build with its plates, and the gh command when the stack has no App.
POST projects/<id>/builds/<build>/plates/<n>/approve, rejectowner or deckApproves a plate, or rejects it with a reason.
POST plansOIDC token of the linked repository, or of a member's fork with an open pull requestMakes a plan, and gives the grant of its models and its PDFs.
POST plans/<id>/doneOIDC token of the repository of the plan, or of its forkChecks the models and the PDFs, and marks the plan ready. An older waiting plate with a changed part becomes "replaced". With the GitHub App, the service then writes its comment on the pull request.
GET builds/<id>OIDC token of printdeck.yml on main or masterGives the commit and the plates of the build.
POST builds/<id>/startedthe sameRecords the run ID. A failed build goes back to "slicing".
POST builds/<id>/progressthe sameRecords a line of progress of the slice run. The build must be "slicing".
POST builds/<id>/filesthe sameRecords the files of the plates, and gives the grant of the build.
POST builds/<id>/donethe sameChecks the files. The build becomes "ready", and each plate "waiting".
POST builds/<id>/failedthe sameMarks the build "failed", with the error.
POST sharesdeck signatureMakes a share, with its first grant.
shares/<id>/grant, end, project, DELETEsignature of the deck of the shareA new grant, the end, the project of the share, or a delete.
shares/<id>/ready, photoowner key, or the deckThe Ready flag and note; photos.
POST projects/<id>/builds/<build>/plates/<n>/sendowner or deckSends an approved plate to a printer of its process.
GET printers/<id>/plates, POST printers/<id>/plates/takensignature of the deck of the printerThe plates that wait for the printer, with presigned addresses of the bucket; the plate is in the queue.
POST printers/<id>/queuesignature of the deck of the printerThe files of the queue that are in projects: their places and starts.
DELETE projects/<id>/queue/<printer>/<item>owner or deckAsks the deck to take a file of the project out of its queue. The file must be in the last report of the queue.
GET printers/<id>/removes, POST printers/<id>/removes/donesignature of the deck of the printerThe files that the owner took out on the project page; the deck took them out.
POST printers/<id>/livesignature of the deck of the printerWhat the printer does now. GET printers has it for the owner.
/.well-known/apple-app-site-associationnone (a file of the bucket)The webcredentials of the iPhone app, for the passkey sign-in in the app.
relay/register, relay/pushnone for register (a code comes by push); the send token for pushThe push relay of the iPhone app, when the stack has the secret of the relay. The app registers here, and the decks post their encrypted messages here.

Back: 9 UpdatesContents