palbaseDocs

Palbase Flags · API

POST/flags/templates/restore/{version}

Restore a version

Starts the shared draft from an earlier version, expecting the active version named in If-Match; published, it becomes the next version.

Called by your server, with the project's secret key.

Path

versionstring · requiredA template version.

Headers

If-Matchstring · requiredThe active template's ETag ("flags-active-<version>").
curl
curl -X POST "https://<your-ref>.palbase.studio/flags/templates/restore/<version>" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{}'

Responses

201The draft

400The request is malformed, or a definition or a value breaks a flag's rules (the error names which)

401No key, or not a key of this project, or a token that is not valid (the edge's answer)

403Not the project's secret key

404No flag with this key, no value of the user's own for it, no such template, or no such experiment

409The project's state refuses it: publishing is on, users' values stand in the way, a managed flag's rule, a draft already exists, an experiment runs on the flag

412The template or draft changed since it was read (If-Match)

415A template request is application/json

428If-Match is required: read the template or draft and send its ETag

429The project's request rate, or its flag reads for the period under its quota, are used up; Retry-After says when to try again

503The platform could not answer now; retrying is safe (Retry-After)

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation RestoreTemplateVersion of flags's contract.