# IOutbox.Withdraw(MessageId)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.ioutbox/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.ioutbox/methods/)

```csharp
public abstract bool Withdraw(MessageId messageId)
```

Synchronously stages, for the grain's next journal write, the removal of a pending message which a registered [IOutboxMessageSource](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.ioutboxmessagesource/) provides.

### Parameters

- `messageId` (`MessageId`): The ID of a message sent through [IOutbox](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.ioutbox/).

### Returns

`true` when the outbox staged the removal; `false` when no such message is pending.

### Exceptions

- `System.InvalidOperationException`: The ID is pending as an ordinary message, or the outbox is unavailable.
