Skip to main content
PATCH
/
v1
/
model
/
{modelId}
/
input
/
{inputId}
Edit an input
curl --request PATCH \
  --url https://app.variable.global/api/v1/model/{modelId}/input/{inputId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "syncId": "sync123",
  "quantity": 150,
  "unit": "kg",
  "order": 1,
  "material": {
    "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "Material name"
  },
  "block": {
    "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "Block name"
  },
  "lifecycleStage": {
    "code": "A1",
    "name": "Materials"
  },
  "materialGroup": [
    "packaging"
  ],
  "transport": {
    "lane": {
      "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "syncId": "sync123"
    },
    "for": {
      "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "syncId": "sync123"
    },
    "weight": {
      "quantity": 250,
      "unit": "kg"
    }
  }
}
'
{
  "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "syncId": "sync123",
  "quantity": 150,
  "unit": "kg",
  "order": 1,
  "material": {
    "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "Material name"
  },
  "block": {
    "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "Block name"
  },
  "lifecycleStage": {
    "code": "A1",
    "name": "Materials"
  },
  "materialGroup": [
    "packaging"
  ],
  "transport": {
    "lane": {
      "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "syncId": "sync123",
      "name": "Newark, NJ to Rotterdam, NL"
    },
    "for": {
      "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "syncId": "sync123",
      "name": "Newark, NJ to Rotterdam, NL"
    },
    "weight": {
      "quantity": 250,
      "unit": "kg"
    },
    "tkm": 1510.6
  },
  "created": "2021-01-01T00:00:00.000Z",
  "updated": "2021-01-31T23:59:59.000Z",
  "CO2e": "1234.5678",
  "declaredAmount": {
    "quantity": 0.002,
    "unit": "kg"
  },
  "recycledPercent": 30
}
Requires permission:

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

modelId
string<uuid>
required
inputId
string<uuid>
required

Body

application/json
uuid
string<uuid>
required
syncId
string

An identifier to use when syncing data with other systems. Read more

Example:

"sync123"

quantity
number
Example:

150

unit
string

The unit code (e.g. kg, lbs, etc.). All unit codes can be found in the List Units endpoint.

Example:

"kg"

order
number
Example:

1

material
object
block
object
lifecycleStage
object
materialGroup
string[]

How this input is categorized within its life-cycle stage. Common values are product, packaging, and ancillary; custom values (e.g. from a PCR document) are allowed. isPackaging is kept consistent automatically.

Example:
["packaging"]
transport
object

Freight transport attached to this input as a single transport leg. Set to attach or update the binding; send null on PATCH to detach (omitting transport leaves an existing binding untouched). An input cannot be both a material line and a transport leg — sending material and transport together returns 400.

Response

An input

uuid
string<uuid>
syncId
string

An identifier to use when syncing data with other systems. Read more

Example:

"sync123"

quantity
number
Example:

150

unit
string

The unit code (e.g. kg, lbs, etc.). All unit codes can be found in the List Units endpoint.

Example:

"kg"

order
number
Example:

1

material
object
block
object
lifecycleStage
object
materialGroup
string[]

How this input is categorized within its life-cycle stage. Common values are product, packaging, and ancillary; custom values (e.g. from a PCR document) are allowed. isPackaging is kept consistent automatically.

Example:
["packaging"]
transport
object

Freight transport attached to this input as a single transport leg. Set to attach or update the binding; send null on PATCH to detach (omitting transport leaves an existing binding untouched). An input cannot be both a material line and a transport leg — sending material and transport together returns 400.

created
string

ISO 8601 date

Example:

"2021-01-01T00:00:00.000Z"

updated
string

ISO 8601 date

Example:

"2021-01-31T23:59:59.000Z"

CO2e
string
Example:

"1234.5678"

declaredAmount
object

Read-only canonical amount in the source product's declared unit, used by impact calculation. Present only when quantity + unit you sent are in a different dimension than the source product's declared unit (e.g. you sent kg for an m3-declared source product that has a weight conversion factor). Ignored on POST/PATCH.

recycledPercent
number
read-only

Read-only. Recycled content of this input as a percentage (0–100), inherited from its source product — the source's modeled recycled content when available, otherwise its declared value. 0 when the input has no source product or the source has neither. Ignored on POST/PATCH.

Example:

30