ドキュメント
ユーザー
プロファイル、アカウント リソース、API キー、トークン レコード、パスワード、アカウントの削除。
英語から自動翻訳されています。 英語の原文を見る
これらのリクエストを独自の実行中のサイドカーに送信します。値はこのブラウザ内に残ります。
仕組み
サイドカーは起動時に選択されたループバック ポートをリッスンし、それをそのポートに出力します。 ready ライン;その URL を使用し、 CADCAMFUN_TOKEN で始まりました。リクエストはこのページからそのアドレスに直接送信されます。
サイドカーは CORS ヘッダーを Tauri オリジンと http://localhost または http://127.0.0.1 どのポートでも。ホストされているドキュメントからはブラウザーが応答をブロックするため、ドキュメントをローカルで実行します (bun run dev で packages/web) プレイグラウンドを使用するか、リクエストをcurlとしてコピーします。実際のデータに触れることなく実験するには、次のようにしてサイドカーを開始します。 CADCAMFUN_DATA_DIR 使い捨てディレクトリを指す - を参照 aPI のチュートリアル.
運営
18 エンドポイント( user サイドカー自体から生成されたグループ OpenAPIドキュメント。保護された操作には時間がかかります Authorization: Bearer $CADCAMFUN_TOKEN;見る 認証。行動と制限は次のとおりです サブシステムガイド.
| 得る | /api/user/profile | user.profile |
| 置く | /api/user/profile | user.updateProfile |
| 得る | /api/user/stats | user.stats |
| 得る | /api/user/components | user.components |
| 得る | /api/user/projects | user.projects |
| 得る | /api/user/toolpaths | user.toolpaths |
| 得る | /api/user/organizations | user.organizations |
| 得る | /api/user/api-keys | user.apiKeys |
| 役職 | /api/user/api-keys | user.createApiKey |
| 消去 | /api/user/api-keys | user.revokeApiKey |
| 消去 | /api/user/delete-account | user.deleteAccount |
| 置く | /api/user/password | user.password |
| 得る | /api/user/tokens | user.tokens |
| 役職 | /api/user/tokens | user.createToken |
| 得る | /api/user/verify-change | user.verifyChange |
| 得る | /api/user/git-profile | user.gitProfile |
| 置く | /api/user/git-profile | user.updateGitProfile |
| 得る | /api/user/{id} | user.byId |
/api/user/profile
user.profile 必要 Authorization: Bearer <token>.
200 物体 application/json
{ id: string name: string | null email: string | null image: string | null bio: string | null location: string | null website: string | null company: string | null title: string | null publicProfile: boolean showEmail: boolean createdAt: string _count: { projects: number | "Infinity" | "-Infinity" | "NaN" } }
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
応答例 捕獲 · 200
{
"id": "c942817d-0162-4291-84ff-77321d387acc",
"name": "Local user",
"email": "local@cadcamfun.local",
"image": null,
"bio": null,
"location": null,
"website": null,
"company": null,
"title": null,
"publicProfile": true,
"showEmail": false,
"createdAt": "2026-10-15T04:52:06.538Z",
"_count": {
"projects": 0
}
} SDKの例
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.user.profile() curl
curl --request GET "${CADCAMFUN_URL}/api/user/profile" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
user.updateProfile 必要 Authorization: Bearer <token>.
{ name?: string | null bio?: string | null location?: string | null website?: string | null company?: string | null title?: string | null publicProfile?: string | null showEmail?: string | null profileImage?: string[] | null }
200 物体 application/json
{ message: string user: { id: string name: string | null email: string | null image: string | null bio: string | null location: string | null website: string | null company: string | null title: string | null publicProfile: boolean showEmail: boolean updatedAt: string } name: string | null email: string | null image: string | null }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
例を取得する
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/user/profile`, {
method: "PUT",
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
}) curl
curl --request PUT "${CADCAMFUN_URL}/api/user/profile" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: multipart/form-data" \
--data-binary @request-body 試してみてください
この操作は multipart/form-data を受け取ります。 curl または fetch の例を使用します。
/api/user/stats
user.stats 必要 Authorization: Bearer <token>.
200 物体 application/json
{ projectsCount: number | "Infinity" | "-Infinity" | "NaN" drawingsCount: number | "Infinity" | "-Infinity" | "NaN" toolpathsCount: number | "Infinity" | "-Infinity" | "NaN" componentsCount: number | "Infinity" | "-Infinity" | "NaN" totalDesigns: number | "Infinity" | "-Infinity" | "NaN" memberSince: string }
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 KeyedInternalEncoded application/json
KeyedInternalEncoded
応答例 捕獲 · 200
{
"projectsCount": 0,
"drawingsCount": 0,
"toolpathsCount": 0,
"componentsCount": 0,
"totalDesigns": 0,
"memberSince": "2026-10-15T04:52:06.538Z"
} SDKの例
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.user.stats() curl
curl --request GET "${CADCAMFUN_URL}/api/user/stats" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
/api/user/components
user.components 必要 Authorization: Bearer <token>.
200 配列<オブジェクト> application/json
Array<{ id: string name: string description: string | null createdAt: string updatedAt: string thumbnail: string | null projectId: string | null }>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
応答例 捕獲 · 200
[] SDKの例
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.user.components() curl
curl --request GET "${CADCAMFUN_URL}/api/user/components" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
/api/user/projects
user.projects 必要 Authorization: Bearer <token>.
200 配列<オブジェクト> application/json
Array<{ id: string name: string description: string | null createdAt: string updatedAt: string }>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
応答例 捕獲 · 200
[] SDKの例
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.user.projects() curl
curl --request GET "${CADCAMFUN_URL}/api/user/projects" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
/api/user/toolpaths
user.toolpaths 必要 Authorization: Bearer <token>.
200 配列<オブジェクト> application/json
Array<{ id: string name: string description: string | null createdAt: string updatedAt: string thumbnail: string | null projectId: string | null }>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
応答例 捕獲 · 200
[] SDKの例
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.user.toolpaths() curl
curl --request GET "${CADCAMFUN_URL}/api/user/toolpaths" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
/api/user/organizations
user.organizations 必要 Authorization: Bearer <token>.
200 配列<オブジェクト> application/json
Array<{ id: string name: string description: string | null createdAt: string updatedAt: string role: string userCount: number | "Infinity" | "-Infinity" | "NaN" projectCount: number | "Infinity" | "-Infinity" | "NaN" }>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
応答例 捕獲 · 200
[] SDKの例
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.user.organizations() curl
curl --request GET "${CADCAMFUN_URL}/api/user/organizations" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
/api/user/api-keys
user.apiKeys 必要 Authorization: Bearer <token>.
200 配列<オブジェクト> application/json
Array<{ id: string name: string createdAt: string lastUsed: string | null expiresAt: string | null }>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
応答例 捕獲 · 200
[] SDKの例
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.user.apiKeys() curl
curl --request GET "${CADCAMFUN_URL}/api/user/api-keys" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
user.createApiKey 必要 Authorization: Bearer <token>.
{ name?: unknown | null }
201 物体 application/json
{ message: string apiKey: string name: string }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// UserCreateApiKeyInput
const result = await client.user.createApiKey({
name: null
}) curl
curl --request POST "${CADCAMFUN_URL}/api/user/api-keys" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
user.revokeApiKey 必要 Authorization: Bearer <token>.
| 名前 | で | タイプ | 必須 |
|---|---|---|---|
| keyId | クエリ | 弦 | null | オプション |
200 物体 application/json
{ message: string }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// UserRevokeApiKeyInput
const result = await client.user.revokeApiKey({}) curl
curl --request DELETE "${CADCAMFUN_URL}/api/user/api-keys" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
/api/user/delete-account
user.deleteAccount 必要 Authorization: Bearer <token>.
200 物体 application/json
{ message: string }
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDKの例
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.user.deleteAccount() curl
curl --request DELETE "${CADCAMFUN_URL}/api/user/delete-account" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
/api/user/password
user.password 必要 Authorization: Bearer <token>.
{ currentPassword?: string | null newPassword?: string | null }
200 物体 application/json
{ message: string }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// UserPasswordInput
const result = await client.user.password({
currentPassword: "",
newPassword: ""
}) curl
curl --request PUT "${CADCAMFUN_URL}/api/user/password" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
/api/user/tokens
user.tokens 必要 Authorization: Bearer <token>.
200 物体 application/json
{ tokens: Array<{ id: string name: string prefix: string permissions: string[] createdAt: string lastUsed?: string | null expiresAt?: string | null isActive: boolean }> }
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 KeyedInternalEncoded application/json
KeyedInternalEncoded
応答例 捕獲 · 200
{
"tokens": [
{
"id": "token-1",
"name": "Development Token",
"prefix": "cad_dev_abc123",
"permissions": [
"read:projects",
"write:drawings",
"read:toolpaths"
],
"createdAt": "2026-10-08T04:52:23.364Z",
"lastUsed": "2026-10-15T03:52:23.364Z",
"isActive": true
},
{
"id": "token-2",
"name": "Mobile App Token",
"prefix": "cad_mobile_xyz789",
"permissions": [
"read:projects",
"write:toolpaths"
],
"createdAt": "2026-10-01T04:52:23.364Z",
"lastUsed": "2026-10-15T01:52:23.364Z",
"expiresAt": "2026-11-14T04:52:23.364Z",
"isActive": true
},
{
"id": "token-3",
"name": "Analytics Integration",
"prefix": "cad_analytics_def456",
"permissions": [
"read:analytics",
"read:usage"
],
"createdAt": "2026-09-24T04:52:23.364Z",
"expiresAt": "2026-10-14T04:52:23.364Z",
"isActive": false
}
]
} SDKの例
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.user.tokens() curl
curl --request GET "${CADCAMFUN_URL}/api/user/tokens" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
user.createToken 必要 Authorization: Bearer <token>.
{ name?: string | null permissions?: unknown | null expiresIn?: number | "Infinity" | "-Infinity" | "NaN" | null }
201 物体 application/json
{ token: { id: string name: string prefix: string permissions: string[] createdAt: string lastUsed?: string | null expiresAt?: string | null isActive: boolean } fullToken: string }
400 TokenBadRequestEncoded application/json
TokenBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 KeyedInternalEncoded application/json
KeyedInternalEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// UserCreateTokenInput
const result = await client.user.createToken({
name: "",
permissions: null,
expiresIn: 0
}) curl
curl --request POST "${CADCAMFUN_URL}/api/user/tokens" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
/api/user/verify-change
user.verifyChange 必要 Authorization: Bearer <token>.
| 名前 | で | タイプ | 必須 |
|---|---|---|---|
| トークン | クエリ | 弦 | null | オプション |
| タイプ | クエリ | 弦 | null | オプション |
| パスワード | クエリ | 弦 | null | オプション |
200 物体 application/json
{ message: string }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
応答例 捕獲 · 400
{
"_tag": "BadRequest",
"message": "Token and verification type are required"
} SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// UserVerifyChangeInput
const result = await client.user.verifyChange({}) curl
curl --request GET "${CADCAMFUN_URL}/api/user/verify-change" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
/api/user/git-profile
user.gitProfile 必要 Authorization: Bearer <token>.
200 物体 application/json
{ name: string email: string }
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
例を取得する
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/user/git-profile`, {
method: "GET",
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
}) curl
curl --request GET "${CADCAMFUN_URL}/api/user/git-profile" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
user.updateGitProfile 必要 Authorization: Bearer <token>.
{ name: string email: string }
200 物体 application/json
{ name: string email: string }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
例を取得する
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/user/git-profile`, {
method: "PUT",
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
}) curl
curl --request PUT "${CADCAMFUN_URL}/api/user/git-profile" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
/api/user
user.byId 必要 Authorization: Bearer <token>.
| 名前 | で | タイプ | 必須 |
|---|---|---|---|
| iD | パス | 弦 | 必須 |
200 物体 application/json
{ id: string name: string | null email: string | null image: string | null createdAt: string organizations: Array<{ id: string name: string role: string }> }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// UserByIdInput
const result = await client.user.byId({
id: "<id>"
}) curl
curl --request GET "${CADCAMFUN_URL}/api/user/<id>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
スキーマ
このグループのパラメータ、本体、および応答から到達可能な名前付きスキーマ。あ ? オプションのフィールドをマークします。 | null null 値が存在する可能性があるフィールドにマークを付けます。
BadRequestEncoded{ _tag: "BadRequest" message: string }
InternalErrorEncoded{ _tag: "InternalError" message: string }
KeyedInternalEncoded{ _tag: "KeyedInternal" error: string }
NotFoundEncoded{ _tag: "NotFound" message: string }
TokenBadRequestEncoded{ _tag: "TokenBadRequest" error: string }
このグループに電話をかける
オペレーション ID の形式は次のとおりです。 user.<name>。生成された Promise SDK (@cadcamfun/api/sdk) それらのほとんどを次のように公開します client.<namespace>.<method>(input)、 どこ input パスパラメータとボディフィールドの 1 つのフラットオブジェクトです。各カードの SDK の例は、正確なアクセサーと入力タイプを示しています。マルチパート アップロード、バイナリまたは JavaScript 応答、生の Webhook は生成されません。それらのカードが示しているのは 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 | 重複した名前や古いブランチヘッドなどの矛盾した状態 | リソースを再読み込みし、現在のデータで再試行します。 |
| 「CORS によってブロックされました」と表示されてみてください | ドキュメントは非ループバックオリジンから提供されます | ドキュメントをローカルで実行するか、リクエストをcurlとしてコピーします。 |
| 接続拒否 | サイドカーが新しいポートで再起動されました | 新しいポートからポートを読み取ります ready 行。 |