Delete all Instances

This route deletes all instances from a specific provider in the marketplace and is accessible to both providers and admins.

Delete All Provider Instances

This endpoint permanently deletes all instances associated with a specific provider, without deleting the provider's account itself. This is a powerful, irreversible action. The endpoint supports both Administrator and Provider roles.

  • Admins can delete all instances for any provider.
  • Providers can only delete all of their own instances.

Endpoint

DELETE /api/v1/providers/{pro_id}/instances

Authentication

TypeRequiredLocationDescription
Admin Key OR Provider KeytrueHeaderThe key must be sent as x-api-key: YOUR_API_KEY.

The behavior of this endpoint depends on the type of key provided.


URL Parameters

ParameterTypeRequiredDescription
pro_idstringtrueThe unique ID of the provider whose instances are to be deleted.

Request

This endpoint does not require a request body.

Example Requests

As an Administrator

This request deletes all instances belonging to the provider with the specified pro_id. Replace SOME_PROVIDER_ID and YOUR_ADMIN_KEY.

curl -X DELETE 'https://offers.dataoorts.com/api/v1/providers/SOME_PROVIDER_ID/instances' \
-H 'x-api-key: YOUR_ADMIN_KEY'

As a Provider

This request deletes all of the authenticated provider's own instances. The pro_id in the URL must match the ID associated with the provided API key.

curl -X DELETE 'https://offers.dataoorts.com/api/v1/providers/YOUR_OWN_PRO_ID/instances' \
-H 'x-api-key: YOUR_PROVIDER_API_KEY'

Responses

✅ Success Response (200 OK)

Returned when the instances are successfully deleted. The message will indicate the number of instances removed.

Body

{
  "status": "Success",
  "message": "Success: Deleted 15 instances associated with provider 'PRO_15052024120000123'."
}

Note: If the provider has no instances, the message will state that "Nothing to delete." and the operation will still be considered successful.


❌ Error Response (401 Unauthorized)

Returned if the x-api-key header is missing or the provided key is invalid.

Body

{
  "error": "Unauthorized: Invalid API key."
}
❗️

More than three failed authentication attempts will result in a permanent IP block.


❌ Error Response (403 Forbidden)

This error is specific to Providers. It is returned when a provider attempts to use this endpoint with a pro_id in the URL that does not belong to them.

Body

{
  "error": "Forbidden",
  "details": "You can only delete your own assets. The provided provider_id does not match your account API key."
}

❌ Error Response (500 Internal Server Error)

Returned for database errors or other unexpected issues on the server during the deletion process.

Body

{
  "error": "A database error occurred",
  "details here": "Specific error message from the database driver."
}