---
title: "Change consumer Inbox routing"
method: PUT
path: "/mail-routing"
tags: ["Inbox"]
---

# Change consumer Inbox routing

`PUT /mail-routing`

## Request

- Base URL: `https://api.primitive.dev/v1`
- URL: `https://api.primitive.dev/v1/mail-routing`
- Auth: HTTP bearer

Mailbox-scoped exact visible audiences, excluding the owner and Bcc. Direct and group audiences are independent. Restores persist an explicit Conversations rule. New writes require the observed version (zero creates); only an identical latest mutation with its original expected version can be retried. Stale writes return mail_routing_conflict. Source messages and read state are unchanged. Merge paged rules by version; responses are never cached.

## Request body

- PutMailRoutingRequest
  - `mailbox` string, email, required
  - `participants` string[], required
  - `placement` 'inbox' | 'conversations', required
  - `expected_version` integer, required
  - `mutation_id` string, required

## Response `200`

Current routing

- object
  - `success` true, required
  - `data` MailRoutingUpdate, required
    - `mailbox` string, email, required
    - `item` object, required
      - `conversation_key` string, required
      - `placement` 'inbox' | 'conversations', required
      - `version` integer, required
      - `mutation_id` string, required
      - `updated_at` string, required

## Other responses

- `400`: Invalid request parameters
- `401`: Invalid or missing API key
- `404`: Resource not found
- `409`: mail_routing_conflict: the observed version or mutation does not match
- `429`: Rate limit exceeded. The `ratelimit-*` headers describe the limiter that rejected this request, with its own limit and window, not the API budget that successful responses report. A limiter that reports only a wait sends `Retry-After` alone.

## Changes

> 32 revisions in range; 1 not diffed.

- **2026-11-03** `bce409c97acb`: 155 warning
  - added the new `access_mode_unavailable` enum value to the `error/code` response property for the response status `400`
  - added the new `access_mode_unavailable` enum value to the `error/code` response property for the response status `401`
  - added the new `access_mode_unavailable` enum value to the `error/code` response property for the response status `404`
  - added the new `access_mode_unavailable` enum value to the `error/code` response property for the response status `409`
  - …151 more
  - …this revision’s changelog is incomplete
- **2026-10-21** `0360ea8d4f3d`: 65 warning
  - added the new `agent_changed` enum value to the `error/code` response property for the response status `400`
  - added the new `agent_changed` enum value to the `error/code` response property for the response status `401`
  - added the new `agent_changed` enum value to the `error/code` response property for the response status `404`
  - added the new `agent_changed` enum value to the `error/code` response property for the response status `409`
  - …61 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/primitive/apis/primitive-api/changes/mail-routing/put.md)

---

[API](https://skmtc.dev/primitive/apis/primitive-api.md) - [All operations](https://skmtc.dev/primitive/apis/primitive-api/llms.txt) - [OpenAPI document](https://skmtc.dev/primitive/apis/primitive-api/revisions/bce409c97acb?raw)
