---
updatedAt: 2025-09-24T21:43:39.000Z
agentTools:
  projectIndex: https://docs.quable.com/llms.txt
---

# Delete predefined values

```python Python
import csv
import requests
import logging

# Configuration des logs
logging.basicConfig(filename='pim_api.log', level=logging.INFO, format='%(asctime)s - %(levelname)s: %(message)s')

# Votre jeton d'accès API
api_token = "your_token"

# Identifiants de votre PIM
pim_api_url = "https://your_instance.quable.com"

# Ouvrir le fichier CSV (delimiter semicolon)
with open('values_to_delete2.csv', newline='') as csvfile:
    csvreader = csv.DictReader(csvfile, delimiter=';')
    
    for row in csvreader:
        attribute_code = row['attribute_code']
        value_code = row['value_code']
        print(value_code + ' ' + attribute_code)
        # Headers pour inclure le jeton d'accès dans la requête
        headers = {
            "Authorization": f"Bearer {api_token}"
        }

        payload = {}

        response = requests.delete(f"{pim_api_url}/api/predefined-values/attribute={attribute_code};code={value_code}", json=payload, headers=headers)

        if response.status_code == 200:
            message = f"Predefined value '{value_code}' of attribute '{attribute_code}' deleted successfully."
            logging.info(message)
            print(message)
        else:
            message = f"An error occured wile deleting value '{value_code}' of attribute '{attribute_code}': {response.text}"
            logging.error(message)
            print(message)

```

```json Response Example
{"success":true}
```

# delete values