Create a cleanup
How to create a cleanup via API
To create a new cleanup, send a POST
request to the /api/cleanups
endpoint, passing the resource arguments in the request body.
Request
POST https://yourdomain.commercelayer.io/api/cleanups
Arguments
Body Parameter
Type
Required
type
string
Required
attributes.resource_type
string
Required
attributes.filters
object
Optional
attributes.reference
string
Optional
attributes.reference_origin
string
Optional
attributes.metadata
object
Optional
Example
The following request creates a new cleanup:
curl -g -X POST \
'https://yourdomain.commercelayer.io/api/cleanups' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token' \
-H 'Content-Type: application/vnd.api+json' \
-d '{
"data": {
"type": "cleanups",
"attributes": {
"resource_type": "skus"
}
}
}'
Last updated