Skip to main content
PATCH
/
v1
/
custom-kpi-datasets
/
{dataset_id}
/
assignments
/
{assignment_id}
Update Assignment
const options = {
  method: 'PATCH',
  headers: {
    'x-api-key': '<x-api-key>',
    'x-organization-id': '<x-organization-id>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({data_owner_email: '<string>', data_owner_user_id: '<string>'})
};

fetch('https://api.dcycle.io/v1/custom-kpi-datasets/{dataset_id}/assignments/{assignment_id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "id": "<string>",
  "dataset_id": "<string>",
  "organization_id": "<string>",
  "facility_id": {},
  "data_owner_user_id": {},
  "data_owner_email": "<string>",
  "created_at": {},
  "updated_at": {}
}

Update Assignment

Change the data owner details of an existing assignment. Only send the fields you want to change.
The organization_id and facility_id cannot be changed after creation. To reassign to a different org or facility, delete the assignment and create a new one.

Request

Headers

x-api-key
string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Path Parameters

dataset_id
string
required
UUID of the parent dataset
assignment_id
string
required
UUID of the assignment to update

Body Parameters

All fields are optional.
data_owner_email
string
New data owner email address
data_owner_user_id
string
New Dcycle user UUID for the data owner

Response

Returns the updated assignment (HTTP 200).
id
string
Assignment UUID.
dataset_id
string
Parent dataset UUID.
organization_id
string
Organization UUID the assignment targets.
facility_id
string | null
Facility UUID if the assignment is facility-scoped.
data_owner_user_id
string | null
User UUID of the data owner (if they have a Dcycle account).
data_owner_email
string
Email address of the recipient.
created_at
datetime
Creation timestamp (ISO 8601).
updated_at
string | null
Last update timestamp (ISO 8601).

Example

curl -X PATCH "https://api.dcycle.io/v1/custom-kpi-datasets/${DATASET_ID}/assignments/${ASSIGNMENT_ID}" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "Content-Type: application/json" \
  -d '{"data_owner_email": "new-manager@example.com"}'

Successful Response

{
  "id": "d4e5f6a7-b8c9-0123-defa-234567890123",
  "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "organization_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa",
  "facility_id": null,
  "data_owner_user_id": null,
  "data_owner_email": "new-manager@example.com",
  "created_at": "2025-06-10T08:00:00Z",
  "updated_at": "2025-06-18T15:30:00Z"
}

Common Errors

401 Unauthorized

Cause: Missing or invalid API key
{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}

403 Forbidden

Cause: The authenticated user is not a member of the organization
{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}

404 Not Found

Cause: Assignment not found
{
  "detail": "Assignment not found"
}

List Assignments

View all assignments

Delete Assignment

Remove an assignment