---
title: "Correct the site (or entity-only stamp) of up to 1000 source records and their emission rows"
method: POST
path: "/emissions/site-assignment"
tags: ["Emissions"]
---

# Correct the site (or entity-only stamp) of up to 1000 source records and their emission rows

`POST /emissions/site-assignment`

All or nothing: any id that is not a live source record of the organization answers 404 and
nothing changes (another organization's record reads as unknown). siteId and entityId cannot
both be set; siteId null with no entityId unassigns. Only JSON null unassigns: a blank or
whitespace siteId or entityId is a 400. Each changed record gets an audit row.
Error codes: 400 VALIDATION_ERROR; 404 NOT_FOUND; 422 SITE_NOT_ASSIGNABLE, ENTITY_NOT_ASSIGNABLE.

## Request body

- EmissionSiteAssignmentRequest
  - `entityId` string, nullable — Entity-level stamp with no site; only when siteId is null
  - `siteId` string, nullable, required — Target site; null unassigns (or stamps entityId alone)
  - `sourceRecordIds` string[], required

## Response `200`

Records reassigned

- EmissionSiteAssignmentResponse
  - `data` object, required
    - `unchangedCount` integer, required
    - `updatedCount` integer, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `422` — A referenced id is not an active record of the selected organization (ENTITY_NOT_ASSIGNABLE, SITE_NOT_ASSIGNABLE), or the reference would be invalid for it, such as an entity parent that forms a cycle (ENTITY_CYCLE)

## Changes

- **2026-10-02** `766c2a40e369` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/greentally/apis/esgai-api/changes/emissions/site-assignment/post.md)

---

[API](https://skmtc.dev/greentally/apis/esgai-api.md) · [All operations](https://skmtc.dev/greentally/apis/esgai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/greentally/apis/esgai-api/revisions/77d466d0e73d?raw)
