{"openapi":"3.1.1","info":{"title":"Naveto API","version":"1.0.0","description":"Public API specification for Naveto, the Moroccan commuter carpooling platform. Current platform status: launch-waitlist stage. Public endpoints require no API key (open access, rate-limited by IP). Hosted sandbox environment, live ride search, seat booking, and payment processing are currently unavailable and deferred to post-launch. Automated agents must obtain explicit user consent before submitting contact information.","contact":{"name":"Naveto Support","email":"hello@naveto.ma","url":"https://naveto.ma"}},"servers":[{"url":"https://naveto-server-production-7227l4ptygid3bvi.orange-sound-4b9f.workers.dev","description":"Production API Worker (Cloudflare Workers)"}],"paths":{"/trpc/healthCheck":{"get":{"summary":"Public health check","description":"Checks the operational health and readiness of the deployed Naveto API service. Public unauthenticated endpoint (no API key required).","operationId":"healthCheck","responses":{"200":{"description":"Service is operational.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthCheckResponse"},"example":{"result":{"data":"OK"}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrpcErrorResponse"}}}}}}},"/trpc/waitlist.join":{"post":{"summary":"Join the waitlist","description":"Register a passenger or driver on the launch waitlist using an email address or Moroccan phone number. Public unauthenticated endpoint (no API key required). Deduplicates existing contacts idempotently. Automated agents must obtain explicit user consent prior to submission. Note: hosted sandbox, live ride search, seat booking, and payment processing are unavailable during the launch-waitlist stage.","operationId":"waitlistJoin","requestBody":{"required":true,"description":"Waitlist registration payload encoded as JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistJoinInput"},"examples":{"emailPassenger":{"summary":"Passenger signup with email","value":{"contact":"passenger@example.com","contactType":"email","role":"passenger","source":"signup"}},"phoneDriver":{"summary":"Driver signup with Moroccan phone number","value":{"contact":"0612345678","contactType":"phone","role":"driver","source":"signup"}}}}}},"responses":{"200":{"description":"Waitlist registration processed. Returns status 'created' for new entries, or 'duplicate' if the contact was already registered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistJoinResponse"},"examples":{"created":{"summary":"Newly registered entry","value":{"result":{"data":{"status":"created"}}}},"duplicate":{"summary":"Contact already in waitlist (idempotent duplicate)","value":{"result":{"data":{"status":"duplicate"}}}}}}}},"400":{"description":"Client error: invalid contact format (not a valid email or Moroccan phone number) or Zod schema validation failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrpcErrorResponse"},"examples":{"invalidContact":{"summary":"Invalid contact format","value":{"error":{"message":"Invalid contact: please provide a valid email address or Moroccan phone number.","code":-32600,"data":{"code":"BAD_REQUEST","httpStatus":400,"path":"waitlist.join","errorCode":"INVALID_CONTACT","hint":"Provide a valid email address (e.g. name@example.com) or Moroccan phone number (+212 6... / 06...)."}}}},"validationError":{"summary":"Schema validation failure","value":{"error":{"message":"Invalid input","code":-32600,"data":{"code":"BAD_REQUEST","httpStatus":400,"path":"waitlist.join","errorCode":"VALIDATION_ERROR","hint":"Check the required parameters and field types."}}}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrpcErrorResponse"},"example":{"error":{"message":"An internal server error occurred.","code":-32603,"data":{"code":"INTERNAL_SERVER_ERROR","httpStatus":500,"path":"waitlist.join","errorCode":"INTERNAL_SERVER_ERROR","hint":"Please try again later or contact support."}}}}}}}}}},"components":{"schemas":{"HealthCheckResponse":{"type":"object","required":["result"],"properties":{"result":{"type":"object","required":["data"],"properties":{"data":{"type":"string","enum":["OK"]}}}}},"WaitlistJoinInput":{"type":"object","required":["contact","contactType"],"properties":{"contact":{"type":"string","minLength":1,"description":"Email address or Moroccan mobile phone number (+212 or 06/07...)."},"contactType":{"type":"string","enum":["email","phone"],"description":"Type of contact provided."},"role":{"type":"string","enum":["passenger","driver"],"default":"passenger","description":"Preferred carpooling role."},"source":{"type":"string","enum":["signup","login"],"default":"signup","description":"Interface origin for waitlist signup."},"ref":{"type":"string","pattern":"^[abcdefghjkmnpqrstuvwxyz23456789]{8}$","description":"Referral code of the person who shared the link. Unknown or own codes are ignored."}}},"WaitlistJoinResponse":{"type":"object","required":["result"],"properties":{"result":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["created","duplicate"],"description":"'created' if contact was newly inserted; 'duplicate' if contact was already present."},"referralCode":{"type":"string","description":"Only with 'created': the person's own referral code."},"statusToken":{"type":"string","description":"Only with 'created': secret token for their private status page. Returned once, never again; treat as a password."}}}}}}},"TrpcErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","code","data"],"properties":{"message":{"type":"string","description":"Human-readable description of the error."},"code":{"type":"integer","description":"Standard JSON-RPC / tRPC numeric error code."},"data":{"type":"object","required":["code","httpStatus","errorCode","hint"],"properties":{"code":{"type":"string","description":"tRPC textual error code (e.g. BAD_REQUEST, INTERNAL_SERVER_ERROR)."},"httpStatus":{"type":"integer","description":"Corresponding HTTP status code (e.g. 400, 500)."},"path":{"type":"string","description":"The tRPC procedure path where the error occurred."},"errorCode":{"type":"string","description":"Stable machine-readable error code."},"hint":{"type":"string","description":"Safe actionable resolution hint for clients and agents."}}}}}}}}}}