Skip to main content

patch_data_requests

PATCH /data_requests/:feedback_id​

Updates or appends segments and updates respondent contact information (email, phone_number) for the provided feedback (GDPR right to rectification).

  • Partial update: Only the attributes and segments specified in the request are modified; any existing segments or attributes remain untouched.
  • Auto-create segments: If a specified segment is not yet present on the feedback, it is automatically added (unless company has managed segments enabled).
  • HTTP Methods: Supports both PATCH and PUT.

Endpoints​

  • PATCH /api/v1/data_requests/:feedback_id
  • PATCH /api/v1/data_requests?filter[feedback_id]=:feedback_id
  • PATCH /api/v1/data_requests/:data_subject/:feedback_id: (legacy)

Request Examples​

curl -X PATCH 'https://api.diduenjoy.com/api/v1/data_requests/PUT-YOUR-FEEDBACK-ID' \
-u 'PUT-YOUR-API-KEY-HERE:' \
-H 'Content-Type: application/json' \
-d '{
"email": "updated@example.com",
"segments": {
"store": "Paris",
"vip": "true"
}
}'

Payload Examples​

Updates or adds a single segment (defaults to replace mode):

{
"segments": {
"store": "Paris"
}
}

Attributes​

attributetypedescription
segmentshash { string: string }Optional. Key-value pairs of segments to update or add.
emailstringOptional. Update respondent email address.
phone_numberstringOptional. Update respondent phone number.
update_modestringOptional. Update mode: replace (default) or append.
separatorstringOptional. Separator when update_mode is append. Accepted values: ; (default) or ,.
note
  • If the company has managed segments enabled, all segment keys provided must already exist in the company's segments list.
  • When using the legacy :data_subject route (/api/v1/data_requests/:data_subject/:feedback_id), email and phone_number cannot be updated if :data_subject does not match the survey's data subject.

Possible data_subject values (legacy)​

  • contractor
  • customer
  • employee
  • other
  • prospect
  • suppliers
  • to_be_defined
  • trainee
  • visitor

Status Codes​

statusdescription
200 OKResource updated and returned successfully.
401 UnauthorizedMissing or invalid API key.
404 Not FoundFeedback not found or does not belong to the company.
422 Unprocessable ContentValidation error: missing feedback_id, invalid update_mode (only replace or append), invalid separator (only ; or ,), segment not allowed by managed segments, or attribute does not match data_subject.