Approve a suggestion
POST
/api/v1/workspaces/{workspaceId}/suggestions/{suggestionId}/approve
const url = 'https://api.crossmart.io/api/v1/workspaces/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/suggestions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/approve';const options = {method: 'POST'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.crossmart.io/api/v1/workspaces/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/suggestions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/approveApplies the change the way an edit would (a channel override, synced to the store), and returns it APPLIED. When its field changed since it was made, nothing is applied and it returns STALE. A suggestion that is no longer pending answers 409.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”workspaceId
required
string format: uuid
suggestionId
required
string format: uuid
Responses
Section titled “Responses”Media typeapplication/json
object
id
required
string format: uuid
productId
required
string format: uuid
productTitle
required
string
imageUrl
required
string
connection
required
The store the change is for; null for the product’s own content
object
id
required
string format: uuid
channel
required
string
displayName
required
string
kind
required
string
status
required
string
currentValue
required
The value it replaces, as it was when it was made
string
proposedValue
required
string
rationale
required
Why the agent proposes it
string
createdBy
required
object
type
required
string
agent
required
The agent that made it, for AGENT suggestions
string
userId
required
Who asked for it
string format: uuid
apiKeyId
required
string format: uuid
name
required
The user’s or API key’s name
string
review
required
object
userId
required
string format: uuid
apiKeyId
required
string format: uuid
name
required
string
reviewedAt
required
string format: date-time
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
Example
{ "productTitle": "Stoneware Mug", "connection": { "channel": "shopify", "displayName": "Demo Store" }, "kind": "listing_title", "status": "PENDING", "createdBy": { "type": "AGENT", "agent": "content_generator" }}