Restore a segment version
Saves a copy of an older version as the new draft; publish it to use it.
Saves a copy of an older version as the new draft; publish it to use it.
apiKey writeAuthorizationBearer <token>A workspace API key (pf_…), created under Developers → API keys.
Scope: write
id*string^(seg)_[0-9A-Za-z]{8}$idempotency-key?stringRun this write once: a retry with the same key gets the first answer (24 hours).
1 <= length <= 255application/json- body
versionId*stringuuidOK
application/json- response
id*string^(tmpl|comp|brand|otype|seg|camp|auto)_[0-9A-Za-z]{8}$kind*stringname*stringfolder*|The folder it’s in; null at the top level
status*string"draft""published""archived"draftVersionId*stringuuidpublishedVersionId*|uuidhasUnpublishedChanges*booleancreatedAt*stringdate-timeupdatedAt*stringdate-timearchivedAt*|date-timedraft*curl -X POST 'https://api.postforge.dev/v1/segments/string/restore' \ -H 'Content-Type: application/json' \ -d '{ "versionId": "14707576-2549-4848-82ed-f68f8a1b47c7"}'{ "id": "string", "kind": "string", "name": "string", "folder": { "id": "string", "name": "string" }, "status": "draft", "draftVersionId": "e7fc80a1-b65e-482e-8fcd-f6c647b4104b", "publishedVersionId": "9786f1b1-ef7e-4f6a-94c4-c8eb67e924eb", "hasUnpublishedChanges": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "archivedAt": "2019-08-24T14:15:22Z", "draft": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "definitionId": "string", "parentVersionId": "abf80970-9686-419e-bc00-5ddcccc33ba6", "origin": "edit", "schemaVersion": 0, "author": { "type": "user", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" }, "createdAt": "2019-08-24T14:15:22Z", "openedAt": "2019-08-24T14:15:22Z", "definition": { "description": "string", "conditions": { "type": "and", "conditions": [ { "type": "and", "conditions": [ null ] } ] } } }}Publish a segment version POST
Makes the version the one in use, after the checks before publish (422 with the problems found).
Count an audience POST
Starts counting the profiles (the known ones the profiles list shows) that meet `conditions`, or a segment’s: its published version or its draft. Answers at once with the count’s id; read it until it’s `done`. A condition that can’t be answered is a 400 with its path, before anything is counted.