# API question “Update Project"

**URL:** https://community.doppler.com/t/api-question-update-project/1659
**Category:** Need Help
**Created:** [November 1, 2024, 2:12pm UTC](https://community.doppler.com/t/api-question-update-project/1659 "2024-11-01T14:12:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MikevdBerge](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/mikevdberge/32/376_2.png) [@MikevdBerge](https://community.doppler.com/u/MikevdBerge)
#### Post date: [November 1, 2024, 2:12pm UTC](https://community.doppler.com/t/api-question-update-project/1659/1 "2024-11-01T14:12:17Z")

</div>

Trying to use the [https://docs.doppler.com/reference/projects-update](https://docs.doppler.com/reference/projects-update) API call.  
The result of the API call is a new project and not an updated project. I would expect the output of the call that the name of the project would change not that it would create a new project 😏.

---

<div class="post-metadata">

### Author: ![watsonian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/watsonian/32/267_2.png) [@watsonian](https://community.doppler.com/u/watsonian)
#### Post date: [November 1, 2024, 3:16pm UTC](https://community.doppler.com/t/api-question-update-project/1659/2 "2024-11-01T15:16:30Z")

</div>

Hi @MikevdBerge!

I’m not sure how you got that result. I just tested this and if the project specified in the request exists, it renames in place. A new project isn’t created. If the specified project doesn’t exist, you receive an error (it doesn’t create a new project).

This results in the `example-project` project getting renamed to `example-project-renamed`. The single secret and integration sync that were on the project were still there post-rename, confirming that the project wasn’t destroyed and recreated.

```bash
❯ curl -X POST "https://api.doppler.com/v3/projects/project" \
     -H "Authorization: bearer $(doppler configure get token --plain)" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     --data '
{
  "project": "example-project",
  "name": "example-project-renamed"
}
'
{"project":{"id":"example-project-renamed","slug":"example-project-renamed","name":"example-project-renamed","description":null,"created_at":"2024-11-01T15:08:51.995Z"},"success":true}

```

This shows that you get an error if you specify a project that doesn’t exist:

```bash
❯ curl -X POST "https://api.doppler.com/v3/projects/project" \
     -H "Authorization: bearer $(doppler configure get token --plain)" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     --data '
{
  "project": "example-project-foo",
  "name": "example-project"
}
'
{"messages":["Could not find requested project 'example-project-foo'"],"success":false}

```

Could you post the exact API call you were making that resulted in a new project?

---

<div class="post-metadata">

### Author: ![MikevdBerge](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/mikevdberge/32/376_2.png) [@MikevdBerge](https://community.doppler.com/u/MikevdBerge)
#### Post date: [November 1, 2024, 3:42pm UTC](https://community.doppler.com/t/api-question-update-project/1659/3 "2024-11-01T15:42:01Z")

</div>

Setup before the update

 ![image](https://us1.discourse-cdn.com/flex016/uploads/doppler/original/2X/a/a780beaf1db487237ee1c587c0c68cc0100b5ca4.png)  
Postman request for the update  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/doppler/original/2X/6/60d6d2cc772edec36945fccfb204c6fd1cfbb27e.png)  
Result in Doppler  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/doppler/original/2X/6/6c858ed625884e9ef8ca012a0cc7132c8de79aa8.png)

While testing I noticed what I was doing wrong. I was using the projects endpoint instead of the projects/project endpoint.  
So it’s working now but I think the update on the projects endpoint should have failed.

Regards  
Mike
