Skip to main content

Update AdSet Status

The Update AdSet Status API allows users to enable or disable an active adset at any time, providing flexibility in adset management.

warning

It is important to handle adset data securely and ensure that access is restricted to authorized users only.

API Endpoint

Method: POST

URL: https://<PA_RM_END_POINT>/retail-media/adsets/{adsetId}/update-status

info

Please refer to the Supplier API documentation for detailed instructions on how to retrieve the supplierId.

Request Header

NameValue
Content-Typeapplication/json
AuthorizationBearer ACCESS_TOKEN

Request Parameters

ParameterTypeDescription
adsetIdGUIDId of the adset to update

Example Request Payload

{
"status": true
}
ParameterTypeRequiredDescription
statusBooleanStatus of the campaign.
If status = true (The AdSet is running).
If status = false (The AdSet is paused).

Response Payload

Success Response

  • Status Code: 200 OK
  • Payload: Returns the success message of the operation in JSON format
{
"status": "success",
"message": "AdSet status updated successfully",
"adSetId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Error Response

If an error occurs, the API will return an appropriate status code along with an error message.

  • Sample Error Response (400 Bad Request):
{
"errors": [
"Error message 1",
"Error message 2"
],
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "xxxxxxxxxxxxxxxxxxx"
}

Example Usage (JavaScript)

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "BEARER YOUR_ACCESS_TOKEN");

const body = JSON.stringify(
{
"status": true
}
)

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: body
};

fetch("https://<PA_RM_END_POINT>/retail-media/adsets/{adsetId}/update-status", requestOptions)
.then(response => response.json())
.then(result=> {
console.log(result);
})
.catch(error => console.log('error', error));