Activate and deactivate adverts

Activate ads

Endpoint: POST https://api.olxgroup.com/advert/v1/<ADVERT UUID>/activate

You can use this endpoint to activate an advert that is currently deactivated. This operation is equivalent to clicking on "restore" in the Inactive tab on the portal's My Account section.

curl --location --request POST 'https://api.olxgroup.com/advert/v1/<ADVERT UUID>/activate'\
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <YOUR API KEY>' \
--header 'Authorization: Bearer <ACCESS TOKEN>' \
--header 'User-Agent: <CRM NAME>'

Note that you can only activate ads that were deactivated:

  • through the deactivate endpoint
  • by the user on the portal (not available for imovirtual.com)

In addition "visible_in_profile"parameter returned by the Advert Notifications and Get Meta endpoints has to be set to true.

Deactivate ads

Endpoint: POST https://api.olxgroup.com/advert/v1/<ADVERT UUID>/deactivate

You can use this endpoint to deactivate an advert that is currently active.

curl --location --request POST 'https://api.olxgroup.com/advert/v1/<ADVERT UUID>/deactivate'\
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <YOUR API KEY>' \
--header 'Authorization: Bearer <ACCESS TOKEN>' \
--header 'User-Agent: <CRM NAME>'

Please note that it is not possible to deactivate previously deleted advert. If you have received a webhook with field "visible_in_profile": false it means that the advert is not present in the user's profile and cannot be deactivated.

Notifications

Activating and deactivating adverts changes their status and therefore generates lifecycle events. Check out the relevant notifications for these events on the Advert Lifecycle page.

📘

Automatic advert deactivation/activation for Imovirtual

In Imovirtual, when a user package/subscription expires, all the adverts under that account are immediately deactivated, with the status outdated_by_package.

If the user buys a new package or has a scheduled subscription, all the adverts that were previously deactivated due to package expiry are automatically reactivated. In those cases, no manual action is necessary.

You only need to display to the user the notification received for both automatic operations thought the lifecycle notification. Learn more in the Advert Lifecycle page.