---
title: "Upsert assignments"
method: PUT
path: "/api/v1-beta/customers/{id}/assignments"
tags: ["Governance Assignments"]
---

# Upsert assignments

`PUT /api/v1-beta/customers/{id}/assignments`

Batched create-or-update of capability assignments. Existing assignments matched by (entityId, capabilityId) are updated; new pairs are created. On update, omitted fields (usageLimit, cadence) are preserved; on create both are required by the governance service.

## Path parameters

- `id` string, required

## Headers

- `X-ACCOUNT-ID` string
- `X-ENVIRONMENT-ID` string

## Request body

- UpsertAssignmentsRequestDto — Request body for creating or updating capability assignments in bulk for a single customer
  - `assignments` object[], required — Assignments to upsert (1–100 per request)
    - `entityId` string, required — The entity ID this assignment is attached to
    - `featureId` string — Feature ID this assignment grants. Mutually exclusive with `currencyId`.
    - `currencyId` string — Currency ID this assignment grants (credit budgets). Mutually exclusive with `featureId`.
    - `scopeEntityIds` string[]
    - `parentId` string, nullable — Parent entity ID in the hierarchy. Omit to leave the current parent untouched (a new node defaults to a root); `null` detaches to a root; an ID sets or changes the parent. Reparenting an existing node is leaf-only.
    - `usageLimit` number, nullable — Maximum usage allowed within one cadence window (required on create)
    - `cadence` string — Usage-reset cadence (required on create) as an ISO-8601 single-unit duration, e.g. `P1M`, `P30D`, `PT1M`.

## Response `200`

Assignments after upsert.

- UpsertAssignmentsResponseDto — Assignments after upsert.
  - `data` object[], required
    - `id` string, uuid, required — Synthetic UUID identifier — also the cursor anchor for paginated lists
    - `entityId` string, required — The entity ID this assignment is attached to
    - `featureId` string — Feature ID this assignment grants (present for feature capabilities).
    - `currencyId` string — Currency ID this assignment grants (present for credit capabilities).
    - `scopeEntityIds` string[], required — Dimension-scoped sub-budget key: the set of entity IDs this budget applies to. Empty is the node-wide budget that always matches; a non-empty set only applies when every listed entity is present in the resolved set (order-insensitive).
    - `parentId` string, nullable, required — Parent entity ID in the hierarchy, or `null` for a root.
    - `usageLimit` number, nullable, required — Maximum usage allowed within one cadence window
    - `cadence` string, required — Usage-reset cadence as an ISO-8601 single-unit duration, e.g. `P1M`, `P30D`, `PT1M`.
    - `createdAt` string, date-time, required — Timestamp of when the record was created
    - `updatedAt` string, date-time, required — Timestamp of when the record was last updated

## Other responses

- `400` — bad request.
- `401` — User is not authenticated.
- `403` — User is not allowed to access this resource.
- `404` — Assignment not found.
- `429` — Too many requests.

---

[API](https://skmtc.net/stiggio/apis/stigg-api.md) · [All operations](https://skmtc.net/stiggio/apis/stigg-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/stiggio/stigg-api/revisions/3e2c8cfcd035/schema)
