Approve the active step of an approval for a content version that is in review. For multi-step approvals, the version remains in review until all steps are approved.
1 min
POST
https://api.cms.optimizely.com/v1/content/{key}/versions/{version}:approve
Path Parameters
- keystringrequiredDescription
- versionstringrequiredDescription
Header Parameters
- Preferstring[]Example
[ "return=representation" ]
Description - If-MatchstringDescription
- If-Unmodified-Sincestring<http-date>DescriptionFormathttp-date
Body Parameters
- bodyApprovalDecisionOptionsDescription
- commentstringDescriptionMax Length255
- forcebooleanDescription
Responses
200
- ContentVersionDescription
- objectContentData
- bindingContentBindingDescription
- contentTypeBindingstringDescription
- sourcestring<uri>requiredDescriptionFormaturi
- propertiesmap<string, PropertyData>Description
- object
- keystringDescription
- localestringDescription
- versionstringDescription
- variationstringDescription
- contentTypestringDescription
- displayNamestringrequiredDescriptionMin Length1Max Length255
- publishedstring<date-time>DescriptionFormatdate-time
- expiredstring<date-time>DescriptionFormatdate-time
- statusstringExamplesdraftreadypublishedpreviousscheduledrejectedinReviewDescription
- delayPublishUntilstring<date-time>DescriptionFormatdate-time
- routeSegmentstringDescriptionMax Length255
- simpleRoutestringDescriptionMax Length253Pattern^[^/].*$
- lastModifiedstring<date-time>Formatdate-time
- lastModifiedBystring
- compositionCompositionNodeDescription
- idstringDescription
- displayNamestringDescriptionMax Length255
- nodeTypestringrequiredDescriptionMin Length1
- layoutTypestringDescription
- displaySettingsCompositionDisplaySettingsDescription
- displayTemplatestringrequiredDescriptionMin Length1
- settingsmap<string, string>Description
- componentContentComponentDescription
- ContentData
- bindingContentBindingDescription
- contentTypeBindingstringDescription
- sourcestring<uri>requiredDescriptionFormaturi
- propertiesmap<string, PropertyData>Description
- object
- referencestring<uri>DescriptionFormaturi
- contentTypestringDescription
- nodesCompositionNode[]Description
- Circular-Reference
- mediaMediaDataDescription
- keystringDescriptionPattern^[a-f0-9]{32}\.[a-zA-Z0-9]{1,20}$
Response Headers
- ETagstringDescription
- Last-Modifiedstring<http-date>DescriptionFormathttp-date
- Content-LocationstringDescription
- Preference-Applied
204
400
401
403
404
412
429
- ProblemDetails
- typestring<uri>DescriptionFormaturi
- titlestringDescription
- statusinteger<int32>DescriptionFormatint32Minimum100Maximum599
- detailstringDescription
- instancestring<uri>DescriptionFormaturi
- codestringDescription
- errorsobject[]Description
- detailstringDescription
- fieldstringExampleDescription
Response Headers
- Retry-AfternumberDescription
500
curl
curl --request POST \
--url https://api.cms.optimizely.com/v1/content/{key}/versions/{version}:approve \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'POST',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.cms.optimizely.com/v1/content/{key}/versions/{version}:approve", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.cms.optimizely.com/v1/content/{key}/versions/{version}:approve")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.cms.optimizely.com/v1/content/{key}/versions/{version}:approve"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// OK
{
"binding": {
"contentTypeBinding": "",
"source": ""
},
"properties": "",
"key": "",
"locale": "",
"version": "",
"variation": "",
"contentType": "",
"displayName": "",
"published": "",
"expired": "",
"status": "draft",
"delayPublishUntil": "",
"routeSegment": "",
"simpleRoute": "",
"lastModified": "",
"lastModifiedBy": "",
"composition": {
"id": "",
"displayName": "",
"nodeType": "",
"layoutType": "",
"displaySettings": {
"displayTemplate": "",
"settings": ""
},
"component": {},
"nodes": [
{
"": ""
}
]
},
"media": {
"key": ""
}
}204
// No Content
400
// Bad Request
401
// Unauthorized
403
// Forbidden
404
// Not Found
412
// Precondition Failed
429
// Too Many Requests
{
"type": "",
"title": "",
"status": "",
"detail": "",
"instance": "",
"code": "",
"errors": [
{
"detail": "",
"field": "properties.header.displayName"
}
]
}500
// Internal Server Error