# Create Datafeed

Creates a new real time messages / events stream ("datafeed"). The datafeed provides messages and events from all conversations that the user is in. The types of events surfaced in the datafeed can be found in the [Real Time Events](https://docs.developers.symphony.com/building-bots-on-symphony/datafeed/real-time-events) list.

Returns the `ID` of the datafeed that has just been created. This `ID` should then be used as input to the [Read Datafeed](https://rest-api.symphony.com/main/datafeed/read-datafeed-v5) endpoint.

{% hint style="warning" %}
**Number of active feeds**

In the vast majority of the use cases, your bot should have **only one active feed**.

The platform however supports up to **20 feeds per service user**. If you try to create a 21st feed, you will receive a **403 error code**. In that case you need to delete one of your active feeds (i.e. get the list of feeds using [List Datafeed](https://rest-api.symphony.com/main/datafeed/list-datafeed-v5), then [Delete Datafeed](https://rest-api.symphony.com/main/datafeed/delete-datafeed-v5) on one of the listed feeds).
{% endhint %}

## Create a new real time feed of messages and events.

> \_Available on Agent 2.57.0 and above.\_\
> \
> The datafeed provides messages and events from all conversations that the user\
> is in. The types of events surfaced in the datafeed can be found in the Real Time Events list.\
> (see definition on top of the file)\
> \
> Returns the ID of the newly created datafeed.\
> This ID should then be used as input to the Read Datafeed endpoint.<br>

```json
{"openapi":"3.0.1","info":{"title":"Agent API","version":"25.8.1"},"servers":[{"url":"youragentURL.symphony.com/agent"}],"paths":{"/v5/datafeeds":{"post":{"tags":["Datafeed"],"summary":"Create a new real time feed of messages and events.","description":"_Available on Agent 2.57.0 and above._\n\nThe datafeed provides messages and events from all conversations that the user\nis in. The types of events surfaced in the datafeed can be found in the Real Time Events list.\n(see definition on top of the file)\n\nReturns the ID of the newly created datafeed.\nThis ID should then be used as input to the Read Datafeed endpoint.\n","operationId":"createDatafeed","parameters":[{"name":"sessionToken","in":"header","description":"Session authentication token.","required":true,"schema":{"type":"string"}},{"name":"keyManagerToken","in":"header","description":"Key Manager authentication token.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V5DatafeedCreateBody"}}},"required":false},"responses":{"201":{"description":"Datafeed sucessfully created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V5Datafeed"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2Error"}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2Error"}}}}}}}},"components":{"schemas":{"V5DatafeedCreateBody":{"type":"object","properties":{"tag":{"maxLength":100,"type":"string","description":"A unique identifier to ensure uniqueness of the datafeed."},"includeInvisible":{"type":"boolean","description":"Set to true to retrieve invisible rooms related events. Default is false."}}},"V5Datafeed":{"type":"object","properties":{"id":{"type":"string","description":"ID of the datafeed"},"createdAt":{"type":"integer","description":"[deprecated] Datafeed creation timestamp\n","format":"int64","deprecated":true},"type":{"type":"string","description":"The type of feed. Only allowed value is \"datahose\"."}},"description":"Container for the feed ID"},"V2Error":{"required":["code","message"],"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"details":{"type":"object"}}}}}}
```
