> ## Documentation Index
> Fetch the complete documentation index at: https://omni.fireflo.au/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /v1/cdp/traits

> The built-in traits, and the account's own worked out from events.

Traits are facts worked out for every contact. This lists the built-in ones — worked out from messages, visits and deals — and the account's own, each worked out from an event over a window of days.

<Note>Needs the `cdp.contacts:read` scope.</Note>

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.fireflo.au/v1/cdp/traits" \
    -H "Authorization: Bearer $OMNI_API_KEY"
  ```

  ```python Python theme={null}
  import os

  import requests

  response = requests.get(
      "https://api.fireflo.au/v1/cdp/traits",
      headers={"Authorization": f"Bearer {os.environ['OMNI_API_KEY']}"},
  )
  print(response.status_code, response.json())
  ```

  ```javascript Node theme={null}
  const response = await fetch("https://api.fireflo.au/v1/cdp/traits", {
    headers: {
      Authorization: `Bearer ${process.env.OMNI_API_KEY}`,
    },
  });
  console.log(response.status, await response.json());
  ```
</CodeGroup>

## Response

`200 OK` — `built_in` are OMNI's own; `data` are the account's. A trait's `key` is what audience rules name, and its `merge_tag` puts it in a message. `aggregate` is `count` (how many times), `last` (when it last happened) or `sum` (the total of `property`).

```json theme={null}
{
  "built_in": [
    {
      "key": "last_engaged",
      "label": "Last engaged",
      "description": "Their last reply, read, button tap, link click or visit"
    },
    {
      "key": "last_inbound",
      "label": "Last message from them",
      "description": "When they last wrote on any channel"
    },
    {
      "key": "last_outbound",
      "label": "Last message to them",
      "description": "When you last wrote on any channel"
    },
    {
      "key": "messages_in_90d",
      "label": "Messages from them · 90 days",
      "description": "Every channel"
    },
    {
      "key": "messages_out_90d",
      "label": "Messages to them · 90 days",
      "description": "Campaigns and replies"
    },
    {
      "key": "reply_rate",
      "label": "Reply rate · 90 days",
      "description": "Days you wrote that got a reply within 7 days"
    },
    {
      "key": "delivered_rate",
      "label": "Delivered rate · 90 days",
      "description": "Delivered ÷ sent"
    },
    {
      "key": "preferred_channel",
      "label": "Preferred channel",
      "description": "Where most of their messages came from"
    },
    {
      "key": "lifetime_value",
      "label": "Lifetime value",
      "description": "Total of won deals"
    },
    {
      "key": "open_deals_value",
      "label": "Open deals",
      "description": "Total of deals still open"
    },
    {
      "key": "events_30d",
      "label": "Activity · 30 days",
      "description": "Everything recorded about them"
    },
    {
      "key": "first_seen",
      "label": "First seen",
      "description": "When they became a contact"
    }
  ],
  "data": [
    {
      "key": "cart_adds_30_days",
      "label": "Cart adds · 30 days",
      "event_name": "cart_added",
      "aggregate": "count",
      "property": "",
      "window_days": 30,
      "merge_tag": "{{trait.cart_adds_30_days}}"
    },
    {
      "key": "order_value_90_days",
      "label": "Order value · 90 days",
      "event_name": "order_placed",
      "aggregate": "sum",
      "property": "total",
      "window_days": 90,
      "merge_tag": "{{trait.order_value_90_days}}"
    }
  ]
}
```

## Errors

Every refusal is `{"error": {"code", "message", "field"}}`; `field` is there when one input is at fault.

| Status | Error code | When |
| :- | :- | :- |
| 403 | `scope_missing` | The key doesn't have the `cdp.contacts:read` scope. |
| 404 | `module_off` | The account doesn't have Customer data on. |

Any request can also be refused for its key, its account or its rate (`key_required`, `invalid_key`, `account_suspended`, `plan_excludes_api`, `address_not_allowed`, `rate_limited`); see [the overview](/api-reference/overview).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.