# Targeting with TO Field

The `TO` field allows you to specify a list of feeds to which the activity should be copied. One way to think about it is as the CC functionality of email.

<Admonition type="info">

If initial activity is removed from the origin feed, it's also removed from all TO targeted feeds and origin feed followers.

</Admonition>

### Use Case: Mentions

Targeting is useful when you want to support @mentions and notify users. An example is shown below:

```go label="Go"
// Add the activity to Eric's feed and to Jessica's notification feed
	activity := stream.Activity{
		Actor: "user:Eric",
		Verb:  "tweet",
		Object: "tweet:id",
		To: []string{
			"notification:Jessica", // In production use user ids, not their usernames
		},
		Extra: map[string]any{
			"message": "@Jessica check out getstream.io it's so dang awesome.",
		},
	}
	_, err := userFeed.AddActivity(context.TODO(), activity)
	if err != nil {
		panic(err)
	}
```

<Admonition type="info">

The `TO` field is limited to a maximum of 100 targets per API request.

</Admonition>

### Use Case: Organizations & Topics

Another everyday use case is for teams, organizations or topics.

For example, one of our customers runs a football community. Updates about a player should also be added to their team's feed. Stream supports this by adding the activity to the player's feed, and specifying the target feeds in the `TO` field:

```go label="Go"
// The TO field ensures the activity is send to the player, match and team feed
	activity := stream.Activity{
		Actor: "Player:Suarez",
		Verb:  "foul",
		Object: "Player:Ramos",
		To: []string{
			"team:barcelona",
			"match:1",
		},
		Extra: map[string]any{
			"match": map[string]any{
				"name": "El Clasico",
				"id":  10,
			},
		},
	}
	_, err := playerFeed.AddActivity(context.TODO(), activity)
	if err != nil {
		panic(err)
	}
```

<Admonition type="info">

By default only the user, flat, aggregated and notification feed groups are set up automatically. You'll need to go to the [dashboard](https://getstream.io/signin/?product=feeds) and create feeds called team, player and match for the above example to work.

</Admonition>

## Update to targets

To targets can be updated later on to change where the activity is copied. This API requires server side auth and requires foreign id and time.

```go label="Go"
// Remove all old targets and set new ones (replace):
	newTargets := []string{"user:1", "user:2"}

	_, err := userFeed.UpdateToTargets(context.TODO(), activity, stream.WithToTargetsNew(newTargets...))
	if err != nil {
		panic(err)
	}

	// Add some targets and remove some others:
	add := []string{"user:1", "user:2"}
	remove := []string{"user:3", "user:4"}

	_, err := userFeed.UpdateToTargets(
		context.TODO(),
		activity,
		stream.WithToTargetsAdd(add...),
		stream.WithToTargetsRemove(remove...),
	)
	if err != nil {
		panic(err)
	}
```


---

This page was last updated at 2026-08-14T17:46:35.097Z.

For the most recent version of this documentation, visit [https://getstream.io/activity-feeds/docs/go-golang/v2/targeting/](https://getstream.io/activity-feeds/docs/go-golang/v2/targeting/).