# CoAP

# CoAP

This module includes configuration variables for CoAP.

## Summary

| ### Macros ||
|---|---|
| `https://openthread.io/reference/config/group/config-coap#group__config-coap_1ga8f953ca2533ea96e02cefbdf32a13192 0` | Define to 1 to enable the CoAP API. |
| `https://openthread.io/reference/config/group/config-coap#group__config-coap_1ga5929f629e6afe99399e5e34b4e2673ab 0` | Define to 1 to enable the CoAP Block-Wise Transfer. |
| `https://openthread.io/reference/config/group/config-coap#group__config-coap_1ga1c6ec3144e6f5dd76bf8bce844d9da3e 1024` | This setting configures the maximum length of one block during a CoAP Block-Wise Transfer. |
| `https://openthread.io/reference/config/group/config-coap#group__config-coap_1ga6376d114364796db75545258a4c27750 0` | Define to 1 to enable the CoAP Observe (RFC7641) API. |
| `https://openthread.io/reference/config/group/config-coap#group__config-coap_1gaae41df41102e7e15f7e3cccf730b7f3b 0` | Define to 1 to enable the CoAP Secure API. |
| `https://openthread.io/reference/config/group/config-coap#group__config-coap_1gaedf008db60fa06472e6b0558722f28a1 10` | Maximum number of cached responses for CoAP Confirmable messages. |

## Macros

### OPENTHREAD_CONFIG_COAP_API_ENABLE

```
 OPENTHREAD_CONFIG_COAP_API_ENABLE 0
```
Define to 1 to enable the CoAP API.

### OPENTHREAD_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE

```
 OPENTHREAD_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE 0
```
Define to 1 to enable the CoAP Block-Wise Transfer.

### OPENTHREAD_CONFIG_COAP_MAX_BLOCK_LENGTH

```
 OPENTHREAD_CONFIG_COAP_MAX_BLOCK_LENGTH 1024
```
This setting configures the maximum length of one block during a CoAP Block-Wise Transfer.

### OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE

```
 OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0
```
Define to 1 to enable the CoAP Observe (RFC7641) API.

### OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE

```
 OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0
```
Define to 1 to enable the CoAP Secure API.

### OPENTHREAD_CONFIG_COAP_SERVER_MAX_CACHED_RESPONSES

```
 OPENTHREAD_CONFIG_COAP_SERVER_MAX_CACHED_RESPONSES 10
```
Maximum number of cached responses for CoAP Confirmable messages.

Cached responses are used for message deduplication.

## Resources

OpenThread API Reference topics originate from the source code, available
on [GitHub](https://github.com/openthread/openthread/tree/main/include/openthread).
For more information, or to contribute to our documentation, refer to
[Resources](https://openthread.io/resources).