Security, Privacy, AI and CSR information for all Piano products now lives in one place. Explore our Compliance Center.
Audience
English French
English French

/segment/restore

Description

API call to restore deleted segments


  • Requires write access to the site group, the same access that allows deleting segments there. Without it the call fails with Permission denied and nothing is restored.

  • Internal segments and segments in a standard group can be restored only by admins.

  • All the segment ids should be from one site group. A segment id that does not belong to the site group is reported the same way as an unknown id: No restorable segment [<id>] found in site group [<siteGroupId>]. Skipped.

  • Only segments deleted no more than 90 days ago can be restored.


Request

The request object has the following fields:

Name

Type

Required

Description

segmentIds

Array Of String

Yes

All the segment ids need to be restored

siteGroupId

String

Yes

The site group identifier of restorable segments

Response

The call answers 200 whatever happened to each segment. Read restoredIds to see which segments came back.

The response object has the following fields:

Name

Type

Description

restoredIds

Array of String

The segments that were restored.

skipped

Object

The segments that were not restored and why, by segment id: for example, a segment it uses is still deleted.

failed

Object

The segments whose restore was attempted and failed, by segment id, with the error.

messages

Array of String

The same outcome in words: successfully restored, skipped, failed.

Examples

Bash
$ python cx.py /segment/restore '{"siteGroupId":"10501", "segmentIds": ["1y2hkqwvv58ls", "1y2hkqwvv58ln", "1y2hkqwvv58lp"]}'
{
 "messages": [
 "Segments successfully restored: [1y2hkqwvv58ls]",
 "Restore failed for segment: 1y2hkqwvv58ln. Error message",
 "No restorable segment [1y2hkqwvv58lp] found in site group [10501]. Skipped"
 ],
 "restoredIds": ["1y2hkqwvv58ls"],
 "skipped": {
 "1y2hkqwvv58lp": "No restorable segment [1y2hkqwvv58lp] found in site group [10501]. Skipped"
 },
 "failed": {
 "1y2hkqwvv58ln": "Error message"
 }
}

Last updated: