# Create composite Source: https://docs.emidat.com/api-reference/composites/create POST /v2/composites Creates a composite at one of your plants. A composite is a manufacturer-defined mix of materials by percentage. **Idempotent create** — a replay of the same `Idempotency-Key` returns the original response (`200`); otherwise a new composite is created (`201`). Your `external_id` must be unique: reusing one returns `409`. See [External IDs](/external-ids). # Delete composite Source: https://docs.emidat.com/api-reference/composites/delete DELETE /v2/composites/{id} Deletes a composite. Returns `409 Conflict` if the composite is currently referenced by any active supply material. # Get composite Source: https://docs.emidat.com/api-reference/composites/get GET /v2/composites/{id} # List composites Source: https://docs.emidat.com/api-reference/composites/list GET /v2/composites Lists the composites at the plants your key can access. Pass `plant_id` to restrict the results to one plant. Filter by `external_id` to look up composites by your own IDs; repeat the parameter to look up several at once. Paginated — see [Pagination](/pagination). # Update composite Source: https://docs.emidat.com/api-reference/composites/update PUT /v2/composites/{id} Full replacement of editable fields. `external_id` is replaced: re-sending this composite's own code succeeds unchanged, while a code held by another active composite returns `409`. See [External IDs](/external-ids). `plant_id` and `composite_type` are immutable. They may be omitted or echoed from the current resource; a different value returns `422`. The impacts of every supplier product made of this composite are recomputed. # Download EPD document Source: https://docs.emidat.com/api-reference/declarations/download GET /v2/declarations/{id}/documents/{document_id}/file Downloads one of the EPD's `documents`, as an attachment named after it; the `Content-Type` is PDF or XLSX by its type. Take the path from `documents[].file.url` in `GET /v2/declarations` or `GET /v2/declarations/{id}`. Requires the `view:declarations` scope; the background report and the LCA results spreadsheet also need `view:recipes`. Only the files listed in `documents` are served, not drafts or other reports. A language's final PDF stops being downloadable when that language is rejected or withdrawn. # Get EPD Source: https://docs.emidat.com/api-reference/declarations/get GET /v2/declarations/{id} Fetches one EPD by its Emidat UUID. `404` if no active EPD carries the id; `403` if its product instance is at a plant outside the key's plant restriction. Requires the `view:declarations` scope. # Get EPD LCA results Source: https://docs.emidat.com/api-reference/declarations/lca-results GET /v2/declarations/{id}/lca-results Returns the LCA results of an EPD's main and alternative scenarios as Emidat generated them. They stay fixed when the product's data changes later, unlike [`/v2/products/{id}/lca-results`](/api-reference/products/lca-results). If a program operator required changes after Emidat generated the EPD, only the revised PDF comes back to Emidat, not revised figures. Served for an EPD in any status; read `status` from [Get EPD](/api-reference/declarations/get). Same `404`/`403` rules as Get EPD. Requires the `view:declarations` scope; `impacts_per_source` is `null` without `view:recipes`. # List EPDs Source: https://docs.emidat.com/api-reference/declarations/list GET /v2/declarations Lists the EPDs of products made at the plants your key can access. EPDs are created and published on the Emidat UI, not via the API. Filter by `product_external_id` to find the EPDs of your article numbers; repeat the parameter to look up several at once. An EPD is found by the product it was created for. To keep a copy in sync, poll with `published_since`: it returns the EPDs with a language approved at or after that time. With `language`, only that language counts. Archived EPDs are not listed. Requires the `view:declarations` scope. Paginated — see [Pagination](/pagination). # Get elementary Source: https://docs.emidat.com/api-reference/elementaries/get GET /v2/elementaries/{id} Fetches an elementary by its Emidat UUID, including inactive entries and entries whose impacts are unknown. Returns `404` for an unknown elementary. Requires `view:materials`; plant restrictions do not apply. # List elementaries Source: https://docs.emidat.com/api-reference/elementaries/list GET /v2/elementaries Discover the Emidat elementary catalogue to resolve material types for supplier products and product instances. Includes product-modelling support, allowed product units, unit-specific tech-spec JSON Schemas, and BOM rules. Lists only active elementaries whose impacts are known, including burden-free entries. Filters compose as AND. Requires `view:materials`; the catalogue is shared across manufacturers and is not restricted by plant access. Paginated — see [Pagination](/pagination). # Introspect API key Source: https://docs.emidat.com/api-reference/me/get GET /v2/me Reports what the calling key can do right now: the manufacturer it belongs to, the scopes it can exercise, and the plants it can reach. Call it once after wiring up a new key to confirm the setup, and whenever a `403` needs explaining. Scopes and plants are the live intersection of what the key was granted and what its issuing member may currently do, so both can shrink after issuance without the key itself changing. Any valid key may call this endpoint — it requires no scope. # Get plant Source: https://docs.emidat.com/api-reference/plants/get GET /v2/plants/{id} Fetches one plant by its Emidat UUID. `404` if no active plant carries the id; `403` if the plant exists but the key's plant restriction does not include it. # List plants Source: https://docs.emidat.com/api-reference/plants/list GET /v2/plants Lists the plants your key can access. Plants are created and managed on the Emidat UI, not via the API — listing them is how your integration maps your own plant codes to the Emidat `plant_id` it references. Filter by `external_id` to look up plants by your own IDs; repeat the parameter to look up several at once. Paginated — see [Pagination](/pagination). # Create prechain product Source: https://docs.emidat.com/api-reference/prechain-products/create POST /v2/prechain-products Registers an existing product instance as an upstream ("prechain") input at one of your plants, with an optional transport route. **Idempotent create** — a replay of the same `Idempotency-Key` returns the original response (`200`); otherwise a new prechain product is created (`201`). See [External IDs](/external-ids). # Delete prechain product Source: https://docs.emidat.com/api-reference/prechain-products/delete DELETE /v2/prechain-products/{id} Deletes a prechain product. Returns `409 Conflict` if it is referenced in the BOM of an active product instance — `err_prechain_product_in_recipe`; remove those BOM entries first. # Get prechain product Source: https://docs.emidat.com/api-reference/prechain-products/get GET /v2/prechain-products/{id} Returns the prechain product with its per-kg impacts. # List prechain products Source: https://docs.emidat.com/api-reference/prechain-products/list GET /v2/prechain-products Lists the prechain products at the plants your key can access — the product instances you registered as upstream inputs. Pass `transport_route_id` to list the ones that travel one transport route. Paginated — see [Pagination](/pagination). # Update prechain product Source: https://docs.emidat.com/api-reference/prechain-products/update PUT /v2/prechain-products/{id} Full replacement of editable fields. Send `external_id` and the `transport_route_id` to travel; immutable references may be omitted or echoed from the current resource, but cannot be changed. Returns the prechain product with recomputed per-kg impacts. The nested `transport_route` object is deprecated. To change the distances of a product's route, take `transport_route_id` from the GET response and update that route with [`PUT /v2/transport-routes/{id}`](/api-reference/transport-routes/update); the edit applies to every product on the route. To move only this product to other distances, create a route with `POST /v2/transport-routes` and send its id here. # Replace BOM Source: https://docs.emidat.com/api-reference/product-instances/bom PUT /v2/product-instances/{id}/bom Replaces the instance's entire BOM. Re-sending the same components is a no-op (idempotent). Requires `edit:recipes`. Keys issued before that scope existed carry it wherever they carry `edit:products`. Every component must sit at a plant your key can reach — access to the instance does not extend to what its BOM points at. A by-product of its production process takes no components (`err_product_type_no_recipe`): its main products' recipes cover its share. # Create product instance Source: https://docs.emidat.com/api-reference/product-instances/create POST /v2/product-instances **Idempotent create** — a replay of the same `Idempotency-Key` returns the original response (`200`); otherwise a new product instance is created (`201`). Your `external_id` must be unique: reusing one returns `409`. See [External IDs](/external-ids). A create that would pass your licence's product instance limit returns `403` with `err_entitlement_limit_reached`. While another change on your licence is running, such as a bulk upload, the create returns `409` with `err_licence_busy`; retry it. `annual_data[].production_output` and `annual_data[].economic_value_per_unit` are production data: without `edit:processes` they are ignored rather than rejected, and the instance is created without them. # Delete product instance Source: https://docs.emidat.com/api-reference/product-instances/delete DELETE /v2/product-instances/{id} Deletes an instance nothing else consumes. An instance another product draws on as a prechain product returns `409 Conflict` with `err_product_instance_in_recipe` — remove those BOM entries first. An instance with a declaration in review or verified returns `409 Conflict` with `err_product_instance_has_declarations`. # Get product instance Source: https://docs.emidat.com/api-reference/product-instances/get GET /v2/product-instances/{id} # Get BOM Source: https://docs.emidat.com/api-reference/product-instances/get-bom GET /v2/product-instances/{id}/bom Returns the instance's current BOM — the full set of components last written. A recipe is confidential beyond the plant that makes it, so it has a scope of its own: `view:recipes`. Keys issued before that scope existed carry it wherever they carry `view:products`, so nothing an integrator already builds on changes. Each item comes back as it was entered (`amount`, `amount_unit`), so re-sending it keeps its unit. An item entered in a unit its component no longer converts from blocks the LCA (`recipe_row_not_convertible`): give it another unit before sending the BOM back, or `PUT` refuses it (`err_recipe_unit_not_available`). # Get packaging Source: https://docs.emidat.com/api-reference/product-instances/get-packaging GET /v2/product-instances/{id}/packaging Returns the instance's packaging per unit in `year`: its share of the production process's packaging, and what it adds itself. Requires `view:recipes`. # Get LCA results Source: https://docs.emidat.com/api-reference/product-instances/lca-results GET /v2/product-instances/{id}/lca-results Returns the computed LCA for the instance, one entry per reportable production year — see `LcaResults.data` for which years those are, and why an instance can legitimately have none. The instance is modelled with the default scenario for its material type, not with the scenario of any catalog product it is linked to. Each year carries characterized results under EN 15804+A2 and ISO 21930 — impacts per life-cycle module (A1–A3, A4, A5, C1–C4, D, …), a per-source breakdown, biogenic carbon content, and the background-data provenance. Paginated in ascending year order — see [Pagination](/pagination). `job` reports the state of the last `lca-update`, and is the only thing that says whether to keep polling: while it is `queued` or `processing` the results are mid-replacement and `data` comes back empty, but an empty `data` on its own does not imply a job is running. A year that cannot be computed lists everything standing in the way under `blocked_by`. During recomputation `next_cursor` is null. After polling finishes, start from the first page and follow `next_cursor` until it is null. Keep `limit` unchanged while walking pages. # Recompute LCA Source: https://docs.emidat.com/api-reference/product-instances/lca-update POST /v2/product-instances/{id}/lca-update Queues a recompute of this instance's LCA, filling in any sub-assembly results it consumes that are missing. Call once on the root after all writes. The recompute runs in the background: this returns immediately with the job's state. Poll `GET /v2/product-instances/{id}/lca-results` — it carries the same `job` object and withholds results until the job leaves `queued`/`processing`. A `202` means the recompute is pending. If it could not be queued you get a `503` instead — never a `202` whose job never runs. # List product instances Source: https://docs.emidat.com/api-reference/product-instances/list GET /v2/product-instances Lists the product instances at the plants your key can access. Filter by `external_id` to look up product instances by your own IDs; repeat the parameter to look up several at once. Paginated — see [Pagination](/pagination). # Replace packaging Source: https://docs.emidat.com/api-reference/product-instances/packaging PUT /v2/product-instances/{id}/packaging Replaces the packaging the instance adds itself, on top of its production process's packaging. Re-sending the same packaging is a no-op (idempotent). The instance's LCA is marked out of date; call `lca-update` to recompute it. Requires `edit:recipes`. Every material must be an active packaging supplier product at the instance's plant (`err_invalid_packaging_material`), and not one the production process already has. A by-product of its production process takes no packaging of its own. # Update product instance Source: https://docs.emidat.com/api-reference/product-instances/update PUT /v2/product-instances/{id} Full replacement of editable fields. Immutable `plant_id`, `elementary_id`, and `unit` may be omitted or echoed from the current resource. `external_id` is replaced: re-sending this instance's own code succeeds unchanged, while a code held by another active instance returns `409`. See [External IDs](/external-ids). An instance stays a product or a by-product of its production process: a `production_process_id` that would turn one into the other returns `409` (`err_process_output_kind_change`). Once an instance has a production process, it can be changed but not removed: a `null` `production_process_id` returns `409` (`err_production_process_required`). A `production_process_id` whose process scopes a packaging material the instance adds as its own returns `409` (`err_packaging_scoped_by_the_process`). `annual_data[].production_output` and `annual_data[].economic_value_per_unit` are production data: without `edit:processes` what you send for them is ignored and the stored values are kept, so echoing back a response that withheld them does not clear them. A stored year you leave out of `annual_data` is kept for the same reason. Keys issued before the process scopes existed carry them wherever they carry the matching product scope. # Get production process Source: https://docs.emidat.com/api-reference/production-processes/get GET /v2/production-processes/{id} Fetches one production process by its Emidat UUID. `404` if no active production process carries the id; `403` if it exists but belongs to a plant outside the key's plant restriction. # List production processes Source: https://docs.emidat.com/api-reference/production-processes/list GET /v2/production-processes Lists the production processes at the plants your key can access. Production processes are created and managed on the Emidat UI, not via the API — listing them is how your integration maps your own process codes to the Emidat `production_process_id` it references. Filter by `external_id` to look up production processes by your own IDs; repeat the parameter to look up several at once. Paginated — see [Pagination](/pagination). # Get product Source: https://docs.emidat.com/api-reference/products/get GET /v2/products/{id} Fetches one active product by its Emidat UUID. `404` if no active product carries the id. # Get product LCA results Source: https://docs.emidat.com/api-reference/products/lca-results GET /v2/products/{id}/lca-results Returns stored LCA results for an active product across its scenarios, active linked instances and manufacturing-data years. Unlike instance results, these use the catalog product's scenario. Optional filters are combined; omitted filters match everything. An unmatched filter returns an empty `data` list. Paginated — see [Pagination](/pagination). Requires `view:products`. Only instances at plants your key can access are included. `impacts_per_source` is `null` without `view:recipes`. Results calculated with outdated PCRs or a different background-data system model are excluded. Only computed results are returned; this endpoint does not calculate results or report readiness. Poll this endpoint after `POST /v2/products/{id}/lca-update`. `job` reports the aggregate state across the product and all its scenarios, regardless of result filters or plant access. While its status is `queued` or `processing`, `data` is empty to avoid serving partial results. Keep polling while the job is `queued` or `processing`; stop on `completed`, `failed` or `idle`, whatever `data` holds. On failure, `job.err_code` explains why the recompute failed. During recomputation `next_cursor` is null. After polling finishes, start from the first page and follow `next_cursor` until it is null. Keep filters and `limit` unchanged while walking pages. # Automatically select product LCA results Source: https://docs.emidat.com/api-reference/products/lca-results-auto GET /v2/products/{id}/lca-results/auto Selects one stored result using the platform products list's GWP Total rules: the default scenario, then the latest computed year, then the instance with the highest EN 15804+A2 A1–A3 GWP-total in that year. A numeric GWP ranks above a missing GWP, including negative values. Requires `view:products`. Selection is restricted to active linked instances at plants your key can access and results matching the current PCRs and background-data system model. With access to all plants this matches the platform selection. `impacts_per_source` is `null` without `view:recipes`. The selected result is nested under `result`, which is `null` if no eligible result exists or the aggregate recompute is `queued` or `processing`. `job` reports the same aggregate state across the product and all its scenarios as `GET /v2/products/{id}/lca-results`. This endpoint can also be polled after `POST /v2/products/{id}/lca-update`: keep polling while `job.status` is `queued` or `processing`, and stop on `completed`, `failed` or `idle`, whatever `result` holds. On failure, `job.err_code` explains why the recompute failed. This endpoint does not calculate results or report readiness. # Recompute product LCA Source: https://docs.emidat.com/api-reference/products/lca-update POST /v2/products/{id}/lca-update Queues LCA recomputation from stored inputs for every scenario, active linked product instance and reportable manufacturing-data year of an active product. No request body or query parameters are needed or supported. A year can only be calculated when its required inputs are ready. Requires `edit:products` and access to every plant with an active linked instance. Inactive linked instances are ignored for both authorization and recomputation. A key missing access to an active linked plant receives `403`; no partial recompute is queued. Paused product categories also return `403`. Returns `202` with the aggregate job state across the product and its scenarios. An already queued or processing recompute is reused. Acceptance does not mean calculation has finished. Poll `GET /v2/products/{id}/lca-results`, which reports the same aggregate job state. Keep polling while `job.status` is `queued` or `processing`, and stop once it reaches `completed`, `failed` or `idle`. Results are withheld while the recompute is running. # List products Source: https://docs.emidat.com/api-reference/products/list GET /v2/products Lists your active products — the sellable catalog entities, independent of any plant. Products are created and managed in the Emidat UI, not via the API; listing them is how an integration resolves its own article numbers to the `id` a declaration or an EPD is about. Filter by `external_id` to look up products by your own IDs (repeat the parameter to look up several at once), or by `product_instance_id` to find the products a given instance is linked to. Paginated — see [Pagination](/pagination). A product belongs to your account rather than to a plant, so the key's plant restriction does not narrow this list, and `plant_ids` may name plants the key cannot otherwise read. # List product scenarios Source: https://docs.emidat.com/api-reference/products/scenarios GET /v2/products/{id}/scenarios Lists simplified scenarios for an active product, including its default scenario. Requires `view:products`. Paginated in UUID order — see [Pagination](/pagination). Scenarios belong to the account, not a plant. # List programme operators Source: https://docs.emidat.com/api-reference/program-operators/list GET /v2/program-operators The programme operators an EPD's `program_operator_id` can refer to: the bodies that register and publish EPDs, such as IBU or EPD Global. The list is the same for every account and changes only when Emidat adds a programme operator. Requires the `view:declarations` scope. Paginated — see [Pagination](/pagination). # Create project Source: https://docs.emidat.com/api-reference/projects/create POST /v2/projects Creates a project for one of your customers, with at least one line of catalog product and quantity. A project keeps quantities, not footprints: its `gwp_*` values are recalculated from the products' current LCA results on every read. **Idempotent create** — a replay of the same `Idempotency-Key` returns the original response (`200`); otherwise a new project is created (`201`). Your `external_id` must be unique: reusing one returns `409`. See [External IDs](/external-ids). # Delete project Source: https://docs.emidat.com/api-reference/projects/delete DELETE /v2/projects/{id} Deletes a project. Its `external_id` is freed for another project. # Download project document Source: https://docs.emidat.com/api-reference/projects/download-document GET /v2/projects/{id}/documents/{document_id}/file Downloads one of the project's current reports, as an attachment named after it; the `Content-Type` matches its format. Take the path from `document.url` in `GET /v2/projects/{id}/documents`. A report stops being downloadable once a newer report in the same format replaces it; list the documents again for the new one. # Generate project document Source: https://docs.emidat.com/api-reference/projects/generate-document POST /v2/projects/{id}/documents/generate Queues a report of the project as it stands now, in one format, and returns the state of that request. Poll `GET /v2/projects/{id}/documents` until its `job.status` is `completed`, then download the file from its `url` with your API key. A project keeps one report per format: the new report replaces the old one, and the old file is deleted, once it is ready. If it fails, the old one stays stored. Requesting a format that is already being generated runs it once more after the current run. # Get project Source: https://docs.emidat.com/api-reference/projects/get GET /v2/projects/{id} # List projects Source: https://docs.emidat.com/api-reference/projects/list GET /v2/projects Lists your active projects. Filter by `external_id` to look up projects by your own IDs; repeat the parameter to look up several at once. Paginated — see [Pagination](/pagination). # List project documents Source: https://docs.emidat.com/api-reference/projects/list-documents GET /v2/projects/{id}/documents The project's report in each format: the state of the latest request (`job`) and, when no request is in flight or failed, the current file with its download `url`. Poll this after `POST /v2/projects/{id}/documents/generate` until `job.status` is `completed`. # Update project Source: https://docs.emidat.com/api-reference/projects/update PUT /v2/projects/{id} Full replacement of editable fields, the product lines included. `external_id` is replaced: re-sending this project's own code succeeds unchanged, while a code held by another active project returns `409`. See [External IDs](/external-ids). # Create silo Source: https://docs.emidat.com/api-reference/silos/create POST /v2/silos Creates a silo at one of your plants. A silo holds same-type supplier products from one or more suppliers; a BOM can reference the silo instead of individual supplier products by using `type: silo`. **Idempotent create** — a replay of the same `Idempotency-Key` returns the original response (`200`); otherwise a new silo is created (`201`). Your `external_id` must be unique: reusing one returns `409`. See [External IDs](/external-ids). # Delete silo Source: https://docs.emidat.com/api-reference/silos/delete DELETE /v2/silos/{id} Deletes a silo. Returns `409 Conflict` if the silo is currently referenced in the BOM of any product instance. # Get silo Source: https://docs.emidat.com/api-reference/silos/get GET /v2/silos/{id} # List silos Source: https://docs.emidat.com/api-reference/silos/list GET /v2/silos Lists the silos at the plants your key can access. Pass `plant_id` to restrict the results to one plant. Filter by `external_id` to look up silos by your own IDs; repeat the parameter to look up several at once. Paginated — see [Pagination](/pagination). # Update silo Source: https://docs.emidat.com/api-reference/silos/update PUT /v2/silos/{id} Full replacement of editable fields. Immutable `plant_id` may be omitted or echoed from the current resource. `external_id` is replaced: re-sending this silo's own code succeeds unchanged, while a code held by another active silo returns `409`. See [External IDs](/external-ids). # Create supplier company Source: https://docs.emidat.com/api-reference/supplier-companies/create POST /v2/supplier-companies Creates a supplier company — the organization a supplier plant belongs to. It is global to your account: creating it does not associate it with any plant, only a material's own reference to one of its supplier plants does that. **Idempotent create** — a replay of the same `Idempotency-Key` returns the original response (`200`); otherwise a new supplier company is created (`201`). Your `external_id` must be unique: reusing one returns `409`. See [External IDs](/external-ids). `name` must also be unique among your active supplier companies, compared case- and surrounding-whitespace-insensitively; a name already held returns `409`. # Delete supplier company Source: https://docs.emidat.com/api-reference/supplier-companies/delete DELETE /v2/supplier-companies/{id} Deletes a supplier company. # Get supplier company Source: https://docs.emidat.com/api-reference/supplier-companies/get GET /v2/supplier-companies/{id} # List supplier companies Source: https://docs.emidat.com/api-reference/supplier-companies/list GET /v2/supplier-companies Lists your supplier companies — global to your account, not owned by any one plant. Pass `plant_id` to narrow the results to companies with at least one supplier plant a material at that plant currently sources from. Filter by `external_id` to look up supplier companies by your own IDs; repeat the parameter to look up several at once. Paginated — see [Pagination](/pagination). # Update supplier company Source: https://docs.emidat.com/api-reference/supplier-companies/update PUT /v2/supplier-companies/{id} Full replacement of editable fields. `external_id` is replaced: re-sending this company's own code succeeds unchanged, while a code held by another active supplier company returns `409`. See [External IDs](/external-ids). # Create supplier plant Source: https://docs.emidat.com/api-reference/supplier-plants/create POST /v2/supplier-plants The returned `id` is used as `supplier_plant_id` when creating supplier products. **Idempotent create** — a replay of the same `Idempotency-Key` returns the original response (`200`); otherwise a new supplier plant is created (`201`). Your `external_id` must be unique: reusing one returns `409`. See [External IDs](/external-ids). `name` must also be unique among that supplier company's active plants, compared case- and surrounding-whitespace-insensitively; a name already held returns `409`. Two different supplier companies may each have a plant of the same name. # Delete supplier plant Source: https://docs.emidat.com/api-reference/supplier-plants/delete DELETE /v2/supplier-plants/{id} Deletes a supplier plant. Returns `409 Conflict` while any active supplier product is still sourced from it. # Get supplier plant Source: https://docs.emidat.com/api-reference/supplier-plants/get GET /v2/supplier-plants/{id} # List supplier plants Source: https://docs.emidat.com/api-reference/supplier-plants/list GET /v2/supplier-plants Lists your supplier plants — global to your account, not owned by any one plant. Pass `plant_id` to narrow the results to supplier plants a material at that plant currently sources from, or `supplier_company_id` to restrict them to one supplier company. Filter by `external_id` to look up supplier plants by your own IDs; repeat the parameter to look up several at once. Paginated — see [Pagination](/pagination). # Update supplier plant Source: https://docs.emidat.com/api-reference/supplier-plants/update PUT /v2/supplier-plants/{id} Full replacement of editable fields. `supplier_company_id` is an optional assertion of the plant's immutable parent supplier company. It may be omitted or echoed. `external_id` is replaced: re-sending this plant's own code succeeds unchanged, while a code held by another active supplier plant returns `409`. See [External IDs](/external-ids). `address` is replaced in full: any of its optional fields you leave out is cleared, so echo the ones you want to keep. # Create supplier product Source: https://docs.emidat.com/api-reference/supplier-products/create POST /v2/supplier-products Creates a supplier product referencing an existing supplier plant by UUID. The authenticated manufacturer is inferred from the API key. LCA impact data is sourced from the linked `epd_id` (if provided) or from Emidat's background datasets behind `material_type` — the `elementary_id` for an `emidat-elementary`, or the composite's materials for a `custom-composite`. **Idempotent create** — a replay of the same `Idempotency-Key` returns the original response (`200`); otherwise a new supplier product is created (`201`). Your `external_id` must be unique: reusing one returns `409`. See [External IDs](/external-ids). # Delete supplier product Source: https://docs.emidat.com/api-reference/supplier-products/delete DELETE /v2/supplier-products/{id} Deletes a supplier product. Returns `409 Conflict` if the supplier product is part of an active silo (`err_supplier_product_in_silo`), referenced in an active product's BOM (`err_supplier_product_in_recipe`), scoped as packaging by a production process (`err_supplier_product_scoped_as_packaging`), or declared by an active product as its own packaging (`err_supplier_product_declared_on_a_product`). # Get supplier product Source: https://docs.emidat.com/api-reference/supplier-products/get GET /v2/supplier-products/{id} # List supplier products Source: https://docs.emidat.com/api-reference/supplier-products/list GET /v2/supplier-products Lists the supplier products at the plants your key can access. Pass `plant_id` to restrict the results to one plant, `supplier_plant_id` to list everything sourced from one supplier plant, or `transport_route_id` to list everything that travels one transport route. Filter by `external_id` to look up supplier products by your own IDs; repeat the parameter to look up several at once. Paginated — see [Pagination](/pagination). # Update supplier product Source: https://docs.emidat.com/api-reference/supplier-products/update PUT /v2/supplier-products/{id} Full replacement of editable fields. Immutable `plant_id` and `material_type` may be omitted or echoed from the current resource. `external_id` is replaced: re-sending this product's own code succeeds unchanged, while a code held by another active supplier product returns `409`. See [External IDs](/external-ids). The nested `transport_route` object is deprecated. To change the distances of a product's route, take `transport_route_id` from the GET response and update that route with [`PUT /v2/transport-routes/{id}`](/api-reference/transport-routes/update); the edit applies to every product on the route. To move only this product to other distances, create a route with `POST /v2/transport-routes` and send its id here. # Create transport route Source: https://docs.emidat.com/api-reference/transport-routes/create POST /v2/transport-routes Creates a transport route from a source to one of your plants. **Suggested distances** — send no distance at all and the route takes the road distance between the two stored addresses, from the routing provider. Send any distance and the route takes exactly the distances you sent; set a modality to `null` (or leave it out) when the route does not use it. A `plant` at either end must be within the key's plant access (`403`). **Idempotent create** — a replay of the same `Idempotency-Key` returns the original response (`200`); otherwise a new route is created (`201`). # Get transport route Source: https://docs.emidat.com/api-reference/transport-routes/get GET /v2/transport-routes/{id} A route belongs to the plant it delivers to: a destination plant outside the key's plant access returns `403`. # List transport routes Source: https://docs.emidat.com/api-reference/transport-routes/list GET /v2/transport-routes Lists the transport routes on one lane: from `source_id` to `destination_id`. Both ends are required. A source that matches nothing simply narrows the page to nothing. Paginated — see [Pagination](/pagination). # Update transport route Source: https://docs.emidat.com/api-reference/transport-routes/update PUT /v2/transport-routes/{id} Full replacement of the route identified by `id`: send `name` and all three distances. Set at least one distance; `null` clears a modality the route does not use. **The edit applies to every supplier product and prechain product that travels the route.** Those products are not modified themselves, but their transport distances are now the route's, so their transport impacts — and every result built on them — are recomputed. To see what an update will affect before you send it, list [supplier products](/api-reference/supplier-products/list) and [prechain products](/api-reference/prechain-products/list) with `transport_route_id` set to this route. To change the route of a single supplier product, don't update the shared route. Give that product a route of its own instead. You can see every supplier product on the shared route with `GET /v2/supplier-products?transport_route_id={id}`. 1. Optionally, `GET /v2/transport-routes/{id}` the current route if you want to keep any of its values. 2. `POST /v2/transport-routes` with the distances you want. 3. `PUT /v2/supplier-products/{id}` with the new route's id as `transport_route_id`. The other products on the old route keep their distances. `name` must stay unique among the routes on the lane, ignoring case; a name another route holds is rejected with `409`. `source_kind`, `source_id`, `destination_kind` and `destination_id` are fixed at creation: they may be omitted or echoed from a GET response, but cannot be changed. # Authentication Source: https://docs.emidat.com/authentication All endpoints are authenticated with a per-manufacturer API key passed in the `X-API-Key` header. Send it on **every** request: ```http theme={"dark"} X-API-Key: emidat-9f4c1ab7-a7c2f1e9b4d8302c4e6a1f0d9b3e7c2a ``` ## Obtaining an API key API keys are issued per manufacturer and managed by an account **owner**: 1. Log in to the Emidat Platform 2. Navigate to **Settings → Integrations → API Keys** for your manufacturer 3. Click **Create API key**, give it a name, and optionally restrict its **permissions** to specific plants and scopes. 4. Copy the raw key, which is shown **only once** and cannot be retrieved again ## Scopes A key carries a set of scopes, chosen when it is issued. Each endpoint requires one; a key without it gets `403`. | Scope | Grants | | - | - | | `view:plants` | Read plants | | `view:processes` | Read production processes, and the production figures on a product instance | | `edit:processes` | Write the production figures on a product instance | | `view:materials` | Read elementaries, supplier products, silos, composites, and prechain products | | `edit:materials` | Create, update, and delete supplier products, silos, composites, and prechain products | | `view:suppliers` | Read supplier companies and supplier plants | | `edit:suppliers` | Create, update, delete, and merge supplier companies and supplier plants | | `view:products` | Read product instances and their LCA results | | `edit:products` | Create, update, and delete product instances, and run an LCA | | `view:recipes` | Read a BOM, and the per-source impact breakdown of an LCA result | | `edit:recipes` | Write a BOM | | `view:projects` | Read projects, and list and download project reports | | `edit:projects` | Create, update, and delete projects, and generate project reports | | `view:declarations` | Read EPDs | A key can never exceed the permissions of the member who issued it. If that member's role is reduced or their plant access is withdrawn, the key loses the same ground immediately — the scopes stored on it are capped on every request, not at issuance. ## Verify your key `GET /v2/me` reports what the key can do right now. It needs no scope, so any valid key can call it: ```bash theme={"dark"} curl https://api.emidat.com/v2/me \ -H "X-API-Key: emidat-9f4c1ab7-a7c2f1e9b4d8302c4e6a1f0d9b3e7c2a" ``` ```json theme={"dark"} { "manufacturer_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "api_key_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "owner_profile_id": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed", "scopes": ["view:materials", "view:plants"], "plant_ids": ["11111111-1111-1111-1111-111111111111"] } ``` `scopes` and `plant_ids` are the **effective** set, not what was stored at issuance. An empty `plant_ids` means the key currently reaches no plants. See [Introspect API key](/api-reference/me/get). ## Authentication errors | Status | When | | - | - | | `401 Unauthorized` | No credentials; or the key is malformed, unknown, revoked, or expired. The response is uniform and does not reveal which check failed. | | `403 Forbidden` | A valid key lacked the required permission, or targeted a resource outside its access. | > [!WARNING] > > Treat the raw key as a secret. Store it in your secrets manager, never in > source control or logs. If a key is exposed, revoke it and issue a new one. # Errors Source: https://docs.emidat.com/errors Every error response uses the same shape: ```json theme={"dark"} { "msg": "supplier product requires a supplier plant", "err_code": "err_supplier_product_missing_supplier_plant" } ``` * **`err_code`** is a **stable, machine-readable** string. **Branch on this**, never on `msg`. * **`msg`** is a human-readable explanation for logs and operators. Its wording may change at any time — do not parse it. > [!NOTE] > > The code set may grow over time. Treat any `err_code` your integration does not recognize as **non-retryable** and surface it to an operator, rather than assuming success or blindly retrying. ## Where `err_code` appears Three places carry an `err_code`, and they are **not one shared vocabulary**: | Field | Namespace | Meaning | | - | - | - | | `Error.err_code` | `err_*` | The request failed. The catalog below is authoritative. | | `LcaRecomputeJob.err_code` | `err_*` — same catalog | The request succeeded, but the background recompute it started later failed. | | `LcaBlocker.err_code` | separate: `missing_input`, `mass_balance`, `electricity_guarantees_of_origin_mismatch`, `epd_not_usable`, `production_output_mismatch`, `production_process_inactive`, `byproduct` | Nothing failed. A production year cannot be computed until you supply or correct the modelling data it names. | A blocker is not an error: it is expected output of a healthy `200`. Match blocker codes against their own set — an `err_*` code will never appear there, and a blocker code will never appear in an error body. ## HTTP status | Status | Meaning | | - | - | | `400` | The request could not be understood at the HTTP level — a malformed body or header, before any endpoint logic ran. | | `401` | No credentials, or the key is malformed, unknown, revoked, or expired. | | `403` | A valid key lacked the required permission, or targeted a resource outside its access. | | `404` | The addressed entity does not exist. | | `405` | The path exists but does not accept this HTTP method. | | `409` | The request conflicts with current state (e.g. deleting an entity still in use, or an `external_id` already held by another entity). | | `422` | The request failed validation — its body, or a query parameter such as `cursor`. | | `500` | An unexpected server error occurred — surface it to an operator. | | `502` | A transient upstream dependency failed — safe to retry with backoff. | | `503` | The request was understood but could not be carried out right now — nothing changed, retry with backoff. | Each operation's OpenAPI responses are authoritative for which of these statuses it can return. ## Error code catalog The codes reachable from the API endpoints, with the recommended client action. This is the current known set; unknown codes should default to **surface to operator**. | `err_code` | HTTP | When it happens | Client action | | - | - | - | - | | `err_not_authenticated` | 401 | No credentials, or a malformed / unknown / revoked / expired key (uniform — the failing check is not revealed) | Check the API key; not retryable as-is | | `err_permission_denied` | 403 | Key lacks permission or is out of scope | Surface to operator | | `err_entitlement_limit_reached` | 403 | The create would pass your licence's limit, such as its number of product instances | Upgrade the licence, or surface to operator | | `err_address_not_found` | 422 | No location matches the project address | Correct the address and resend | | `err_geocoding_unavailable` | 503 | The project address could not be looked up right now; nothing was saved | Retry with backoff | | `err_not_found` | 404 | The entity addressed by the request path does not exist. A reference in a request body that does not resolve is a `422` instead | Fix the id, resend | | `err_composite_name_exists` | 409 | Another active composite at the same plant already has this name | Choose another name, resend | | `err_composite_used_in_supplier_products` | 409 | The composite is still in use | Remove references first | | `err_idempotency_key_reused` | 409 | The key was already used with different request bytes or a different create endpoint | Use a new key for a different logical create | | `err_idempotency_in_progress` | 409 | A create using this key is still running, or its outcome could not be recorded | Retry the same request with backoff; if persistent, reconcile the result before creating again | | `err_licence_busy` | 409 | Another change on your licence, such as a bulk upload, is still running, so the limit couldn't be checked | Retry the same request with backoff | | `err_external_id_exists` | 409 | The code is already held by another active entity of the same type — on create or on update | Choose another code, resend | | `err_prechain_product_exists` | 409 | That product instance is already registered as a prechain product at that plant | Reuse the existing prechain product | | `err_prechain_product_in_recipe` | 409 | The prechain product is referenced by the BOM of an active product instance | Remove those BOM entries first | | `err_prechain_product_not_main_product` | 409 | Only a main product of a production process can be a prechain product: the instance is a by-product, or has no production process | Register a main product, or set the instance's production process first | | `err_process_output_kind_change` | 409 | The new `production_process_id` would turn the instance from a product of its production process into a by-product, or the other way round | Choose a production process that keeps its kind, or create a new instance | | `err_packaging_scoped_by_the_process` | 409 | The new `production_process_id` scopes a packaging material the instance adds as its own | Remove that material from the instance's packaging, or from the process's packaging scope, first | | `err_packaging_on_a_byproduct` | 409 | The new `production_process_id` makes the instance a by-product while it adds packaging of its own. By-products take their packaging from the production process | Remove the instance's own packaging first | | `err_product_instance_in_recipe` | 409 | The instance is consumed by another active product's BOM | Remove those BOM entries first | | `err_product_instance_has_declarations` | 409 | The instance has a declaration in review or verified | Not deletable while that declaration stands | | `err_production_process_required` | 409 | The update sends no `production_process_id` for an instance that has one. A production process can be changed but not removed | Send the current or another `production_process_id` | | `err_silo_in_use` | 409 | The silo is referenced by the BOM of an active product | Remove those BOM entries first | | `err_silo_name_exists` | 409 | Another active silo or supplier product at the same plant already has this name | Choose another name, resend | | `err_supplier_in_use` | 409 | The supplier company still has active supplier plants | Delete those supplier plants first | | `err_supplier_name_exists` | 409 | Another active supplier company of yours already has this name, ignoring case and surrounding whitespace | Choose another name, or reuse the existing supplier company | | `err_supplier_plant_in_use` | 409 | Active supplier products are still sourced from the supplier plant | Delete those supplier products first | | `err_supplier_plant_name_exists` | 409 | Another active plant of the same supplier company already has this name, ignoring case and surrounding whitespace. Plants of two different supplier companies may share a name | Choose another name, or reuse the existing supplier plant | | `err_supplier_product_declared_on_a_product` | 409 | An active product declares the supplier product as its own packaging, in any year | Remove it from that product's packaging first | | `err_supplier_product_in_recipe` | 409 | The supplier product is referenced by a BOM | Remove references first | | `err_supplier_product_in_silo` | 409 | The supplier product is part of an active silo | Remove it from the silo first | | `err_supplier_product_scoped_as_packaging` | 409 | A production process scopes the supplier product as packaging | Remove it from the process's packaging scope first | | `err_composite_not_allowed_in_recipe` | 422 | The composite material type is not allowed in this product's BOM | Remove the component, resend | | `err_elementary_deactivated` | 422 | The `elementary_id` is no longer active | Choose another material type; operator | | `err_elementary_not_allowed_in_recipe` | 422 | The component's material type is not an ingredient of this product type | Remove the component, resend | | `err_elementary_unknown_matching` | 422 | The `elementary_id` is not recognized | Fix the middleware mapping; operator | | `err_epd_unusable` | 422 | The linked EPD cannot be used | Fix `epd_id`, or surface to operator | | `err_invalid_moisture_content_range` | 422 | `moisture_content_percentage` out of range | Fix input, resend | | `err_invalid_secondary_percentage_range` | 422 | `secondary_percentage` out of range | Fix input, resend | | `err_invalid_lifetime_years` | 422 | `lifetime_years` is not greater than zero | Fix input, resend | | `err_material_no_limited_lifetime` | 422 | `lifetime_years` is set for a material that cannot have a limited lifetime | Remove `lifetime_years`, resend | | `err_lca_allocation_data_incomplete` | 422 | Economic allocation applies to the production process, or it has by-products, but a product or by-product it produces lacks its economic value or its production output for the year | Complete the data on every instance of the process, resend | | `err_lca_production_output_mismatch` | 422 | Economic allocation applies, or the process has by-products, but the production outputs of the process's products and by-products differ from the process's production output by more than 1 %, or its by-products' outputs leave its products none | Correct the outputs or the process total, resend | | `err_material_not_hazardous` | 422 | Hazardous data set on a non-hazardous material | Fix input, resend | | `err_material_process_incompatible` | 422 | The production process does not cover this product's material type | Choose another `production_process_id`, resend | | `err_moisture_content_not_bio_based` | 422 | Moisture content set on a non-bio-based material | Fix input, resend | | `err_not_valid` | 400, 405, 422 | Generic request validation failure, including a malformed `cursor`, an out-of-range `limit`, or a request-body reference that does not resolve to one of your entities. Also carried by a `400` (unparseable request) and a `405` (wrong method for the path) — branch on the status to tell a fixable payload from a wrong call | Fix input, resend | | `err_prechain_circular_reference` | 422 | The BOM would make the instance consume itself, directly or through another instance | Fix the BOM, resend | | `err_process_plant_mismatch` | 422 | The production process belongs to a different plant than the instance | Choose another `production_process_id`, resend | | `err_product_category_not_allowed_at_plant` | 422 | The plant does not produce this material type's category | Choose another plant; operator | | `err_product_mass_larger_than_recipe_mass` | 422 | Product mass exceeds the sum of the mass all items in the BOM | Fix the BOM, resend | | `err_product_mass_not_set` | 422 | The product's mass is unknown, so its BOM cannot be checked | Set the mass-bearing `tech_specs`, resend | | `err_product_missing_gwp_total` | 422 | LCA cannot complete — a contributor is missing GWP | Surface to operator (data completeness) | | `err_product_missing_supplier` | 422 | The product is missing a required supplier | Fix input, resend | | `err_product_type_no_recipe` | 422 | This product type, or a by-product, is modelled without a recipe | Send an empty `bom`, resend | | `err_secondary_percentage_not_customizable` | 422 | Secondary content not customizable for this material | Fix input, resend | | `err_supplier_product_missing_supplier_plant` | 422 | A supplier product needs a supplier plant | Fix input, resend | | `err_unit_not_allowed_for_material` | 422 | The declared `unit` is not one this material type can be declared in | Choose an allowed unit, resend | | `err_not_defined` | 500 | An unexpected server error occurred | Surface to operator | | `err_epd_service` | 502 | The upstream EPD service is unavailable | Retry with backoff | | `err_lca_update_not_queued` | 503 | The LCA recompute could not be queued; nothing was scheduled | Retry with backoff | # External IDs Source: https://docs.emidat.com/external-ids The Emidat API is built so you can drive it with **your own identifiers**, which are considered `external_id` in the following. You attach your identifiers when you create writable entities, filter list endpoints by those same codes, and receive them back on every response. Read-only plants and production processes expose the codes configured in the Emidat UI. References between entities in request bodies use the Emidat `id` (UUID); you obtain each `id` from the create response or by resolving your code with `GET …?external_id=`. ## Two kinds of identifier | Identifier | Who owns it | Scope | Mutable | Example | | - | - | - | - | - | | **Emidat UUID** | Emidat | Global | No | `8f3a1c…` | | **`external_id`** | You | Per-manufacturer | On writable entities, via `PUT` | `PLANT-DE-01`, `SKU-12345` | ## Defining an external_id The `external_id` field is **required on create and full update requests**, but its value can be `null` when you have no code. Omitting the field returns `422`. For writable entities, you set it when you create the entity and can change it later through its `PUT` (see below). It is an arbitrary string you choose — no format rules and no length limit — so your existing ERP codes work as-is. Surrounding whitespace is trimmed, so `"ART-1 "` and `"ART-1"` are the same code, and a string that is empty or whitespace-only is treated as **no code at all**, exactly like `null`, rather than rejected. Plant and production process codes are managed in the Emidat UI instead. Within your manufacturer an `external_id` is unique among active entities of a given type. It is **descriptive only** — not an idempotency key. Creating another entity of the same type with a code that already exists is rejected with `409` (see idempotency below). ## Changing an external_id Every writable entity that carries an `external_id` lets you change it through its `PUT` endpoint. Plants and production processes are read-only in API v2, so their `external_id` must be changed in the Emidat UI. `PUT` is a **full replacement of editable fields**, so send `external_id` on every update, carrying either the code you want or the entity's current one. Passing `null` clears the code. Immutable parent and type fields may be omitted or echoed from the current resource; a different value returns `422`. Uniqueness is re-checked on update. A code held by another active entity of the same type is rejected with `409 err_external_id_exists`; re-sending the entity's **own** current code is not a conflict and succeeds unchanged. Three consequences worth planning for: * The old code **stops resolving** — `GET …?external_id=OLD-CODE` returns an empty page. * The freed code becomes **available again** to another entity of the same type. * **References are unaffected.** Other entities point at this one by its Emidat UUID, never by your code, so no BOM entry or `*_id` field needs updating. ## Addressing an entity One rule, applied to every entity: * **A path parameter is always the Emidat UUID** — `GET /v2/product-instances/{id}` returns that one instance, or `404`. * **Your `external_id` is a filter on the collection** — `GET /v2/product-instances?external_id=SKU-12345` returns a page whose `data` holds the single instance carrying that code, or is empty if none does. The filter is **optional**: omitting it lists every instance you can access, one page at a time. See [Pagination](/pagination). Because uniqueness makes the filtered result at most one item, a code lookup and a full listing are the same endpoint — you never need a separate call shape for the two. To resolve many codes at once, repeat the filter, up to 200 times — `GET /v2/product-instances?external_id=SKU-1&external_id=SKU-2` returns the instances carrying either code. Codes nothing carries are left out rather than rejected, and the result is paginated like any other list. ## Idempotent creation `external_id` is **not** an idempotency key — idempotency comes solely from the `Idempotency-Key` header. **`Idempotency-Key` header.** Generate a unique key of 1–255 characters (e.g. a UUID) per logical create and send it as `Idempotency-Key: `. Empty keys or keys longer than 255 characters return `422`. A replay carrying the same key returns the **original response unchanged** (`200`). Reusing a key with a *different* request body or create endpoint is rejected with `409 err_idempotency_key_reused`. Bodies are compared byte for byte, including JSON whitespace and key order. Keys are scoped to your manufacturer and retained for **6 hours**; after that a replay is treated as a new create. Successful responses are retained for six hours from completion; replaying a response does not extend that window. If creation fails before any database commit is attempted, the key is released so a corrected request can reuse it. A concurrent retry receives `409 err_idempotency_in_progress`; retry the same request with backoff. Deduplication is best effort and relies on Redis: cache loss can end the window early. Redis unavailability, timeouts, or unreadable cache entries can allow creation without replay protection, so retries can create duplicates. If creation succeeds but caching the response fails or its reservation expires, the API still returns the created entity with `201`. Redis waits share a two-second budget per request, excluding creation time. Reservation lookup uses at most one second, leaving time to cache the result or release a failed reservation. Exhausting that budget can leave a pending reservation even when creation succeeded. Incompatible replay-format upgrades start a new cache namespace. Replay protection does not carry across that boundary: retrying a request created under an older version can create another entity. Requests created under the new version are protected normally; old entries expire independently. Once a database commit is attempted, a failed create keeps any surviving reservation because the entity may already exist. This includes a lost commit response, interrupted request, or failed impact calculation or refresh. A failure to cache a successful response or a stopped process can also leave a reservation. These keys can remain reserved for up to six hours; shortening this window could allow a retry to create a duplicate. Reconcile the result (using `external_id` where available) before trying a new create. Every retry requires current permissions for the endpoint and the plants authorized during the original create. Changes to referenced entities do not invalidate the cached response: create-time reference validation runs only when creating. For product instances, the effective `view:processes` and `edit:processes` scopes must match the original request; either gaining or losing one returns `403`. Unrelated scope changes do not prevent replay. So the status tells you what happened: `201` = created, `200` = a key replay returned the original entity. The request body is **not** re-applied on a `200` — to change an entity, use its `PUT` endpoint. Because `external_id` is unique per type, a `POST` carrying an `external_id` that already exists is rejected with `409` — it is never silently deduplicated. ## Referencing other entities When a request body points at another entity, you reference it by its **Emidat `id` (UUID)** — never by your own code. There are two ways to obtain that UUID: * For an entity you **just created** this run, use the `id` from its create response (the create response always returns it). * For an entity you **don't already have the UUID for**, resolve it first with `GET …?external_id=YOUR-CODE`, whose `data` holds at most one item with its `id`. This works only for entities that **have** an `external_id`; one created without a code can be referenced only via the `id` returned by its create response, or by walking the unfiltered list. ```http theme={"dark"} GET /v2/supplier-products?external_id=CEMENT-SUPPLIER-DE-001 → 200 { "data": [ { "id": "33333333-3333-3333-3333-333333333333", "external_id": "CEMENT-SUPPLIER-DE-001", … } ], "next_cursor": null } ``` Then use that `id` wherever a reference is needed — for example as a BOM entry's `ref`: ```json theme={"dark"} PUT /v2/product-instances/{id}/bom { "bom": [ { "type": "supplier_product", "ref": "33333333-3333-3333-3333-333333333333", "amount": 0.18, "amount_unit": "KG" } ] } ``` # Introduction Source: https://docs.emidat.com/introduction ## What is the Emidat API? The Emidat API is designed for manufacturers integrating from ERP systems or any automated workflow. It lets you create product instances and supplier products programmatically. ## Preview endpoints Some endpoints carry a Preview tag in the navigation. They are live and supported, but their contract is not frozen yet: request and response shapes, field names, and error codes may still change in ways that break existing integrations, and we may do so without a deprecation period. ## Key concepts > [card] > > Manufacturer > Created on UI > > Your Emidat tenant that owns everything below. Your API key is scoped to your tenant automatically. > [card] > > Company > Created on UI > > The legal entity you operate under. One manufacturer can have multiple companies. > [card] > > Plant > Created on UI > > One of your manufacturing sites that belongs to a company, with its own > address, energy mix, and production processes. > [card] > > Production Process > Created on UI > > The manufacturing process at a plant including its inputs, outputs, energy, and > packaging. A product instance references one to describe how it is made. > [card] > > Product > Created on UI > > A product you sell, independent of any plant. It is linked to the product > instances that manufacture it — read it via the API to resolve your article > numbers to the product a declaration or EPD is about. > [card] > > Product Instances > Created via API > > A product instance is a specific plant-level product with a BOM. An instance > can reference supplier products, silos and prechain products in its BOM. > [card] > > Prechain Product > Created via API > > An existing product instance used as an upstream ("prechain") input at one of > your plants with an optional transport route to that plant. > [card] > > Supplier Company > Created via API > > An entity that supplies you with products or raw materials. > [card] > > Supplier Plants > Created via API > > A supplier plant is the physical origin of a supplier product. > [card] > > Supplier Products > Created via API > > Purchased inputs to your products that are sourced from supplier plants. Each > carries LCA impact data from a linked EPD or Emidat background datasets. > [card] > > Silos > Created via API > > Optional: Group same-type supplier products at a plant into a single silo — > one supplier today, more as they are added. > [card] > > Composites > Created via API > > Optional: Define a reusable mix of materials by percentage at a plant. > [card] > > Elementary > Emidat managed > > A material type from Emidat's global catalog (e.g., cement, glass, aluminium). Emidat maintains these. > [card] > > Material Type > Classification > > How a supplier product's material is classified: either an Emidat elementary or one of your own > composites. Set it when you create a supplier product. # Pagination Source: https://docs.emidat.com/pagination Every collection `GET` in the API is a paginated list endpoint. They all behave the same way: `cursor` and `limit` go in as query parameters, a `{ data, next_cursor }` envelope comes back. ## The envelope ```json theme={"dark"} GET /v2/supplier-products?limit=2 { "data": [ { "id": "33333333-3333-3333-3333-333333333333", "name": "Portland Cement CEM I 42.5 R", … }, { "id": "44444444-4444-4444-4444-444444444444", "name": "Limestone filler", … } ], "next_cursor": "Y3Vyc29yOjQ0NDQ0NDQ0" } ``` * **`data`** — the items on this page, at most `limit` of them. * **`next_cursor`** — pass it back as `cursor` to get the next page. It is `null` on the last page, and that is the **only** reliable end-of-collection signal: a page can be full and still be the last one. ## Walking a collection Request the first page without a `cursor`, then keep feeding `next_cursor` back until it comes back `null`: ```http theme={"dark"} GET /v2/supplier-products?limit=100 GET /v2/supplier-products?limit=100&cursor=Y3Vyc29yOjQ0NDQ0NDQ0 GET /v2/supplier-products?limit=100&cursor=Y3Vyc29yOjc3Nzc3Nzc3 → "next_cursor": null ← done ``` Keep `limit` and any filters identical across the pages of one walk. A cursor belongs to the query that produced it; changing the query mid-walk gives you undefined coverage. ## Parameters | Parameter | Default | Notes | | - | - | - | | `cursor` | — | Opaque token from the previous page's `next_cursor`. Omit it for the first page. Never construct or parse one — the encoding is not part of the contract and may change. | | `limit` | `50` | Items per page, between `1` and `200`. | A `cursor` the API cannot decode, or a `limit` out of range, is rejected with `422` (`err_not_valid`). See [Errors](/errors). ## Ordering Items come back in a stable order, so walking a collection that is not changing underneath you visits every item exactly once. The order is an implementation detail — it is not a meaningful sort, so do not rely on it to present data or to infer recency. Entities created or deleted while a walk is in progress may or may not appear in it. ## Filtering by your own codes Lists of manufacturer-owned entities take an optional `external_id` filter. This is how you resolve one of your own codes to an Emidat `id`: ```http theme={"dark"} GET /v2/supplier-products?external_id=CEMENT-SUPPLIER-DE-001 → 200 { "data": [ { "id": "33333333-3333-3333-3333-333333333333", "external_id": "CEMENT-SUPPLIER-DE-001", … } ], "next_cursor": null } ``` An `external_id` is unique per entity type within your manufacturer, so `data` holds at most one item; an empty `data` means no active entity carries that code. To resolve several codes in one request, repeat the parameter, up to 200 times: ```http theme={"dark"} GET /v2/supplier-products?external_id=CEMENT-SUPPLIER-DE-001&external_id=SAND-SUPPLIER-DE-002 ``` `data` then holds one item per code that matches, in the usual order and paged as usual; codes nothing carries are left out rather than rejected. See [External IDs](/external-ids). # Using AI Agents Source: https://docs.emidat.com/using-ai-agents Our API is built with agentic use in mind and we strongly encourage experimentation with them to streamline your own workflows on the Emidat platform. This guide walks you through an example of a tedious task made simple by connecting a coding agent to Emidat through our API. This guide will use [Claude Code](https://claude.com/de/product/claude-code) as a coding agent. Similar principles apply for other tools like [OpenAI Codex](https://openai.com/codex/), [Pi](https://pi.dev/) or [OpenCode](https://opencode.ai/?ref=grigio.org). ## Set up a workspace for your project In our experience coding agents work best if you create a project directory that can contain their work. For instance, this will allow your agent to save scripts it writes, read input files and write output files. To get started, simply create an empty directory with just a single file: **.env** You can use the `.env` file to store the API key you use to authenticate with the Emidat API: ```text theme={"dark"} EMIDAT_API_KEY=emidat-{key_id}-{secret} ``` ## Teach your agent how to use our API We offer a Model Context Protocol (MCP) server that your agent can use to teach itself how to use the Emidat API. You can install it with the following command: ```text theme={"dark"} claude mcp add --transport http emidat-docs https://docs.emidat.com/mcp ``` You can also point your agent to our skill file in your prompt if you do not want to configure an MCP connection: ``` Use this skill to understand the Emidat API: https://docs.emidat.com/skill.md ``` ## Ask your agent to solve the issue At this point you are fully set up to ask your agent to create a bespoke automation for the task you require, you could for instance ask it to do the following: ```text theme={"dark"} We have rebranded from SmallCo to BigCo. Our product instances currently all contain "SmallCo" in their names. Write a script that replaces "SmallCo" with "BigCo" in all of our product instances. Use this skill to understand the Emidat API: https://docs.emidat.com/skill.md The file ".env" contains the required API key. ```