{"openapi":"3.1.0","info":{"title":"knowme API","version":"0.1.0","description":"Business cards with QR codes and Apple Wallet passes. Authenticate with a Bearer API token (km_...)."},"servers":[{"url":"https://knowme.shipwith.si"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"API token from POST /api/auth/login {issue_token:true} or POST /api/tokens"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}},"Content":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"title":{"type":"string"},"company":{"type":"string"},"bio":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"website":{"type":"string"},"location":{"type":"string"},"handle":{"type":"string"},"tagline":{"type":"string"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"}}}}}},"Design":{"type":"object","properties":{"template":{"type":"string","enum":["frame","aura","burst","monogram","bold","radius"]},"bg":{"type":"string"},"fg":{"type":"string"},"accent":{"type":"string"},"accent2":{"type":"string"},"font":{"type":"string","enum":["grotesk","display","serif","mono","geometric","humanist"]},"pattern":{"type":"string","enum":["none","dots","grid","lines","rings","waves"]},"grain":{"type":"boolean"},"radius":{"type":"number"},"showQr":{"type":"boolean"}}},"Card":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"content":{"$ref":"#/components/schemas/Content"},"design":{"$ref":"#/components/schemas/Design"},"mode":{"type":"string","enum":["page","link"]},"link_url":{"type":["string","null"]},"published":{"type":"boolean"},"urls":{"type":"object","additionalProperties":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}}},"paths":{"/api/auth/signup":{"post":{"security":[],"summary":"Create an account","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string"},"password":{"type":"string","minLength":8},"name":{"type":"string"},"issue_token":{"type":"boolean"}}}}}},"responses":{"200":{"description":"User (and token if issue_token)"},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/auth/login":{"post":{"security":[],"summary":"Sign in","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string"},"password":{"type":"string"},"issue_token":{"type":"boolean"}}}}}},"responses":{"200":{"description":"User (and token if issue_token)"},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/me":{"get":{"summary":"Current user","responses":{"200":{"description":"User"},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/tokens":{"get":{"summary":"List API tokens"},"post":{"summary":"Create an API token","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}}}}}},"responses":{"200":{"description":"The token, shown once"}}}},"/api/templates":{"get":{"security":[],"summary":"Card templates and defaults","responses":{"200":{"description":"Templates"}}}},"/api/render":{"post":{"security":[],"summary":"Render a design to SVG without saving","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"$ref":"#/components/schemas/Content"},"design":{"$ref":"#/components/schemas/Design"},"side":{"type":"string","enum":["front","back"]}}}}}},"responses":{"200":{"description":"SVG","content":{"image/svg+xml":{}}}}}},"/api/cards":{"get":{"summary":"List your cards","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"cards":{"type":"array","items":{"$ref":"#/components/schemas/Card"}}}}}}}}},"post":{"summary":"Create a card","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"$ref":"#/components/schemas/Content"},"design":{"$ref":"#/components/schemas/Design"},"slug":{"type":"string"},"mode":{"type":"string","enum":["page","link"]},"link_url":{"type":"string"},"published":{"type":"boolean"}}}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/cards/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Card id or slug"}],"get":{"summary":"Get a card","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update a card (merges content and design)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"$ref":"#/components/schemas/Content"},"design":{"$ref":"#/components/schemas/Design"},"slug":{"type":"string"},"mode":{"type":"string","enum":["page","link"]},"link_url":{"type":"string"},"published":{"type":"boolean"}}}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a card","responses":{"200":{"description":"Deleted"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/cards/{id}/stats":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Card id or slug"}],"get":{"summary":"Visit stats","parameters":[{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":90}}],"responses":{"200":{"description":"Totals and a daily series"}}}},"/api/slug-available":{"get":{"summary":"Check a slug","parameters":[{"name":"slug","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ slug, available, reason }"}}}},"/c/{slug}":{"get":{"security":[],"summary":"Public card page (HTML, or JSON with Accept: application/json)","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}]}},"/c/{slug}/wallet.pkpass":{"get":{"security":[],"summary":"Apple Wallet pass","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}]}},"/q/{slug}":{"get":{"security":[],"summary":"QR target: records a scan, then redirects","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}]}}}}