# Write Transactions

In the last section we discussed the reading interactions of Attributes and
Events. In this section we'll discuss the **writing** of Attributes, which is
the change of an Attribute value on a Cluster such as *Level*.

## Untimed Write Transaction

![Sequence of operations of a Untimed Write Transaction](https://developers.home.google.com/static/matter/primer/images/primer-im-untimed-writing.png) *Figure 1: Untimed Write Transaction*

### Write Request Action

Direction: Initiator -\> Target

Similar to the Read Request Action, in this Action the Initiator provides the
Target with:

- **Write Requests**: a list of one or more tuples containing Path and data.
- **Timed Request**: a flag that indicates whether this Action is part of a Timed Write Transaction.
- **Suppress Response**: a flag that indicates whether the Response Status Action should be suppressed.

### Write Response Action

Direction: Target -\> Initiator

After the Target receives the Write Request Action it will finalize the
transaction with a Write Response Action that carries:

- **Write Responses**: a list of paths and error codes for every Write Request sent on the Write Request Action.

### Untimed Write Restrictions

The Write Request Action may be a groupcast, but in this case the Suppress
Response flag must be set. The rationale is that otherwise the network might be
flooded by simultaneous responses from every member of a group.

To enable this behavior, the Path used in the Write Requests list may contain
Groups and alternatively they may contain wildcards, but only on the Endpoint
field.

## Timed Write Transaction

![Sequence of operations of a Timed Write Transaction](https://developers.home.google.com/static/matter/primer/images/primer-im-timed-writing.png) *Figure 2: Timed Write Transaction*

Timed write transactions add a few steps to untimed write transactions.

### Timed request action

Direction: Initiator -\> Target

A Initiator starts the Transaction sending this Action that contains:

- **Timeout**: how many milliseconds this transaction may remain open. During this period the next action sent by the Initiator will be considered valid.

Once the Timed Request Action is received, the Target must acknowledge the
Timed Request Action with a Status Response Action. Once the Initiator receives
a Status Response Action reporting no errors, it will send a Write Request
Action.

### Write Request Action

Same as the previously described [Write Request Action](https://developers.home.google.com/matter/primer/interaction-model-writing#im-writing-write-request).

### Write Response Action

Same as the previously described [Write Response Action](https://developers.home.google.com/matter/primer/interaction-model-writing#im-writing-write-response).

### Timed Write Restrictions

The Timed Request Action, the Write Request Action and the Write Response Action
are unicast-only.