Skip to content
CADCAMFUN
Docs

Documentation

Production costs

Estimates, calculation requests, material costs, operation costs, and tool-wear records.

Playground

Send these requests to your own running sidecar. Values stay in this browser.

Not connected
How this works

The sidecar listens on a loopback port chosen at startup and prints it in its ready line; use that URL and the CADCAMFUN_TOKEN it was started with. Requests go straight from this page to that address.

The sidecar sends CORS headers only to the Tauri origins and to http://localhost or http://127.0.0.1 on any port. From the hosted docs the browser blocks the response, so run the docs locally (bun run dev in packages/web) to use the playground, or copy the request as curl. To experiment without touching real data, start the sidecar with CADCAMFUN_DATA_DIR pointed at a throwaway directory — see the API walkthrough.

Operations

21 endpoints in the production-costs group, generated from the sidecar's own OpenAPI document. Protected operations take Authorization: Bearer $CADCAMFUN_TOKEN; see authentication. Behaviour and limits are in the subsystem guide.

get /api/production-costs/estimates production-costs.listEstimates
post /api/production-costs/estimates production-costs.createEstimate
get /api/production-costs/estimates/{id} production-costs.getEstimate
put /api/production-costs/estimates/{id} production-costs.updateEstimate
delete /api/production-costs/estimates/{id} production-costs.deleteEstimate
post /api/production-costs/estimates/calculate production-costs.calculateEstimate
get /api/production-costs/material-costs production-costs.listMaterialCosts
post /api/production-costs/material-costs production-costs.createMaterialCost
get /api/production-costs/material-costs/{id} production-costs.getMaterialCost
put /api/production-costs/material-costs/{id} production-costs.updateMaterialCost
delete /api/production-costs/material-costs/{id} production-costs.deleteMaterialCost
get /api/production-costs/operation-costs production-costs.listOperationCosts
post /api/production-costs/operation-costs production-costs.createOperationCost
get /api/production-costs/operation-costs/{id} production-costs.getOperationCost
put /api/production-costs/operation-costs/{id} production-costs.updateOperationCost
delete /api/production-costs/operation-costs/{id} production-costs.deleteOperationCost
get /api/production-costs/tool-wear production-costs.listToolWear
post /api/production-costs/tool-wear production-costs.createToolWear
get /api/production-costs/tool-wear/{id} production-costs.getToolWear
put /api/production-costs/tool-wear/{id} production-costs.updateToolWear
delete /api/production-costs/tool-wear/{id} production-costs.deleteToolWear
Production costs operations in 3D Drag to orbit · scroll to zoom · right-drag to pan
One block per operation (21), stacked per resource section of this page and coloured by method: green GET, orange POST, blue PUT, violet PATCH, red DELETE. Generated from the OpenAPI document at build time.

/api/production-costs/estimates

get /api/production-costs/estimates # production-costs.listEstimates

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
toolpathId query string | null optional
projectId query string | null optional
organizationId query "null" | string | null optional
Responses
200 Array<object> application/json
Array<{
  id: string
  createdAt: string
  updatedAt: string
  materialCost: number | "Infinity" | "-Infinity" | "NaN"
  toolWearCost: number | "Infinity" | "-Infinity" | "NaN"
  machineTime: number | "Infinity" | "-Infinity" | "NaN"
  machineTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  operatorTime: number | "Infinity" | "-Infinity" | "NaN"
  operatorTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  setupCost: number | "Infinity" | "-Infinity" | "NaN"
  totalCost: number | "Infinity" | "-Infinity" | "NaN"
  currencyCode: string
  ownerId: string | null
  organizationId: string | null
  toolpathId: string
  details: unknown
  operationCostId: string | null
  costSettingsId?: string | null
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
  toolpath: {
    id: string
    name: string
    projectId?: string | null
  }
  operationCost: {
    id: string
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
    currencyCode: string
    name: string
    machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
    operatorHourlyRate: number | "NaN"
    setupTime: number | "NaN"
  } | null
}>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Example response captured · 200
GET /api/production-costs/estimates
[]
SDK example
production-costs.listEstimates
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsListEstimatesInput
const result = await client["production-costs"].listEstimates({})
curl
GET /api/production-costs/estimates
curl --request GET "${CADCAMFUN_URL}/api/production-costs/estimates" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Try it
post /api/production-costs/estimates # production-costs.createEstimate

Requires Authorization: Bearer <token>.

Request body · required · application/json
{
  toolpathId: string
  totalCost: number | "Infinity" | "-Infinity" | "NaN"
  materialCost?: number | "Infinity" | "-Infinity" | "NaN" | null
  toolWearCost?: number | "Infinity" | "-Infinity" | "NaN" | null
  machineTime?: number | "Infinity" | "-Infinity" | "NaN" | null
  machineTimeCost?: number | "Infinity" | "-Infinity" | "NaN" | null
  operatorTime?: number | "Infinity" | "-Infinity" | "NaN" | null
  operatorTimeCost?: number | "Infinity" | "-Infinity" | "NaN" | null
  setupCost?: number | "Infinity" | "-Infinity" | "NaN" | null
  currencyCode?: string | null
  details?: unknown | null
  operationCostId?: string | null
  costSettingsId?: string | null
  organizationId?: string | null
}
Responses
201 object application/json
{
  id: string
  createdAt: string
  updatedAt: string
  materialCost: number | "Infinity" | "-Infinity" | "NaN"
  toolWearCost: number | "Infinity" | "-Infinity" | "NaN"
  machineTime: number | "Infinity" | "-Infinity" | "NaN"
  machineTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  operatorTime: number | "Infinity" | "-Infinity" | "NaN"
  operatorTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  setupCost: number | "Infinity" | "-Infinity" | "NaN"
  totalCost: number | "Infinity" | "-Infinity" | "NaN"
  currencyCode: string
  ownerId: string | null
  organizationId: string | null
  toolpathId: string
  details: unknown
  operationCostId: string | null
  costSettingsId?: string | null
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
  toolpath: {
    id: string
    name: string
    projectId?: string | null
  }
  operationCost: {
    id: string
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
    currencyCode: string
    name: string
    machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
    operatorHourlyRate: number | "NaN"
    setupTime: number | "NaN"
  } | null
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.createEstimate
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsCreateEstimateInput
const result = await client["production-costs"].createEstimate({
  toolpathId: "",
  totalCost: 0,
  materialCost: 0,
  toolWearCost: 0,
  machineTime: 0,
  machineTimeCost: 0,
  operatorTime: 0,
  operatorTimeCost: 0,
  setupCost: 0,
  currencyCode: "",
  details: null,
  operationCostId: "",
  costSettingsId: "",
  organizationId: ""
})
curl
POST /api/production-costs/estimates
curl --request POST "${CADCAMFUN_URL}/api/production-costs/estimates" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Try it
get /api/production-costs/estimates/{id} # production-costs.getEstimate

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
id path string required
Responses
200 object application/json
{
  id: string
  createdAt: string
  updatedAt: string
  materialCost: number | "Infinity" | "-Infinity" | "NaN"
  toolWearCost: number | "Infinity" | "-Infinity" | "NaN"
  machineTime: number | "Infinity" | "-Infinity" | "NaN"
  machineTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  operatorTime: number | "Infinity" | "-Infinity" | "NaN"
  operatorTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  setupCost: number | "Infinity" | "-Infinity" | "NaN"
  totalCost: number | "Infinity" | "-Infinity" | "NaN"
  currencyCode: string
  ownerId: string | null
  organizationId: string | null
  toolpathId: string
  details: unknown
  operationCostId: string | null
  costSettingsId?: string | null
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
  toolpath: {
    id: string
    name: string
    projectId?: string | null
  }
  operationCost: {
    id: string
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
    currencyCode: string
    name: string
    machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
    operatorHourlyRate: number | "NaN"
    setupTime: number | "NaN"
  } | null
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.getEstimate
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsGetEstimateInput
const result = await client["production-costs"].getEstimate({
  id: "<id>"
})
curl
GET /api/production-costs/estimates/{id}
curl --request GET "${CADCAMFUN_URL}/api/production-costs/estimates/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Try it
put /api/production-costs/estimates/{id} # production-costs.updateEstimate

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
id path string required
Request body · required · application/json
{
  currencyCode?: string | null
  details?: unknown | null
  notes?: string | null
}
Responses
200 object application/json
{
  id: string
  createdAt: string
  updatedAt: string
  materialCost: number | "Infinity" | "-Infinity" | "NaN"
  toolWearCost: number | "Infinity" | "-Infinity" | "NaN"
  machineTime: number | "Infinity" | "-Infinity" | "NaN"
  machineTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  operatorTime: number | "Infinity" | "-Infinity" | "NaN"
  operatorTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  setupCost: number | "Infinity" | "-Infinity" | "NaN"
  totalCost: number | "Infinity" | "-Infinity" | "NaN"
  currencyCode: string
  ownerId: string | null
  organizationId: string | null
  toolpathId: string
  details: unknown
  operationCostId: string | null
  costSettingsId?: string | null
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
  toolpath: {
    id: string
    name: string
    projectId?: string | null
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.updateEstimate
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsUpdateEstimateInput
const result = await client["production-costs"].updateEstimate({
  id: "<id>",
  currencyCode: "",
  details: null,
  notes: ""
})
curl
PUT /api/production-costs/estimates/{id}
curl --request PUT "${CADCAMFUN_URL}/api/production-costs/estimates/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Try it
delete /api/production-costs/estimates/{id} # production-costs.deleteEstimate

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
id path string required
Responses
200 object application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.deleteEstimate
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsDeleteEstimateInput
const result = await client["production-costs"].deleteEstimate({
  id: "<id>"
})
curl
DELETE /api/production-costs/estimates/{id}
curl --request DELETE "${CADCAMFUN_URL}/api/production-costs/estimates/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Try it
post /api/production-costs/estimates/calculate # production-costs.calculateEstimate

Requires Authorization: Bearer <token>.

Request body · required · application/json
{
  toolpathId: string
  costSettingsId?: string | null
  organizationId?: string | null
}
Responses
200 object application/json
{
  materialCost: number | "Infinity" | "-Infinity" | "NaN"
  toolWearCost: number | "Infinity" | "-Infinity" | "NaN"
  machineTime: number | "Infinity" | "-Infinity" | "NaN"
  machineTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  operatorTime: number | "Infinity" | "-Infinity" | "NaN"
  operatorTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  setupCost: number | "Infinity" | "-Infinity" | "NaN"
  totalCost: number | "Infinity" | "-Infinity" | "NaN"
  currencyCode: string
  ownerId: string | null
  organizationId: string | null
  toolpathId: string
  details: {
    sourceSettingsId?: string | null
    inputs: {
      toolpathId: string
      toolId: string | null
      materialId: string | null
    }
    calculatedValues: {
      totalPathLengthMm: number | "Infinity" | "-Infinity" | "NaN"
      materialVolumeM3: number | "Infinity" | "-Infinity" | "NaN"
      feedRateMmMin: number | "Infinity" | "-Infinity" | "NaN"
      machineTimeMinutes: number | "Infinity" | "-Infinity" | "NaN"
      operatorTimeMinutes: number | "Infinity" | "-Infinity" | "NaN"
      totalSetupTimeMinutes: number | "Infinity" | "-Infinity" | "NaN"
    }
    costBreakdown: {
      material: number | "Infinity" | "-Infinity" | "NaN"
      toolWear: number | "Infinity" | "-Infinity" | "NaN"
      machineRun: number | "Infinity" | "-Infinity" | "NaN"
      operator: number | "Infinity" | "-Infinity" | "NaN"
      setup: number | "Infinity" | "-Infinity" | "NaN"
    }
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.calculateEstimate
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsCalculateEstimateInput
const result = await client["production-costs"].calculateEstimate({
  toolpathId: "",
  costSettingsId: "",
  organizationId: ""
})
curl
POST /api/production-costs/estimates/calculate
curl --request POST "${CADCAMFUN_URL}/api/production-costs/estimates/calculate" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Try it

/api/production-costs/material-costs

get /api/production-costs/material-costs # production-costs.listMaterialCosts

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
materialId query string | null optional
organizationId query "null" | string | null optional
Responses
200 Array<object> application/json
Array<{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  materialId: string
  costPerUnit: number | "Infinity" | "-Infinity" | "NaN"
  wasteFactor: number | "Infinity" | "-Infinity" | "NaN"
  minimumCharge: number | "Infinity" | "-Infinity" | "NaN"
  material: {
    id: string
    name: string
    description: string | null
    properties: unknown
    isPublic: boolean
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
  }
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
}>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Example response captured · 200
GET /api/production-costs/material-costs
[]
SDK example
production-costs.listMaterialCosts
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsListMaterialCostsInput
const result = await client["production-costs"].listMaterialCosts({})
curl
GET /api/production-costs/material-costs
curl --request GET "${CADCAMFUN_URL}/api/production-costs/material-costs" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Try it
post /api/production-costs/material-costs # production-costs.createMaterialCost

Requires Authorization: Bearer <token>.

Request body · required · application/json
{
  costPerUnit: number | "Infinity" | "-Infinity" | "NaN"
  wasteFactor?: number | "Infinity" | "-Infinity" | "NaN" | null
  minimumCharge?: number | "Infinity" | "-Infinity" | "NaN" | null
  currencyCode?: string | null
  materialId: string
  organizationId?: string | null
}
Responses
201 object application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  materialId: string
  costPerUnit: number | "Infinity" | "-Infinity" | "NaN"
  wasteFactor: number | "Infinity" | "-Infinity" | "NaN"
  minimumCharge: number | "Infinity" | "-Infinity" | "NaN"
  material: {
    id: string
    name: string
    description: string | null
    properties: unknown
    isPublic: boolean
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.createMaterialCost
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsCreateMaterialCostInput
const result = await client["production-costs"].createMaterialCost({
  costPerUnit: 0,
  wasteFactor: 0,
  minimumCharge: 0,
  currencyCode: "",
  materialId: "",
  organizationId: ""
})
curl
POST /api/production-costs/material-costs
curl --request POST "${CADCAMFUN_URL}/api/production-costs/material-costs" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Try it
get /api/production-costs/material-costs/{id} # production-costs.getMaterialCost

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
id path string required
Responses
200 object | null application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  materialId: string
  costPerUnit: number | "Infinity" | "-Infinity" | "NaN"
  wasteFactor: number | "NaN"
  minimumCharge: number | "NaN"
  material: {
    id: string
    name: string
    description: string | null
    properties: unknown
    isPublic: boolean
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
  }
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
} | null
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.getMaterialCost
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsGetMaterialCostInput
const result = await client["production-costs"].getMaterialCost({
  id: "<id>"
})
curl
GET /api/production-costs/material-costs/{id}
curl --request GET "${CADCAMFUN_URL}/api/production-costs/material-costs/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Try it
put /api/production-costs/material-costs/{id} # production-costs.updateMaterialCost

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
id path string required
Request body · required · application/json
{
  costPerUnit?: number | "Infinity" | "-Infinity" | "NaN" | null
  wasteFactor?: number | "Infinity" | "-Infinity" | "NaN" | null
  minimumCharge?: number | "Infinity" | "-Infinity" | "NaN" | null
  currencyCode?: string | null
}
Responses
200 object application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  materialId: string
  costPerUnit: number | "Infinity" | "-Infinity" | "NaN"
  wasteFactor: number | "Infinity" | "-Infinity" | "NaN"
  minimumCharge: number | "Infinity" | "-Infinity" | "NaN"
  material: {
    id: string
    name: string
    description: string | null
    properties: unknown
    isPublic: boolean
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.updateMaterialCost
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsUpdateMaterialCostInput
const result = await client["production-costs"].updateMaterialCost({
  id: "<id>",
  costPerUnit: 0,
  wasteFactor: 0,
  minimumCharge: 0,
  currencyCode: ""
})
curl
PUT /api/production-costs/material-costs/{id}
curl --request PUT "${CADCAMFUN_URL}/api/production-costs/material-costs/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Try it
delete /api/production-costs/material-costs/{id} # production-costs.deleteMaterialCost

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
id path string required
Responses
200 object application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.deleteMaterialCost
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsDeleteMaterialCostInput
const result = await client["production-costs"].deleteMaterialCost({
  id: "<id>"
})
curl
DELETE /api/production-costs/material-costs/{id}
curl --request DELETE "${CADCAMFUN_URL}/api/production-costs/material-costs/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Try it

/api/production-costs/operation-costs

get /api/production-costs/operation-costs # production-costs.listOperationCosts

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
organizationId query "null" | string | null optional
Responses
200 Array<object> application/json
Array<{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  name: string
  machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  operatorHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  setupTime: number | "Infinity" | "-Infinity" | "NaN"
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
}>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Example response captured · 200
GET /api/production-costs/operation-costs
[]
SDK example
production-costs.listOperationCosts
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsListOperationCostsInput
const result = await client["production-costs"].listOperationCosts({})
curl
GET /api/production-costs/operation-costs
curl --request GET "${CADCAMFUN_URL}/api/production-costs/operation-costs" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Try it
post /api/production-costs/operation-costs # production-costs.createOperationCost

Requires Authorization: Bearer <token>.

Request body · required · application/json
{
  name: string
  machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  operatorHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  setupTime?: number | "Infinity" | "-Infinity" | "NaN" | null
  currencyCode?: string | null
  organizationId?: string | null
}
Responses
201 object application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  name: string
  machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  operatorHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  setupTime: number | "Infinity" | "-Infinity" | "NaN"
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.createOperationCost
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsCreateOperationCostInput
const result = await client["production-costs"].createOperationCost({
  name: "",
  machineHourlyRate: 0,
  operatorHourlyRate: 0,
  setupTime: 0,
  currencyCode: "",
  organizationId: ""
})
curl
POST /api/production-costs/operation-costs
curl --request POST "${CADCAMFUN_URL}/api/production-costs/operation-costs" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Try it
get /api/production-costs/operation-costs/{id} # production-costs.getOperationCost

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
id path string required
Responses
200 object | null application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  name: string
  machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  operatorHourlyRate: number | "NaN"
  setupTime: number | "NaN"
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
} | null
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.getOperationCost
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsGetOperationCostInput
const result = await client["production-costs"].getOperationCost({
  id: "<id>"
})
curl
GET /api/production-costs/operation-costs/{id}
curl --request GET "${CADCAMFUN_URL}/api/production-costs/operation-costs/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Try it
put /api/production-costs/operation-costs/{id} # production-costs.updateOperationCost

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
id path string required
Request body · required · application/json
{
  name?: string | null
  machineHourlyRate?: number | "Infinity" | "-Infinity" | "NaN" | null
  operatorHourlyRate?: number | "Infinity" | "-Infinity" | "NaN" | null
  setupTime?: number | "Infinity" | "-Infinity" | "NaN" | null
  currencyCode?: string | null
}
Responses
200 object application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  name: string
  machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  operatorHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  setupTime: number | "Infinity" | "-Infinity" | "NaN"
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.updateOperationCost
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsUpdateOperationCostInput
const result = await client["production-costs"].updateOperationCost({
  id: "<id>",
  name: "",
  machineHourlyRate: 0,
  operatorHourlyRate: 0,
  setupTime: 0,
  currencyCode: ""
})
curl
PUT /api/production-costs/operation-costs/{id}
curl --request PUT "${CADCAMFUN_URL}/api/production-costs/operation-costs/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Try it
delete /api/production-costs/operation-costs/{id} # production-costs.deleteOperationCost

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
id path string required
Responses
200 object application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.deleteOperationCost
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsDeleteOperationCostInput
const result = await client["production-costs"].deleteOperationCost({
  id: "<id>"
})
curl
DELETE /api/production-costs/operation-costs/{id}
curl --request DELETE "${CADCAMFUN_URL}/api/production-costs/operation-costs/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Try it

/api/production-costs/tool-wear

get /api/production-costs/tool-wear # production-costs.listToolWear

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
toolId query string | null optional
organizationId query "null" | string | null optional
Responses
200 Array<object> application/json
Array<{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  toolId: string
  wearRatePerMeter: number | "Infinity" | "-Infinity" | "NaN"
  replacementCost: number | "Infinity" | "-Infinity" | "NaN"
  replacementThreshold: number | "Infinity" | "-Infinity" | "NaN"
  tool: {
    id: string
    name: string
    type: string
    diameter: number | "Infinity" | "-Infinity" | "NaN"
    material: string
    numberOfFlutes: number | "Infinity" | "-Infinity" | "NaN" | null
    maxRPM: number | "Infinity" | "-Infinity" | "NaN" | null
    coolantType: string | null
    cuttingLength: number | "Infinity" | "-Infinity" | "NaN" | null
    totalLength: number | "Infinity" | "-Infinity" | "NaN" | null
    shankDiameter: number | "Infinity" | "-Infinity" | "NaN" | null
    cornerRadius?: number | "Infinity" | "-Infinity" | "NaN" | null
    tipAngle?: number | "Infinity" | "-Infinity" | "NaN" | null
    threadPitch?: number | "Infinity" | "-Infinity" | "NaN" | null
    holderDiameter?: number | "Infinity" | "-Infinity" | "NaN" | null
    holderLength?: number | "Infinity" | "-Infinity" | "NaN" | null
    stickout?: number | "Infinity" | "-Infinity" | "NaN" | null
    notes: string | null
    isPublic: boolean
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
  }
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
}>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Example response captured · 200
GET /api/production-costs/tool-wear
[]
SDK example
production-costs.listToolWear
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsListToolWearInput
const result = await client["production-costs"].listToolWear({})
curl
GET /api/production-costs/tool-wear
curl --request GET "${CADCAMFUN_URL}/api/production-costs/tool-wear" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Try it
post /api/production-costs/tool-wear # production-costs.createToolWear

Requires Authorization: Bearer <token>.

Request body · required · application/json
{
  wearRatePerMeter: number | "Infinity" | "-Infinity" | "NaN"
  replacementCost: number | "Infinity" | "-Infinity" | "NaN"
  replacementThreshold?: number | "Infinity" | "-Infinity" | "NaN" | null
  currencyCode?: string | null
  toolId: string
  organizationId?: string | null
}
Responses
201 object application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  toolId: string
  wearRatePerMeter: number | "Infinity" | "-Infinity" | "NaN"
  replacementCost: number | "Infinity" | "-Infinity" | "NaN"
  replacementThreshold: number | "Infinity" | "-Infinity" | "NaN"
  tool: {
    id: string
    name: string
    type: string
    diameter: number | "Infinity" | "-Infinity" | "NaN"
    material: string
    numberOfFlutes: number | "Infinity" | "-Infinity" | "NaN" | null
    maxRPM: number | "Infinity" | "-Infinity" | "NaN" | null
    coolantType: string | null
    cuttingLength: number | "Infinity" | "-Infinity" | "NaN" | null
    totalLength: number | "Infinity" | "-Infinity" | "NaN" | null
    shankDiameter: number | "Infinity" | "-Infinity" | "NaN" | null
    cornerRadius?: number | "Infinity" | "-Infinity" | "NaN" | null
    tipAngle?: number | "Infinity" | "-Infinity" | "NaN" | null
    threadPitch?: number | "Infinity" | "-Infinity" | "NaN" | null
    holderDiameter?: number | "Infinity" | "-Infinity" | "NaN" | null
    holderLength?: number | "Infinity" | "-Infinity" | "NaN" | null
    stickout?: number | "Infinity" | "-Infinity" | "NaN" | null
    notes: string | null
    isPublic: boolean
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.createToolWear
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsCreateToolWearInput
const result = await client["production-costs"].createToolWear({
  wearRatePerMeter: 0,
  replacementCost: 0,
  replacementThreshold: 0,
  currencyCode: "",
  toolId: "",
  organizationId: ""
})
curl
POST /api/production-costs/tool-wear
curl --request POST "${CADCAMFUN_URL}/api/production-costs/tool-wear" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Try it
get /api/production-costs/tool-wear/{id} # production-costs.getToolWear

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
id path string required
Responses
200 object | null application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  toolId: string
  wearRatePerMeter: number | "Infinity" | "-Infinity" | "NaN"
  replacementCost: number | "NaN"
  replacementThreshold: number | "NaN"
  tool: {
    id: string
    name: string
    type: string
    diameter: number | "NaN"
    material: string
    numberOfFlutes: number | "NaN" | null
    maxRPM: number | null
    coolantType: string | null
    cuttingLength: number | null
    totalLength: number | null
    shankDiameter: number | null
    cornerRadius?: number | null
    tipAngle?: number | null
    threadPitch?: number | null
    holderDiameter?: number | null
    holderLength?: number | null
    stickout?: number | null
    notes: string | null
    isPublic: boolean
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
  }
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
} | null
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.getToolWear
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsGetToolWearInput
const result = await client["production-costs"].getToolWear({
  id: "<id>"
})
curl
GET /api/production-costs/tool-wear/{id}
curl --request GET "${CADCAMFUN_URL}/api/production-costs/tool-wear/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Try it
put /api/production-costs/tool-wear/{id} # production-costs.updateToolWear

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
id path string required
Request body · required · application/json
{
  wearRatePerMeter?: number | "Infinity" | "-Infinity" | "NaN" | null
  replacementCost?: number | "Infinity" | "-Infinity" | "NaN" | null
  replacementThreshold?: number | "Infinity" | "-Infinity" | "NaN" | null
  currencyCode?: string | null
}
Responses
200 object application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  toolId: string
  wearRatePerMeter: number | "Infinity" | "-Infinity" | "NaN"
  replacementCost: number | "Infinity" | "-Infinity" | "NaN"
  replacementThreshold: number | "Infinity" | "-Infinity" | "NaN"
  tool: {
    id: string
    name: string
    type: string
    diameter: number | "Infinity" | "-Infinity" | "NaN"
    material: string
    numberOfFlutes: number | "Infinity" | "-Infinity" | "NaN" | null
    maxRPM: number | "Infinity" | "-Infinity" | "NaN" | null
    coolantType: string | null
    cuttingLength: number | "Infinity" | "-Infinity" | "NaN" | null
    totalLength: number | "Infinity" | "-Infinity" | "NaN" | null
    shankDiameter: number | "Infinity" | "-Infinity" | "NaN" | null
    cornerRadius?: number | "Infinity" | "-Infinity" | "NaN" | null
    tipAngle?: number | "Infinity" | "-Infinity" | "NaN" | null
    threadPitch?: number | "Infinity" | "-Infinity" | "NaN" | null
    holderDiameter?: number | "Infinity" | "-Infinity" | "NaN" | null
    holderLength?: number | "Infinity" | "-Infinity" | "NaN" | null
    stickout?: number | "Infinity" | "-Infinity" | "NaN" | null
    notes: string | null
    isPublic: boolean
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.updateToolWear
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsUpdateToolWearInput
const result = await client["production-costs"].updateToolWear({
  id: "<id>",
  wearRatePerMeter: 0,
  replacementCost: 0,
  replacementThreshold: 0,
  currencyCode: ""
})
curl
PUT /api/production-costs/tool-wear/{id}
curl --request PUT "${CADCAMFUN_URL}/api/production-costs/tool-wear/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Try it
delete /api/production-costs/tool-wear/{id} # production-costs.deleteToolWear

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
id path string required
Responses
200 object application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK example
production-costs.deleteToolWear
import { CadCam } from "@cadcamfun/api/sdk"

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

// ProductionCostsDeleteToolWearInput
const result = await client["production-costs"].deleteToolWear({
  id: "<id>"
})
curl
DELETE /api/production-costs/tool-wear/{id}
curl --request DELETE "${CADCAMFUN_URL}/api/production-costs/tool-wear/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Try it

Schemas

Named schemas reachable from this group's parameters, bodies and responses. A ? marks an optional field; | null marks a field that may be present with a null value.

BadRequestEncoded
{
  _tag: "BadRequest"
  message: string
}
ConflictEncoded
{
  _tag: "Conflict"
  message: string
}
ForbiddenEncoded
{
  _tag: "Forbidden"
  message: string
}
InternalErrorEncoded
{
  _tag: "InternalError"
  message: string
}
NotFoundEncoded
{
  _tag: "NotFound"
  message: string
}
UnauthorizedEncoded
{
  _tag: "Unauthorized"
  message: string
}

Calling this group

Operation ids have the form production-costs.<name>. The generated Promise SDK (@cadcamfun/api/sdk) exposes most of them as client.<namespace>.<method>(input), where input is one flat object of path parameters and body fields; each card's SDK example shows the exact accessor and input type. Multipart uploads, binary or JavaScript responses and raw webhooks are not generated; those cards show fetch instead.

Errors from the Promise SDK
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
  }
}

Troubleshooting

SymptomLikely causeFix
401 on every callToken from a previous launch, or missing Bearer prefixSend Authorization: Bearer <token> with the token the sidecar was started with.
400 before anything happensBody or parameter does not match the schemaCompare the payload with the request schema on the card.
403 or 404 on a record you can see elsewhereThe acting account differsSend the right x-session-token, or use the local profile that owns the record.
409Conflicting state, such as a duplicate name or a stale branch headRe-read the resource and retry with current data.
Try it says "blocked by CORS"The docs are served from a non-loopback originRun the docs locally or copy the request as curl.
Connection refusedThe sidecar restarted on a new portRead the port from the new ready line.