> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Replace passport materials

> Replace the bill of materials. Rows your suppliers submitted are kept.

Key scope: ingest. Module: dpp.



## OpenAPI

````yaml /openapi.json put /v1/passports/{id}/materials
openapi: 3.1.0
info:
  title: InsightChain API
  version: 2.0.0
  description: 'The InsightChain API. Send your key as `Authorization: Bearer <key>`.'
  contact:
    name: InsightChain
    url: https://insightchain.ai/docs
  license:
    name: Proprietary
    url: https://insightchain.ai/terms
servers:
  - url: https://api.insightchain.ai
security: []
tags:
  - name: Data ingestion
  - name: Tariff check
  - name: Landed cost
  - name: Import taxes
  - name: Customs documents
  - name: Denied party screening
  - name: Location risk
  - name: Tariff impact and trade data
  - name: Recommendations
  - name: Orders and approval
  - name: Explanations
  - name: Alerts
  - name: Inventory
  - name: Forecast check
  - name: Disruptions
  - name: Product compliance
  - name: Product recalls
  - name: Product passports
  - name: Webhooks
  - name: Connections
  - name: Sync runs
  - name: API keys
  - name: Usage
  - name: Request log
  - name: Agent (MCP) server
paths:
  /v1/passports/{id}/materials:
    put:
      tags:
        - Product passports
      summary: Replace passport materials
      description: |-
        Replace the bill of materials. Rows your suppliers submitted are kept.

        Key scope: ingest. Module: dpp.
      operationId: replacePassportMaterials
      parameters:
        - name: id
          in: path
          required: true
          schema:
            oneOf:
              - type: string
                format: uuid
              - type: string
                pattern: ^ext:.{1,256}$
          description: >-
            The record's id (a UUID), or `ext:<external_id>` with your own id
            for it, URL-encoded
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                materials:
                  type: array
                  items:
                    type: object
                    required:
                      - external_id
                      - material_name
                    properties:
                      external_id:
                        type: string
                        minLength: 1
                        maxLength: 128
                        pattern: ^[A-Za-z0-9_.:@/-]+$
                        description: Your id for the material, unique in the list
                      material_name:
                        type: string
                        maxLength: 200
                      parent_external_id:
                        type: string
                        minLength: 1
                        maxLength: 128
                        pattern: ^[A-Za-z0-9_.:@/-]+$
                        description: A material of this list it is part of
                      component_name:
                        type: string
                        maxLength: 200
                      material_class:
                        type: string
                        maxLength: 100
                      sort_order:
                        type: integer
                        minimum: 0
                        maximum: 10000
                      mass_g:
                        type: number
                        minimum: 0
                      mass_share_pct:
                        type: number
                        minimum: 0
                        maximum: 100
                      recycled_content_pct:
                        type: number
                        minimum: 0
                        maximum: 100
                      renewable_content_pct:
                        type: number
                        minimum: 0
                        maximum: 100
                      hazardous:
                        type: boolean
                        default: false
                      origin_country:
                        type: string
                        pattern: ^[A-Za-z]{2}$
                        description: ISO 3166-1 alpha-2 country code
                      processing_stage:
                        type: string
                        maxLength: 60
                      supplier_external_id:
                        type: string
                        minLength: 1
                        maxLength: 128
                        pattern: ^[A-Za-z0-9_.:@/-]+$
                      certificate_document_external_id:
                        type: string
                        minLength: 1
                        maxLength: 128
                        pattern: ^[A-Za-z0-9_.:@/-]+$
                        description: A document of this passport
                  maxItems: 500
                  description: The whole list; an empty one removes every material
              required:
                - materials
              additionalProperties: false
            example:
              materials:
                - external_id: MAT-BODY
                  material_name: Organic cotton jersey
                  component_name: Body
                  mass_share_pct: 96
                  recycled_content_pct: 0
                  origin_country: IN
                  supplier_external_id: SUP-100
                - external_id: MAT-THREAD
                  material_name: Polyester sewing thread
                  component_name: Seams
                  mass_share_pct: 4
                  recycled_content_pct: 100
                  origin_country: VN
      responses:
        '200':
          description: OK
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-RateLimit-Limit-Day:
              $ref: '#/components/headers/X-RateLimit-Limit-Day'
            X-RateLimit-Remaining-Day:
              $ref: '#/components/headers/X-RateLimit-Remaining-Day'
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
            X-Client-Request-ID:
              $ref: '#/components/headers/X-Client-Request-ID'
            X-InsightChain-Sandbox:
              $ref: '#/components/headers/X-InsightChain-Sandbox'
          content:
            application/json:
              schema:
                type: object
                properties:
                  materials:
                    type: array
                    items:
                      $ref: '#/components/schemas/PassportMaterialWritten'
                  completeness:
                    $ref: '#/components/schemas/PassportCompleteness'
                  request_id:
                    type: string
                    description: >-
                      Quote this when asking about the request; also the
                      X-Request-ID header
                required:
                  - materials
                  - completeness
                  - request_id
              example:
                materials:
                  - externalId: MAT-BODY
                    parentExternalId: null
                    sortOrder: 0
                    componentName: Body
                    materialName: Full-grain cowhide leather
                    materialClass: leather
                    massG: 500
                    massSharePct: 80
                    recycledContentPct: 0
                    renewableContentPct: 100
                    hazardous: false
                    originCountry: IT
                    processingStage: dyeing_finishing
                    supplierRef:
                      externalId: VEND-000131
                      name: VEND-000131
                      countryCode: null
                    certificateDocumentExternalId: null
                completeness:
                  score: 75.86
                  sections:
                    - section: materials
                      label: Materials & composition
                      score: 81.82
                      met: 6
                      total: 7
                      weight: 22
                  gaps:
                    - id: impact.carbon_footprint
                      label: Product carbon footprint
                      section: impact
                      sectionLabel: Environmental impact
                      severity: required
                      weight: 5
                      remediation: Add the product carbon footprint in kg CO2e.
                      regulationRefs:
                        - ESPR 2024/1781 Annex I
                  blockingGaps: 0
                  requiredGaps: 5
                  applicable: 35
                  met: 26
                  rulesetVersion: 2026.08-textile-v1
                request_id: 7da5de7e-6035-4e55-b845-e366d8174532
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/UpstreamError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      security:
        - apiKey: []
components:
  headers:
    RateLimit-Limit:
      schema:
        type: integer
      description: Requests allowed per minute. On every answer to an accepted API key
    RateLimit-Remaining:
      schema:
        type: integer
      description: Requests left in the current minute window
    RateLimit-Reset:
      schema:
        type: integer
      description: Seconds until the minute window resets
    X-RateLimit-Limit-Day:
      schema:
        type: integer
      description: The key's daily quota
    X-RateLimit-Remaining-Day:
      schema:
        type: integer
      description: Requests left today (resets 00:00 UTC)
    X-Request-ID:
      schema:
        type: string
      description: Quote this when asking about a request
    X-Client-Request-ID:
      schema:
        type: string
      description: Your own X-Request-ID request header, echoed. Absent when you sent none
    X-InsightChain-Sandbox:
      schema:
        type: string
        enum:
          - 'true'
      description: >-
        Present, and true, on every answer to a test key: the data is the
        sandbox's
    Allow:
      schema:
        type: string
      description: The methods the path takes
    Retry-After:
      schema:
        type: integer
      description: Seconds to wait before trying again
  schemas:
    PassportMaterialWritten:
      type: object
      properties:
        externalId:
          type: string
        parentExternalId:
          type:
            - string
            - 'null'
          description: The material this one is a component of; null for a root material
        sortOrder:
          type: integer
        componentName:
          type:
            - string
            - 'null'
        materialName:
          type: string
        materialClass:
          type:
            - string
            - 'null'
          description: For example natural_fibre, synthetic_fibre, leather, metal, plastic
        massG:
          type:
            - number
            - 'null'
          description: Grams
        massSharePct:
          type:
            - number
            - 'null'
          description: Share of the product's mass, 0 to 100
        recycledContentPct:
          type:
            - number
            - 'null'
        renewableContentPct:
          type:
            - number
            - 'null'
        hazardous:
          type: boolean
        originCountry:
          type:
            - string
            - 'null'
          description: ISO 3166-1 alpha-2 country code
        processingStage:
          type:
            - string
            - 'null'
          description: fibre, spinning, weaving_knitting, dyeing_finishing or making_up
        certificateDocumentExternalId:
          type:
            - string
            - 'null'
          description: The document on this passport that backs the declaration
        supplierRef:
          type:
            - object
            - 'null'
          properties:
            externalId:
              type: string
            name:
              type: string
              description: >-
                The supplier's external id again; the supplier's name is on GET
                materials
            countryCode:
              type:
                - string
                - 'null'
              description: Always null in this answer
          required:
            - externalId
            - name
            - countryCode
      required:
        - externalId
        - parentExternalId
        - sortOrder
        - componentName
        - materialName
        - materialClass
        - massG
        - massSharePct
        - recycledContentPct
        - renewableContentPct
        - hazardous
        - originCountry
        - processingStage
        - certificateDocumentExternalId
        - supplierRef
    PassportCompleteness:
      type: object
      properties:
        score:
          type: number
          description: >-
            How complete the passport is, 0 to 100, over the requirements that
            apply to it
        sections:
          type: array
          items:
            type: object
            properties:
              section:
                type: string
                enum:
                  - identity
                  - materials
                  - substances
                  - circularity
                  - impact
                  - supply_chain
                  - compliance
                  - lifecycle
              label:
                type: string
              score:
                type: number
                description: 0 to 100 within the section
              met:
                type: integer
              total:
                type: integer
                description: Requirements of the section that apply to this passport
              weight:
                type: number
            required:
              - section
              - label
              - score
              - met
              - total
              - weight
        gaps:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: The requirement, for example identity.gtin
              label:
                type: string
              section:
                type: string
                enum:
                  - identity
                  - materials
                  - substances
                  - circularity
                  - impact
                  - supply_chain
                  - compliance
                  - lifecycle
              sectionLabel:
                type: string
              severity:
                type: string
                enum:
                  - blocking
                  - required
                  - recommended
                description: >-
                  blocking: the passport cannot be published without it;
                  required: expected; recommended: good practice
              weight:
                type: number
                description: The requirement's share of the 0 to 100 score
              remediation:
                type: string
                description: What to do to meet it
              regulationRefs:
                type: array
                items:
                  type: string
            required:
              - id
              - label
              - section
              - sectionLabel
              - severity
              - weight
              - remediation
              - regulationRefs
          description: The requirements not met, most severe first
        blockingGaps:
          type: integer
        requiredGaps:
          type: integer
        applicable:
          type: integer
          description: Requirements that apply to this passport
        met:
          type: integer
        rulesetVersion:
          type: string
      required:
        - score
        - sections
        - gaps
        - blockingGaps
        - requiredGaps
        - applicable
        - met
        - rulesetVersion
    Error:
      type: object
      description: The body of every non-2xx answer
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - rate_limit_error
                - api_error
            code:
              type: string
              description: >-
                Stable machine-readable code, e.g. parameter_invalid,
                scope_missing, rate_limit_exceeded. Every code is listed at
                /docs/errors
            message:
              type: string
              description: For people; what `error` used to be as a plain string
            param:
              type:
                - string
                - 'null'
              description: The parameter the error is about, when there is one
            doc_url:
              type: string
              description: Where the code is documented
          required:
            - type
            - code
            - message
            - param
            - doc_url
        request_id:
          type: string
        details:
          type: array
          items: {}
          description: >-
            On a 400 for input with several problems: one entry per problem, a
            sentence or an object with `field` and `message`
        limit:
          type: integer
          description: 'On a 429: the limit that was reached'
        code:
          type: string
          deprecated: true
          description: 'Deprecated: use error.code'
        field:
          type: string
          deprecated: true
          description: 'Deprecated: use error.param'
      required:
        - error
        - request_id
      additionalProperties: true
  responses:
    BadRequest:
      description: >-
        Invalid input: an unknown or invalid parameter (error.param names it) or
        a body the route does not accept
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-RateLimit-Limit-Day:
          $ref: '#/components/headers/X-RateLimit-Limit-Day'
        X-RateLimit-Remaining-Day:
          $ref: '#/components/headers/X-RateLimit-Remaining-Day'
        X-Client-Request-ID:
          $ref: '#/components/headers/X-Client-Request-ID'
        X-InsightChain-Sandbox:
          $ref: '#/components/headers/X-InsightChain-Sandbox'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid API key
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
        X-Client-Request-ID:
          $ref: '#/components/headers/X-Client-Request-ID'
        X-InsightChain-Sandbox:
          $ref: '#/components/headers/X-InsightChain-Sandbox'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        The key lacks the scope, or the organization lacks the module or is
        suspended
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-RateLimit-Limit-Day:
          $ref: '#/components/headers/X-RateLimit-Limit-Day'
        X-RateLimit-Remaining-Day:
          $ref: '#/components/headers/X-RateLimit-Remaining-Day'
        X-Client-Request-ID:
          $ref: '#/components/headers/X-Client-Request-ID'
        X-InsightChain-Sandbox:
          $ref: '#/components/headers/X-InsightChain-Sandbox'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: No such record in your organization
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-RateLimit-Limit-Day:
          $ref: '#/components/headers/X-RateLimit-Limit-Day'
        X-RateLimit-Remaining-Day:
          $ref: '#/components/headers/X-RateLimit-Remaining-Day'
        X-Client-Request-ID:
          $ref: '#/components/headers/X-Client-Request-ID'
        X-InsightChain-Sandbox:
          $ref: '#/components/headers/X-InsightChain-Sandbox'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    MethodNotAllowed:
      description: The route does not take this method; Allow lists the ones it takes
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-RateLimit-Limit-Day:
          $ref: '#/components/headers/X-RateLimit-Limit-Day'
        X-RateLimit-Remaining-Day:
          $ref: '#/components/headers/X-RateLimit-Remaining-Day'
        X-Client-Request-ID:
          $ref: '#/components/headers/X-Client-Request-ID'
        X-InsightChain-Sandbox:
          $ref: '#/components/headers/X-InsightChain-Sandbox'
        Allow:
          $ref: '#/components/headers/Allow'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: >-
        The request conflicts with the record's current state, or its
        Idempotency-Key is still in use
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-RateLimit-Limit-Day:
          $ref: '#/components/headers/X-RateLimit-Limit-Day'
        X-RateLimit-Remaining-Day:
          $ref: '#/components/headers/X-RateLimit-Remaining-Day'
        X-Client-Request-ID:
          $ref: '#/components/headers/X-Client-Request-ID'
        X-InsightChain-Sandbox:
          $ref: '#/components/headers/X-InsightChain-Sandbox'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PayloadTooLarge:
      description: >-
        The body, or the data the request would read, is larger than the route
        allows
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-RateLimit-Limit-Day:
          $ref: '#/components/headers/X-RateLimit-Limit-Day'
        X-RateLimit-Remaining-Day:
          $ref: '#/components/headers/X-RateLimit-Remaining-Day'
        X-Client-Request-ID:
          $ref: '#/components/headers/X-Client-Request-ID'
        X-InsightChain-Sandbox:
          $ref: '#/components/headers/X-InsightChain-Sandbox'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnsupportedMediaType:
      description: The Content-Type is not one the route reads
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-RateLimit-Limit-Day:
          $ref: '#/components/headers/X-RateLimit-Limit-Day'
        X-RateLimit-Remaining-Day:
          $ref: '#/components/headers/X-RateLimit-Remaining-Day'
        X-Client-Request-ID:
          $ref: '#/components/headers/X-Client-Request-ID'
        X-InsightChain-Sandbox:
          $ref: '#/components/headers/X-InsightChain-Sandbox'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Per-minute or daily key limit; Retry-After is the real reset
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-RateLimit-Limit-Day:
          $ref: '#/components/headers/X-RateLimit-Limit-Day'
        X-RateLimit-Remaining-Day:
          $ref: '#/components/headers/X-RateLimit-Remaining-Day'
        X-Client-Request-ID:
          $ref: '#/components/headers/X-Client-Request-ID'
        X-InsightChain-Sandbox:
          $ref: '#/components/headers/X-InsightChain-Sandbox'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: Internal error; quote request_id
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-RateLimit-Limit-Day:
          $ref: '#/components/headers/X-RateLimit-Limit-Day'
        X-RateLimit-Remaining-Day:
          $ref: '#/components/headers/X-RateLimit-Remaining-Day'
        X-Client-Request-ID:
          $ref: '#/components/headers/X-Client-Request-ID'
        X-InsightChain-Sandbox:
          $ref: '#/components/headers/X-InsightChain-Sandbox'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UpstreamError:
      description: >-
        The API could not be reached, or a service this route depends on failed.
        Try again shortly
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-RateLimit-Limit-Day:
          $ref: '#/components/headers/X-RateLimit-Limit-Day'
        X-RateLimit-Remaining-Day:
          $ref: '#/components/headers/X-RateLimit-Remaining-Day'
        X-Client-Request-ID:
          $ref: '#/components/headers/X-Client-Request-ID'
        X-InsightChain-Sandbox:
          $ref: '#/components/headers/X-InsightChain-Sandbox'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServiceUnavailable:
      description: The API, or this route, is not available right now
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-RateLimit-Limit-Day:
          $ref: '#/components/headers/X-RateLimit-Limit-Day'
        X-RateLimit-Remaining-Day:
          $ref: '#/components/headers/X-RateLimit-Remaining-Day'
        X-Client-Request-ID:
          $ref: '#/components/headers/X-Client-Request-ID'
        X-InsightChain-Sandbox:
          $ref: '#/components/headers/X-InsightChain-Sandbox'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        An InsightChain API key: ic_live_... for your organization, ic_test_...
        for its sandbox

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.