# `Ory.Api.Courier`

API calls for all endpoints tagged `Courier`.

# `get_courier_message`

```elixir
@spec get_courier_message(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, Ory.Model.Message.t()}
  | {:ok, Ory.Model.ErrorGeneric.t()}
  | {:error, Tesla.Env.t()}
```

Get a Message
Gets a specific messages by the given ID.

### Parameters

- `connection` (Ory.Connection): Connection to server
- `id` (String.t): MessageID is the ID of the message.
- `opts` (keyword): Optional parameters

### Returns

- `{:ok, Ory.Model.Message.t}` on success
- `{:error, Tesla.Env.t}` on failure

# `list_courier_messages`

```elixir
@spec list_courier_messages(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, Ory.Model.ErrorGeneric.t()}
  | {:ok, [Ory.Model.Message.t()]}
  | {:error, Tesla.Env.t()}
```

List Messages
Lists all messages by given status and recipient.

### Parameters

- `connection` (Ory.Connection): Connection to server
- `opts` (keyword): Optional parameters
  - `:page_size` (integer()): Items per Page  This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination).
  - `:page_token` (String.t): Next Page Token  The next page token. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination).
  - `:status` (CourierMessageStatus): Status filters out messages based on status. If no value is provided, it doesn't take effect on filter.
  - `:recipient` (String.t): Recipient filters out messages based on recipient. If no value is provided, it doesn't take effect on filter.

### Returns

- `{:ok, [%Message{}, ...]}` on success
- `{:error, Tesla.Env.t}` on failure

---

*Consult [api-reference.md](api-reference.md) for complete listing*
