# Change project settings

Rename a project, change its platform, how long its events are kept, how many it accepts per minute, and whether senders' IP addresses are kept.

Replace _project-id_ with the project's id. The alert settings of the same form are described in
[Set the default alerts](set-default-alerts.md).

## Prerequisites

- Permission for `errors:UpdateProject` on the project. Without it, the console shows the settings
  read-only, with the note "Changing settings needs errors:UpdateProject on this project."
- In the console, also `errors:ListProjects` on the project to open it (without it the project is
  not found).

## The settings

| Setting                        | Values                                                  | A new project | What it does                                                                                                                                                                                                             |
| ------------------------------ | ------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Name                           | 1–64 characters                                         | as created    | The display name. The slug does not change with it.                                                                                                                                                                      |
| Platform                       | Next.js, Browser JavaScript, Node.js, Python, Go, Other | as created    | Chooses the setup snippet on the **Setup** tab. Events of any SDK are accepted either way.                                                                                                                               |
| Retention                      | 30, 60 or 90 days                                       | 30 days       | How long an event is kept. A change applies to events received from then on; events already stored keep the retention they arrived with.                                                                                 |
| Rate limit (events per minute) | 1–1 000 000, or empty                                   | empty         | The most error events the project accepts per minute; transactions and profiles do not count against it. Empty leaves only the organization's quota. Over it the ingest answers `429` and the SDK pauses sending errors. |
| Keep client IP addresses       | on or off                                               | off           | On: when the SDK asks for the sender's address (`{{auto}}`), it is stored with the event. Off: no address is stored, even when the SDK sends one.                                                                        |

Stored events are billed per GB-month, so a longer retention costs more.

## Change the settings

**Console**
1. Open the project, then the **Settings** tab.
2. Under **Project**, change **Name** or **Platform**.
3. Under **Data**, change **Retention**, **Rate limit (events per minute)** or
   **Keep client IP addresses**.
4. Choose **Save**. Every **Save** on the tab saves the whole form, the default alerts included.

The console shows "Saved." A form it cannot send names the problem beside **Save**, for example
"The rate limit is a whole number of events per minute, or empty."

**CLI**
```sh
dcloud errors projects update project-id --retention-days 90 --rate-limit-per-minute 5000
```

**API**
```http
PATCH /errors/api/projects/project-id
{ "retentionDays": 90, "rateLimitPerMinute": 5000, "storeClientIp": false }
```

Send only the fields you change. `"rateLimitPerMinute": null` removes the project's limit. The
answer is `200` with the project.

**Terraform**
```hcl
resource "dcloud_errors_project" "web" {
  name                  = "web"
  platform              = "javascript-nextjs"
  rate_limit_per_minute = 5000
  store_client_ip       = false
}
```

## Result

The ingest picks up a new retention, rate limit or client-IP setting within seconds; the events it
receives from then on are handled with it.

## When a change is refused

- `400` for an empty body, a retention other than 30, 60 or 90, or a value out of range.
- `404` when the project does not exist.

## Related

- [Manage DSN keys](manage-dsn-keys.md): a rate limit per key.
- [How events are received](how-events-are-received.md)
- `errors.projects.update` · `dcloud errors projects update` · `dcloud_errors_project`
