---
title: Set Headers
description: Learn how to use EIPs
documentId: ipaas-eips-setheaders
locale: en-US
---

The **Set Headers** EIP defines or modifies multiple HTTP headers simultaneously in a single step, optimizing configuration when you need to set several headers at once.

<Callout type="note" title="NOTE">
To configure headers individually, one per step, use the [**Set Header**](/docs/integrations/ipaas-eips-setheader) EIP.
</Callout>

## Parameters

| Parameter | Description | Default value | Type |
|-----------|-----------|--------------|------|
| Headers | (required) Displays the headers that will be defined or modified. | | List |

## Example

This flow returns mocked information for 4 courses from an online school and sets headers for tracking:

```yaml
- from:
    uri: rest:post:/buscar-cursos
    steps:
      - log:
          message: "Initiating course search..."
      - setBody:
          expression:
            constant: |
              [
                {
                  "nome": "JavaScript Avançado",
                  "cargaHoraria": 40,
                  "valor": 299.90
                },
                {
                  "nome": "Python para Data Science",
                  "cargaHoraria": 60,
                  "valor": 450.00
                },
                {
                  "nome": "DevOps com Docker",
                  "cargaHoraria": 32,
                  "valor": 350.00
                },
                {
                  "nome": "React Native",
                  "cargaHoraria": 48,
                  "valor": 399.90
                }
              ]
      - setHeaders:
          headers:
            - name: Content-Type
              expression:
                constant: application/json
            - name: X-School-ID
              expression:
                constant: "tech-school-2025"
            - name: X-Request-Timestamp
              expression:
                simple: ${date:now:yyyy-MM-dd'T'HH:mm:ss}
      - log:
          message: "Courses retrieved: ${body}"
```

**Returned response:**

```json
[
  {
    "nome": "JavaScript Avançado",
    "cargaHoraria": 40,
    "valor": 299.90
  },
  {
    "nome": "Python para Data Science",
    "cargaHoraria": 60,
    "valor": 450.00
  },
  {
    "nome": "DevOps com Docker",
    "cargaHoraria": 32,
    "valor": 350.00
  },
  {
    "nome": "React Native",
    "cargaHoraria": 48,
    "valor": 399.90
  }
]
```

**How it works:**

<Steps>
<Step>
Receives POST request on the `/buscar-cursos` endpoint.
</Step>
<Step>
Logs message informing the start of the search.
</Step>
<Step>
Defines the body with mocked data for 4 courses (name, workload, and price) using `setBody`.
</Step>
<Step>
Defines 3 headers using **setHeaders**:
   - `Content-Type`: content type (JSON)
   - `X-School-ID`: school identifier
   - `X-Request-Timestamp`: request date/time

  <Callout type="note" title="NOTE">
  The Set Headers EIP requires the use of expressions to define headers. To better understand what expressions are and learn about the most common types, refer to the [Expressions](/docs/integrations/ipaas-eips-setheader#expression) section and [Expression Languages](docs/integrations/ipaas-expression-language).
  </Callout>
</Step>
<Step>
Logs message with the retrieved courses and returns the JSON as response.
</Step>
</Steps>

The video below demonstrates filling in the headers:

![Filling in headers](https://www.youtube.com/watch?v=d2nTchacZns)
