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

# Send Event

> Documentation for the Send Event action for Tiktok

![images/tiktok.svg](https://mintcdn.com/morfhealth/EU2WCxuXGIUQcziR/images/tiktok.svg?fit=max\&auto=format\&n=EU2WCxuXGIUQcziR\&q=85\&s=08aef73e5a7cbf1c9983c804a873c36c)

## Getting Started

With the Tiktok Events API integration, track events in workflows.

Some configuration is required to use the Tiktok Events API integration to allow Morf automations to act on your Tiktok Data Sources.

1. Go to [Events Manager](https://ads.tiktok.com/i18n/events_manager/home).
2. Then go to "Data Sources" and select the data source you'd like to send events to.

![](https://mintcdn.com/morfhealth/VPKyBRVuRAgQM-CM/images/tiktok_data_source_selection.png?fit=max\&auto=format\&n=VPKyBRVuRAgQM-CM\&q=85\&s=b9635c1be3b523cf9d3268caeb4cabd8)

3. Click on the "Settings" tab and scroll down to the "Access Token Generation" section, then click on "Generate Access Token": we are going to use the token in Morf.

![](https://mintcdn.com/morfhealth/VPKyBRVuRAgQM-CM/images/tiktok_generate_access_token.png?fit=max\&auto=format\&n=VPKyBRVuRAgQM-CM\&q=85\&s=7938689e22bce2b17e26a134f0bbe618)

4. Now go to the "Test Events" tab and copy the "Test Event Code" (e.g. `TEST12345`), we are going to use it to verify our integration. We are also going to need the "Data Source ID" which is available on the same page.

![](https://mintcdn.com/morfhealth/VPKyBRVuRAgQM-CM/images/tiktok_test_event_code.png?fit=max\&auto=format\&n=VPKyBRVuRAgQM-CM\&q=85\&s=bd21e730320c26beed6a1dd453b1fcd2)

In the Morf UI:

1. Add a new Integration.
2. Select Tiktok Events Access Token.
3. Paste your Data Source ID as "Pixel ID", and the token generated earlier in "Access Token".
4. In a Workflow, add a "Send Event" action, and populate the "Test Event Code" field with the code from above (format: `TEST12345`).
5. If the integration was successfully set up, events should appear in the "Test events" tab of your Tiktok Data Source.
6. Remove the "Test Event Code" value from your action.

You can now start using Tiktok Events actions in your workflows.

# Parameters

**Action** `Parameters`

**parameters**

**Event Source** `string` *required*

This field maps to the destination API `event_source` field.

**Test Event Code** `string`

This field maps to the destination API `test_event_code` field.

**Event** `string` *required*

This field maps to the destination API `data.event` field.

**Event Time** `timing.v1.Timestamp` *required*

This field maps to the destination API `data.event_time` field.

**Event ID** `string`

This field maps to the destination API `data.event_id` field.

**TikTok Click ID** `string`

This field maps to the destination API `data.user.ttclid` field.

**Emails** `[]string`

`PII`
This field maps to the destination API `data.user.email` field.

**Phones** `[]string`

`PII`
This field maps to the destination API `data.user.phone` field.

**External IDs** `[]string`

`ID`
This field maps to the destination API `data.user.external_id` field.

**TikTok Cookie ID** `string`

This field maps to the destination API `data.user.ttp` field.

**IP Address** `string`

`PII`
This field maps to the destination API `data.user.ip` field.

**User Agent** `string`

`PII`
This field maps to the destination API `data.user.user_agent` field.

**Locale** `string`

This field maps to the destination API `data.user.locale` field.

**Content IDs** `[]string`

This field maps to the destination API `data.properties.content_ids` field.

**Content Type** `string`

This field maps to the destination API `data.properties.content_type` field.

**Currency** `string`

This field maps to the destination API `data.properties.currency` field.

**Value** `float64 (double)`

This field maps to the destination API `data.properties.value` field.

**Number of Items** `int64`

This field maps to the destination API `data.properties.num_items` field.

**Search String** `string`

This field maps to the destination API `data.properties.search_string` field.

**Description** `string`

This field maps to the destination API `data.properties.description` field.

**Order ID** `string`

This field maps to the destination API `data.properties.order_id` field.

**Shop ID** `string`

This field maps to the destination API `data.properties.shop_id` field.

**Price** `float64 (double)`

This field maps to the destination API `data.properties.contents.price` field.

**Content ID** `string`

This field maps to the destination API `data.properties.contents.content_id` field.

**Content Category** `string`

This field maps to the destination API `data.properties.contents.content_category` field.

**Content Name** `string`

This field maps to the destination API `data.properties.contents.content_name` field.

**Brand** `string`

This field maps to the destination API `data.properties.contents.brand` field.

**URL** `string` *required*

This field maps to the destination API `data.page.url` field.

**Referrer** `string`

This field maps to the destination API `data.page.referrer` field.

**Limited Data Use** `bool`

This field maps to the destination API `data.limited_data_use` field.

```json Result Object Example theme={null}
{
  "$result_object_key": {
    "code": 0,
    "message": "OK",
    "request_id": "123456789021142B04A217BC0086BACCDA"
  }
}
```

```json Result Object Description theme={null}
{
  "$result_object_key": {
    "code": "Tiktok response code",
    "message": "Response message",
    "request_id": "The log ID of a request, which uniquely identifies the request"
  }
}
```

### Result Object Field Details

You can use the result of the action's data as inputs to downstream workflow actions.

Each fetch action requires an object name, which nests the action's result data inside the downstream data context in the workflow. See [Passing Data Between Actions](https://docs.morf.health/docs/knowledge_base/passing_data_between_actions.md) for how to set it and reference the result from downstream nodes.

Here we demonstrate how to refer to this data using the prefix `$result_object_key`.

**SendEventResponse** `Fetch Action Response Object`

**fields**

**code** `int64` *required*

Tiktok response code

```json CEL theme={null}
$result_object_key.code
```

```json Example theme={null}
0
```

**message** `string` *required*

Response message

```json CEL theme={null}
$result_object_key.message
```

```json Example theme={null}
"OK"
```

**request\_id** `string` *required*

The log ID of a request, which uniquely identifies the request

```json CEL theme={null}
$result_object_key.request_id
```

```json Example theme={null}
"123456789021142B04A217BC0086BACCDA"
```


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