> For AI agents: the complete documentation index is available at https://types-mediawiki-response.pages.dev/llms.txt, the full documentation bundle is available at https://types-mediawiki-response.pages.dev/llms-full.txt.

# Interface: ApiMessage

Defined in: [envelope/index.ts:30](https://github.com/BearBin1215/types-mediawiki-response/blob/c1e25ea2ef2684b43c79e05d6e0dd36e33fbc9a3/src/envelope/index.ts#L30)

A single message under a modern `errorformat` (an entry of the `errors` or
`warnings` array). Which text-bearing field is present depends on the
format: `text` for `plaintext`/`wikitext`, `html` for `html`, `key`/`params`
for `raw`.

## Properties

### code

> **code**: `string`

Defined in: [envelope/index.ts:32](https://github.com/BearBin1215/types-mediawiki-response/blob/c1e25ea2ef2684b43c79e05d6e0dd36e33fbc9a3/src/envelope/index.ts#L32)

Machine-readable code, e.g. `badvalue`, `unrecognizedparams`.

***

### data?

> `optional` **data?**: `unknown`

Defined in: [envelope/index.ts:50](https://github.com/BearBin1215/types-mediawiki-response/blob/c1e25ea2ef2684b43c79e05d6e0dd36e33fbc9a3/src/envelope/index.ts#L50)

Extra structured data some messages attach.

***

### html?

> `optional` **html?**: `string`

Defined in: [envelope/index.ts:38](https://github.com/BearBin1215/types-mediawiki-response/blob/c1e25ea2ef2684b43c79e05d6e0dd36e33fbc9a3/src/envelope/index.ts#L38)

Parsed message HTML (`errorformat=html`).

***

### key?

> `optional` **key?**: `string`

Defined in: [envelope/index.ts:41](https://github.com/BearBin1215/types-mediawiki-response/blob/c1e25ea2ef2684b43c79e05d6e0dd36e33fbc9a3/src/envelope/index.ts#L41)

i18n message key (`errorformat=raw`).

***

### module?

> `optional` **module?**: `string`

Defined in: [envelope/index.ts:47](https://github.com/BearBin1215/types-mediawiki-response/blob/c1e25ea2ef2684b43c79e05d6e0dd36e33fbc9a3/src/envelope/index.ts#L47)

Module the message originated from, e.g. `main`, `query+info`.

***

### params?

> `optional` **params?**: [`ApiMessageParam`](https://types-mediawiki-response.pages.dev/api/core/ApiMessageParam.md)\[]

Defined in: [envelope/index.ts:44](https://github.com/BearBin1215/types-mediawiki-response/blob/c1e25ea2ef2684b43c79e05d6e0dd36e33fbc9a3/src/envelope/index.ts#L44)

i18n message parameters (`errorformat=raw`).

***

### text?

> `optional` **text?**: `string`

Defined in: [envelope/index.ts:35](https://github.com/BearBin1215/types-mediawiki-response/blob/c1e25ea2ef2684b43c79e05d6e0dd36e33fbc9a3/src/envelope/index.ts#L35)

Rendered message (`errorformat=plaintext`/`wikitext`).
