Set Organization Camera Assignments
PUT /api/v1/organizations/{organizationId}/camera-assignmentsAtomically change access and analytics delegation for up to 100 cameras. If-Match is the organization revision from the assignment snapshot; each change also carries its camera assignment revision. Idempotency-Key is a UUID scoped to the authenticated actor. An identical retry returns the original receipt, even after later changes; refresh the snapshot for current state. Reusing the key with different changes is rejected. New customer assignment requires a disabled camera without analytics rules or enabled face recognition. Historical ownership never changes. All changes, session revocation, audit, and the retry receipt commit together. Cameras omitted from the request remain unchanged.
Access
Section titled “Access”Authentication options declared in the contract include user cookie session or bearer service token.
The shared authentication policy requires organizationAccounts:manage. Resource access also depends on the caller’s role, organization, camera grants, and the operation’s validation.
User-session writes require recent authentication.
The handler requires an EyesOnIt system administrator. Use an administrator user session for this operation.
Authentication and permissions explains tokens, cookies, CSRF, and workspace context.
Parameters
Section titled “Parameters”| Name | Location | Required | Type | Description and constraints |
|---|---|---|---|---|
organizationId |
path | Yes | string (uuid) | |
If-Match |
header | Yes | integer | minimum 1 |
Idempotency-Key |
header | Yes | string (uuid) | |
X-EyesOnIt-Session-Id |
header | No | string (uuid) | The sessionId the caller expects. Required when switching workspaces and for cookie requests after workspace rotation. A mismatched value returns 409 with X-EyesOnIt-Workspace-Changed: 1. Bootstrap with getCurrentPrincipal; never replay a mutation automatically after changing context. Bearer clients do not use this header. |
X-CSRF-Token |
header | No | string | Required for unsafe requests authenticated by CookieSession; ignored for bearer clients. minimum length 32. maximum length 256 |
Request body
Section titled “Request body”Required.
application/json — SetCameraAssignmentsBody.
| Field | Type | Required | Description and constraints |
|---|---|---|---|
changes |
array of CameraAssignmentChangeBody | Yes | minimum items 1. maximum items 100 |
cURL request template
Section titled “cURL request template”Set the connection variables described in Get started. Replace each additional EOI_… variable with the parameter value for this request. Prepare the body file using the request schema above. This template sends the request when run.
curl --fail-with-body --silent --show-error \ --request PUT \ --cookie "${EOI_COOKIE_JAR}" \ --header "X-EyesOnIt-Session-Id: ${EOI_SESSION_ID}" \ --header "X-CSRF-Token: ${EOI_CSRF_TOKEN}" \ --header "If-Match: ${EOI_IF_MATCH}" \ --header "Idempotency-Key: ${EOI_IDEMPOTENCY_KEY}" \ --header "Content-Type: application/json" \ --data-binary @request.json \ "${EOI_API_BASE_URL}/organizations/${EOI_ORGANIZATIONID}/camera-assignments"Contract responses
Section titled “Contract responses”The table records responses declared by the OpenAPI contract. See Errors and status codes for the runtime error envelope and shared failures.
| Status | Description | Media type | Body |
|---|---|---|---|
| 200 | Successful Response | application/json |
CameraAssignmentSnapshotResponse |
| 409 | Ownership, lifecycle, or idempotency conflict. | — | Empty body |
| 412 | Organization or camera revision changed; refresh before retrying. | — | Empty body |
| 422 | Validation Error | application/json |
HTTPValidationError |
Operation identifier setOrganizationCameraAssignments. Browse Organizations and workspaces.
