# Not able to delete artifacts with APIs

**URL:** <https://community.sonatype.com/t/not-able-to-delete-artifacts-with-apis/7650>\
**Category:** Sonatype Nexus Repository\
**Created:** [November 12, 2021, 3:30pm UTC](https://community.sonatype.com/t/not-able-to-delete-artifacts-with-apis/7650 "2021-11-12T15:30:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![palla714](https://avatars.discourse-cdn.com/v4/letter/p/ac8455/32.png) [@palla714](https://community.sonatype.com/u/palla714)\
**Post date:** [November 12, 2021, 3:30pm UTC](https://community.sonatype.com/t/not-able-to-delete-artifacts-with-apis/7650/1 "2021-11-12T15:30:29Z")

</div>

I am using cURL command to delete an artifact package, but there I am getting the following error

> 

\< HTTP/1.1 403 Forbidden  
\< Server: Nexus/3.30.0-01 (OSS)  
\< X-Content-Type-Options: nosniff  
\< Content-Security-Policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation  
\< X-XSS-Protection: 1; mode=block  
\< Content-Length: 0

Here I am using this command  
curl -v -u ${NEXUS\_CREDS} -X “DELETE” http://${SONATYPE\_NEXUS\_SERVICE\_SERVICE\_HOST}:${SONATYPE\_NEXUS\_SERVICE\_SERVICE\_PORT}/repository/${NEXUS\_REPO\_NAME}/${APP\_NAME}/${PACKAGE}

This command is running as a Jenkins job and all variables are assigned values. Can anyone please confirm why Nexus is giving this error and how to find the root cause.

---

<div class="post-metadata">

**Author:** ![dsawa](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/dsawa/32/729_2.png) [@dsawa](https://community.sonatype.com/u/dsawa)\
**Post date:** [November 12, 2021, 3:38pm UTC](https://community.sonatype.com/t/not-able-to-delete-artifacts-with-apis/7650/2 "2021-11-12T15:38:23Z")

</div>

Hi Pallavi,  
Status code _403 Forbidden_ means you do not have permissions to delete the asset.

---

<div class="post-metadata">

**Author:** ![mmartz](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@mmartz](https://community.sonatype.com/u/mmartz)\
**Post date:** [November 12, 2021, 5:27pm UTC](https://community.sonatype.com/t/not-able-to-delete-artifacts-with-apis/7650/3 "2021-11-12T17:27:15Z")

</div>

403 Forbidden could mean your login credentials were incorrect, or it could mean they were correct but you didn’t have delete permissions on the asset or repository.

---

<div class="post-metadata">

**Author:** ![palla714](https://avatars.discourse-cdn.com/v4/letter/p/ac8455/32.png) [@palla714](https://community.sonatype.com/u/palla714)\
**Post date:** [November 15, 2021, 10:36am UTC](https://community.sonatype.com/t/not-able-to-delete-artifacts-with-apis/7650/4 "2021-11-15T10:36:21Z")

</div>

Thanks all. I got it resolved. Is there anyway to delete component using Nexus API calls?

---

<div class="post-metadata">

**Author:** ![mmartz](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@mmartz](https://community.sonatype.com/u/mmartz)\
**Post date:** [November 15, 2021, 2:16pm UTC](https://community.sonatype.com/t/not-able-to-delete-artifacts-with-apis/7650/5 "2021-11-15T14:16:53Z")

</div>

You can find the swagger UI for our REST APIs under Admin \> System \> API. I believe there is a delete on the component API.
