# Deleting multiple elements using maapi api

**URL:** <https://dmap-community.ductus.global/t/deleting-multiple-elements-using-maapi-api/3559>\
**Category:** CDB and CDB API\
**Created:** [March 17, 2021, 5:15pm UTC](https://dmap-community.ductus.global/t/deleting-multiple-elements-using-maapi-api/3559 "2021-03-17T17:15:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mah](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@mah](https://dmap-community.ductus.global/u/mah)\
**Post date:** [March 17, 2021, 5:15pm UTC](https://dmap-community.ductus.global/t/deleting-multiple-elements-using-maapi-api/3559/1 "2021-03-17T17:15:19Z")

</div>

maapi\_delete takes the keypath of a single element and deletes it.  
Is there a way to delete multiple presence containers (or a combination of a presence container and an optional leaf) in a single maapi call ?  
[I’m looking for something on the lines of maapi\_load\_config\_cmds()]

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [March 17, 2021, 5:53pm UTC](https://dmap-community.ductus.global/t/deleting-multiple-elements-using-maapi-api/3559/2 "2021-03-17T17:53:41Z")

</div>

You can use maapi\_set\_values(), see the confd\_lib\_maapi(3) man page, the confd\_lib\_cdb(3) man page for the similar oper data only cdb\_set\_values() function, and examples.confd/intro/13-c\_stats\_push/arpstat.c for an example.

---

<div class="post-metadata">

**Author:** ![mah](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@mah](https://dmap-community.ductus.global/u/mah)\
**Post date:** [March 18, 2021, 12:13pm UTC](https://dmap-community.ductus.global/t/deleting-multiple-elements-using-maapi-api/3559/3 "2021-03-18T12:13:29Z")

</div>

Thanks… will try it out
