activeRevision means two things depending on where it is. Inside patchRevision or revisions, true makes the revision being written the live one. At the top level of the body it is the record's relation to its live revision, so it takes a revision id, and true there is refused with a 422 and nothing is saved. Move it inside the revision object.
Answer
API requests
"Invalid reference to related records at activeRevision; expecting an id" when I send activeRevision: true
HTTP Real answers from this documentation site's sandbox page
PUT /cdna-api/pages/page/1885
{"activeRevision": true, "patchRevision": {"originRevision": 3488, "areaContent(navSection)": "API sandbox"}}
# 422 "Invalid reference to related records at activeRevision; expecting an id for a single record or a list of ids for multiple records"
PUT /cdna-api/pages/page/1885
{"patchRevision": {"originRevision": 3482, "activeRevision": true, "areaContent(navSection)": "devdocs"}}
# 200: the new revision, 3483, is live
PUT /cdna-api/pages/page/1885
{"activeRevision": 3482}
# 200: an existing revision made live again, by its id
See Making a revision live, rolling back and publishing.
In the API reference: Make an earlier revision live.
More in API requests
Was this page helpful?
Your answer goes to the docs team.