सामग्री पर जाएँ
CADCAMFUN
दस्तावेज़

दस्तावेज़

प्रमाणीकरण

खाता साइन-इन, साइन-अप, पुनर्प्राप्ति, सत्यापन, जादुई लिंक, सत्र लुकअप और पासकी पंजीकरण।

स्वचालित अनुवाद अभी उपलब्ध नहीं है; पाठ अंग्रेज़ी में है और इंटरफ़ेस आपकी भाषा में है। अंग्रेज़ी मूल देखें

प्लेग्राउंड

इन अनुरोधों को अपने स्वयं के चल रहे साइडकार को भेजें। मान इस ब्राउज़र में रहते हैं.

जुड़े नहीं हैं
यह कैसे काम करता है

साइडकार स्टार्टअप पर चुने गए लूपबैक पोर्ट पर सुनता है और इसे प्रिंट करता है ready रेखा; उस यूआरएल का उपयोग करें और CADCAMFUN_TOKEN इसकी शुरुआत की गई थी. अनुरोध सीधे इस पृष्ठ से उस पते पर जाते हैं।

साइडकार CORS हेडर को केवल टौरी मूल और तक भेजता है http://localhost या http://127.0.0.1 किसी भी बंदरगाह पर. होस्ट किए गए दस्तावेज़ों से ब्राउज़र प्रतिक्रिया को अवरुद्ध कर देता है, इसलिए दस्तावेज़ों को स्थानीय रूप से चलाएँ (bun run dev में packages/web) खेल के मैदान का उपयोग करने के लिए, या अनुरोध को कर्ल के रूप में कॉपी करें। वास्तविक डेटा को छुए बिना प्रयोग करने के लिए, साइडकार से शुरुआत करें CADCAMFUN_DATA_DIR एक बेकार निर्देशिका की ओर इशारा किया - देखें एपीआई वॉकथ्रू.

संचालन

15 एंडपॉइंट auth समूह, साइडकार के स्वयं से उत्पन्न ओपनएपीआई दस्तावेज़. संरक्षित संचालन लेते हैं Authorization: Bearer $CADCAMFUN_TOKEN; देखना प्रमाणीकरण. व्यवहार और मर्यादा में हैं सबसिस्टम गाइड.

डाक /api/auth/identity/start auth.identityStart
डाक /api/auth/identity/poll auth.identityPoll
डाक /api/auth/identity/cancel auth.identityCancel
डाक /api/auth/forgot-password auth.forgotPassword
डाक /api/auth/reset-password auth.resetPassword
डाक /api/auth/send-magic-link auth.sendMagicLink
डाक /api/auth/send-verification-email auth.sendVerificationEmail
डाक /api/auth/verify-email auth.verifyEmail
डाक /api/auth/signout auth.signout
पाना /api/auth/get-session auth.getSession
डाक /api/auth/signin-direct auth.signinDirect
डाक /api/auth/signup auth.signup
डाक /api/auth/test-direct-create auth.testDirectCreate
डाक /api/auth/verify-magic-link auth.verifyMagicLink
डाक /api/auth/passkey-register auth.registerPasskey
3डी में प्रमाणीकरण परिचालन कक्षा में खींचें · ज़ूम करने के लिए स्क्रॉल करें · पैन करने के लिए दाईं ओर खींचें
प्रति ऑपरेशन एक ब्लॉक (15), इस पृष्ठ के प्रति संसाधन अनुभाग को स्टैक्ड किया गया है और विधि के अनुसार रंगा गया है: हरा GET, नारंगी POST, नीला PUT, बैंगनी PATCH, लाल DELETE। निर्माण के समय OpenAPI दस्तावेज़ से उत्पन्न।

/api/auth/identity

डाक /api/auth/identity/start # auth.identityStart

आवश्यक है Authorization: Bearer <token>.

जवाब
200 वस्तु application/json
{
  id: string
  url: string
  issuer: string
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
उदाहरण लाओ
auth.identityStart
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/auth/identity/start`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
curl
पोस्ट/एपीआई/ऑथ/पहचान/प्रारंभ
curl --request POST "${CADCAMFUN_URL}/api/auth/identity/start" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं
डाक /api/auth/identity/poll # auth.identityPoll

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  id: string
}
जवाब
200 वस्तु | वस्तु | वस्तु application/json
{
  status: "pending"
} | {
  status: "complete"
  tokens: {
    access: string
    refresh: string
    expiresAt: number | "Infinity" | "-Infinity" | "NaN"
  }
} | {
  status: "failed"
  message: string
}
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
उदाहरण लाओ
auth.identityPoll
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/auth/identity/poll`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
curl
पोस्ट/एपीआई/ऑथ/पहचान/मतदान
curl --request POST "${CADCAMFUN_URL}/api/auth/identity/poll" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं
डाक /api/auth/identity/cancel # auth.identityCancel

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  id: string
}
जवाब
200 वस्तु application/json
{
  success: true
  message: string
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
उदाहरण लाओ
auth.identityCancel
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/auth/identity/cancel`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
curl
पोस्ट/एपीआई/ऑथ/पहचान/रद्द करें
curl --request POST "${CADCAMFUN_URL}/api/auth/identity/cancel" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं

/api/auth/forgot-password

डाक /api/auth/forgot-password # auth.forgotPassword

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  email?: string | null
  callbackURL?: string | null
}
जवाब
200 वस्तु application/json
{
  success: true
  message: string
  debugResetLink?: string | null
}
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
एसडीके उदाहरण
auth.forgotPassword
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// AuthForgotPasswordInput
const result = await client.auth.forgotPassword({
  email: "",
  callbackURL: ""
})
curl
पोस्ट/एपीआई/ऑथ/पासवर्ड भूल गए
curl --request POST "${CADCAMFUN_URL}/api/auth/forgot-password" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं

/api/auth/reset-password

डाक /api/auth/reset-password # auth.resetPassword

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  token?: string | null
  newPassword?: string | null
  confirmPassword?: string | null
}
जवाब
200 वस्तु application/json
{
  success: true
  message: string
  user: {
    id: string
    email: string
    name: string | null
  }
}
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 AuthNotFoundEncoded application/json
AuthNotFoundEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
एसडीके उदाहरण
auth.resetPassword
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// AuthResetPasswordInput
const result = await client.auth.resetPassword({
  token: "",
  newPassword: "",
  confirmPassword: ""
})
curl
पोस्ट/एपीआई/ऑथ/रीसेट-पासवर्ड
curl --request POST "${CADCAMFUN_URL}/api/auth/reset-password" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं

/api/auth/send-verification-email

डाक /api/auth/send-verification-email # auth.sendVerificationEmail

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  email?: string | null
  callbackURL?: string | null
}
जवाब
200 वस्तु application/json
{
  success: true
  message: string
  debug: {
    link: string
  }
}
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 AuthNotFoundEncoded application/json
AuthNotFoundEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
एसडीके उदाहरण
auth.sendVerificationEmail
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// AuthSendVerificationEmailInput
const result = await client.auth.sendVerificationEmail({
  email: "",
  callbackURL: ""
})
curl
पोस्ट/एपीआई/ऑथ/भेजें-सत्यापन-ईमेल
curl --request POST "${CADCAMFUN_URL}/api/auth/send-verification-email" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं

/api/auth/verify-email

डाक /api/auth/verify-email # auth.verifyEmail

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  token?: string | null
}
जवाब
200 वस्तु application/json
{
  success: true
  message: string
  user: {
    id: string
    email: string
    name: string | null
    emailVerified: string
  }
}
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 AuthNotFoundEncoded application/json
AuthNotFoundEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
एसडीके उदाहरण
auth.verifyEmail
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// AuthVerifyEmailInput
const result = await client.auth.verifyEmail({
  token: ""
})
curl
पोस्ट/एपीआई/ऑथ/सत्यापित-ईमेल
curl --request POST "${CADCAMFUN_URL}/api/auth/verify-email" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं

/api/auth/signout

डाक /api/auth/signout # auth.signout

आवश्यक है Authorization: Bearer <token>.

जवाब
200 वस्तु application/json
{
  success: true
  message: string
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
एसडीके उदाहरण
auth.signout
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.auth.signout()
curl
पोस्ट/एपीआई/ऑथ/साइनआउट
curl --request POST "${CADCAMFUN_URL}/api/auth/signout" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

/api/auth/get-session

पाना /api/auth/get-session # auth.getSession

आवश्यक है Authorization: Bearer <token>.

जवाब
200 वस्तु application/json
{
  session: {
    user: {
      id: string
      email: string | null
      name: string | null
      emailVerified: string | null
      createdAt: string
      updatedAt: string
    }
    expires: string
    sessionToken?: string | null
  }
}
401 प्रामाणिकअनधिकृतएन्कोडेड | अनधिकृत एन्कोडेड application/json
AuthUnauthorizedEncoded | UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
प्राप्त करें /api/auth/get-session
{
  "session": {
    "user": {
      "id": "c942817d-0162-4291-84ff-77321d387acc",
      "email": "local@cadcamfun.local",
      "name": "Local user",
      "emailVerified": null,
      "createdAt": "2026-10-15T04:52:06.538Z",
      "updatedAt": "2026-10-15T04:52:06.538Z"
    },
    "expires": "2026-10-22T04:52:23.311Z"
  }
}
एसडीके उदाहरण
auth.getSession
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.auth.getSession()
curl
प्राप्त करें /api/auth/get-session
curl --request GET "${CADCAMFUN_URL}/api/auth/get-session" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

/api/auth/signin-direct

डाक /api/auth/signin-direct # auth.signinDirect

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  email?: string | null
  password?: string | null
}
जवाब
200 वस्तु application/json
{
  success: true
  message: string
  user: {
    id: string
    email: string | null
    name: string | null
    emailVerified: string | null
    createdAt: string
  }
  token: string
}
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 प्रामाणिकअनधिकृतएन्कोडेड | अनधिकृत एन्कोडेड application/json
AuthUnauthorizedEncoded | UnauthorizedEncoded
404 AuthNotFoundEncoded application/json
AuthNotFoundEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
एसडीके उदाहरण
auth.signinDirect
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// AuthSigninDirectInput
const result = await client.auth.signinDirect({
  email: "",
  password: ""
})
curl
पोस्ट/एपीआई/ऑथ/साइनइन-डायरेक्ट
curl --request POST "${CADCAMFUN_URL}/api/auth/signin-direct" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं

/api/auth/signup

डाक /api/auth/signup # auth.signup

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  email?: string | null
  password?: string | null
  confirmPassword?: string | null
  name?: string | null
}
जवाब
201 वस्तु application/json
{
  success: true
  message: string
  user: {
    id: string
    email: string | null
    name: string | null
    emailVerified: string | null
    createdAt: string
  }
}
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
एसडीके उदाहरण
auth.signup
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// AuthSignupInput
const result = await client.auth.signup({
  email: "",
  password: "",
  confirmPassword: "",
  name: ""
})
curl
पोस्ट/एपीआई/ऑथ/साइनअप
curl --request POST "${CADCAMFUN_URL}/api/auth/signup" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं

/api/auth/test-direct-create

डाक /api/auth/test-direct-create # auth.testDirectCreate

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  email?: string | null
  password?: string | null
  name?: string | null
}
जवाब
201 वस्तु application/json
{
  success: true
  message: string
  user: {
    id: string
    email: string | null
    name: string | null
    emailVerified: string | null
    createdAt: string
  }
}
400 TestCreateBadRequestEncoded application/json
TestCreateBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 TestCreateFailureEncoded application/json
TestCreateFailureEncoded
एसडीके उदाहरण
auth.testDirectCreate
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// AuthTestDirectCreateInput
const result = await client.auth.testDirectCreate({
  email: "",
  password: "",
  name: ""
})
curl
पोस्ट /एपीआई/ऑथ/टेस्ट-डायरेक्ट-क्रिएट
curl --request POST "${CADCAMFUN_URL}/api/auth/test-direct-create" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं

/api/auth/passkey-register

डाक /api/auth/passkey-register # auth.registerPasskey

आवश्यक है Authorization: Bearer <token>.

जवाब
200 कोई भी JSON मान application/json
unknown
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
501 PasskeyNotImplementedEncoded application/json
PasskeyNotImplementedEncoded
एसडीके उदाहरण
auth.registerPasskey
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.auth.registerPasskey()
curl
पोस्ट/एपीआई/ऑथ/पासकी-रजिस्टर
curl --request POST "${CADCAMFUN_URL}/api/auth/passkey-register" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

स्कीमा

नामित स्कीमा इस समूह के मापदंडों, निकायों और प्रतिक्रियाओं से पहुंच योग्य हैं। ए ? एक वैकल्पिक फ़ील्ड चिह्नित करता है; | null उस फ़ील्ड को चिह्नित करता है जो शून्य मान के साथ मौजूद हो सकता है।

AuthBadRequestEncoded
{
  _tag: "AuthBadRequest"
  error: string
  details: string
}
AuthInternalEncoded
{
  _tag: "AuthInternal"
  error: string
  details: string
}
AuthNotFoundEncoded
{
  _tag: "AuthNotFound"
  error: string
  details: string
}
AuthUnauthorizedEncoded
{
  _tag: "AuthUnauthorized"
  error: string
  details: string
}
PasskeyNotImplementedEncoded
{
  _tag: "PasskeyNotImplemented"
  error: string
  details: string
  todoImplementation: {
    webauthn: string
    challengeGeneration: string
    credentialStorage: string
    userVerification: string
  }
}
TestCreateBadRequestEncoded
{
  _tag: "TestCreateBadRequest"
  error: string
}
TestCreateFailureEncoded
{
  _tag: "TestCreateFailure"
  error: string
  message: string
}
UnauthorizedEncoded
{
  _tag: "Unauthorized"
  message: string
}

इस समूह को कॉल किया जा रहा है

ऑपरेशन आईडी का फॉर्म है auth.<name>. जनरेट किया गया प्रॉमिस SDK (@cadcamfun/api/sdk) उनमें से अधिकांश को इस रूप में उजागर करता है client.<namespace>.<method>(input), कहाँ input पथ पैरामीटर और बॉडी फ़ील्ड की एक सपाट वस्तु है; प्रत्येक कार्ड का एसडीके उदाहरण सटीक एक्सेसर और इनपुट प्रकार दिखाता है। मल्टीपार्ट अपलोड, बाइनरी या जावास्क्रिप्ट प्रतिक्रियाएँ और कच्चे वेबहुक उत्पन्न नहीं होते हैं; वे कार्ड दिखाते हैं fetch इसके बजाय.

प्रॉमिस एसडीके से त्रुटियाँ
import { CadCam, ClientError } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

try {
  await client.projects.list()
} catch (error) {
  if (error instanceof ClientError) {
    // Transport | UnexpectedStatus | UnsupportedContentType | MalformedResponse | SseEventTooLarge
  } else {
    // a declared error body: switch on error._tag
  }
}

समस्या निवारण

लक्षणसंभावित कारणहल करना
हर कॉल पर 401पिछले लॉन्च से टोकन, या गायब Bearer उपसर्गभेजना Authorization: Bearer <token> टोकन के साथ साइडकार की शुरुआत की गई।
कुछ होने से पहले 400बॉडी या पैरामीटर स्कीमा से मेल नहीं खाताकार्ड पर अनुरोध स्कीमा के साथ पेलोड की तुलना करें।
कहीं और दिखने वाले रिकॉर्ड पर 403 या 404एक्टिंग अकाउंट अलग हैसही भेजो x-session-token, या उस स्थानीय प्रोफ़ाइल का उपयोग करें जो रिकॉर्ड का स्वामी है।
409विरोधाभासी स्थिति, जैसे डुप्लिकेट नाम या पुराना शाखा प्रमुखसंसाधन को दोबारा पढ़ें और वर्तमान डेटा के साथ पुनः प्रयास करें।
कोशिश करें यह कहता है "सीओआरएस द्वारा अवरुद्ध"दस्तावेज़ गैर-लूपबैक मूल से परोसे जाते हैंदस्तावेज़ों को स्थानीय रूप से चलाएँ या अनुरोध को कर्ल के रूप में कॉपी करें।
कनेक्शन नहीं हो सकासाइडकार एक नए बंदरगाह पर फिर से शुरू हुईनए से पोर्ट पढ़ें ready पंक्ति.