# Delete imported contract using script

**URL:** <https://forum.ansible.com/t/delete-imported-contract-using-script/44679>\
**Category:** Get Help\
**Tags:** cisco\
**Created:** [October 14, 2025, 1:52pm UTC](https://forum.ansible.com/t/delete-imported-contract-using-script/44679 "2025-10-14T13:52:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaizalaa](https://avatars.discourse-cdn.com/v4/letter/k/bbe5ce/32.png) [@kaizalaa](https://forum.ansible.com/u/kaizalaa)\
**Post date:** [October 14, 2025, 1:52pm UTC](https://forum.ansible.com/t/delete-imported-contract-using-script/44679/1 "2025-10-14T13:52:56Z")

</div>

trying to remove imported contracts with the help of ansible. i dont see any specific module for this so i tried to write it using aci\_rest. my script is working fine and runs successfully but it’s not removing the contract still. would be really helpful if someone could help ! thanks

````auto
- name: Remove imported contracts
  hosts: 
  connection: local
  gather_facts: no
 
  tasks:
    - name: Delete imported contracts from tenants
      cisco.aci.aci_rest:
        hostname: "{{ inventory_hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: no
        method: delete
        path: "api/node/mo/uni/tn-/brc-.json"```
````

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [October 22, 2025, 8:31pm UTC](https://forum.ansible.com/t/delete-imported-contract-using-script/44679/2 "2025-10-22T20:31:03Z")

</div>

Does the [cisco.aci.aci\_contract](https://docs.ansible.com/ansible/latest/collections/cisco/aci/aci_contract_module.html) module help? I think the `cisco.aci.aci_rest` path may need to include the tenant and contract, for example `/api/node/mo/uni/tn-{{ tenant }}/brc-{{ contract }}.json`.
