# Stream Target gets duplicated on all applications when created using Rest API

**URL:** <https://community.wowza.com/t/stream-target-gets-duplicated-on-all-applications-when-created-using-rest-api/51385>\
**Category:** Wowza Developer Dojo\
**Created:** [May 29, 2018, 7:04pm UTC](https://community.wowza.com/t/stream-target-gets-duplicated-on-all-applications-when-created-using-rest-api/51385 "2018-05-29T19:04:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mustafa\_Al\_Ani](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@Mustafa\_Al\_Ani](https://community.wowza.com/u/Mustafa_Al_Ani)\
**Post date:** [May 29, 2018, 7:04pm UTC](https://community.wowza.com/t/stream-target-gets-duplicated-on-all-applications-when-created-using-rest-api/51385/1 "2018-05-29T19:04:59Z")

</div>

**Wowza Streaming Engine Version 4.7.4 (build 21380)**

**21380**

Trying to add a stream target to a specific application using the Rest API, I have managed to create the target but for some reason that new target gets duplicated on all existing applications.

I am using the following post call:

**[http://localhost:8087/v2/servers/](http://localhost:8087/v2/servers/)_defaultServer_/vhosts/_defaultVHost_/applications/app\_name/pushpublish/mapentries/target\_name**

json:

**{**

**"sourceStreamName": “myStream”,**

**"profile": “rtmp”,**

**"host": “[rtmp-api.facebook.com](http://rtmp-api.facebook.com)”,**

**"streamName": “xxxxxxxxxxxxxxxxxxxxxxxxxx”,**

**"port": 80,**

**"application": “app\_name”,**

**"entryName" : “target\_name”,**

**"enabled":“false”,**

**"extraOptions": {**

**"destinationName": "rtmp"**

**}**

**}**

---

<div class="post-metadata">

**Author:** ![Michelle\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/michelle_b/32/394_2.png) [@Michelle\_B](https://community.wowza.com/u/Michelle_B)\
**Post date:** [May 31, 2018, 7:00am UTC](https://community.wowza.com/t/stream-target-gets-duplicated-on-all-applications-when-created-using-rest-api/51385/2 "2018-05-31T07:00:00Z")

</div>

It sounds like you have your applications set to use the default PushPublishMap.txt file located in the conf/ directory. You can configure each application to use application-level map files by configuring the following property on the application:

```auto
Path: /Root/Application
Name: pushPublishMapPath
Type: String
Value: ${com.wowza.wms.context.VHostConfigHome}/conf/${com.wowza.wms.context.Application}/PushPublishMap.txt

```

Michelle

---

<div class="post-metadata">

**Author:** ![Neftali\_Dones1](https://avatars.discourse-cdn.com/v4/letter/n/71c47a/32.png) [@Neftali\_Dones1](https://community.wowza.com/u/Neftali_Dones1)\
**Post date:** [November 4, 2018, 11:43am UTC](https://community.wowza.com/t/stream-target-gets-duplicated-on-all-applications-when-created-using-rest-api/51385/3 "2018-11-04T11:43:25Z")

</div>

Can you tell me ware I can do this because I am having this problem

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [November 5, 2018, 12:03am UTC](https://community.wowza.com/t/stream-target-gets-duplicated-on-all-applications-when-created-using-rest-api/51385/4 "2018-11-05T00:03:50Z")

</div>

Would you mind clarifying @Michelle B for the location? Is it in the config/ directory?

---

<div class="post-metadata">

**Author:** ![Mustafa\_Al\_Ani](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@Mustafa\_Al\_Ani](https://community.wowza.com/u/Mustafa_Al_Ani)\
**Post date:** [March 1, 2019, 5:56pm UTC](https://community.wowza.com/t/stream-target-gets-duplicated-on-all-applications-when-created-using-rest-api/51385/5 "2019-03-01T17:56:01Z")

</div>

@Michelle B Every time I set the property in the API request when I create the application, I receive 500 error code.

my API request is:

```auto
http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/app_name

```

```auto
<?xml version="1.0" encoding="UTF-8" ?>
<Application serverName="_defaultServer_">
    	<AppType>Live</AppType>
    	<Description>Live Streaming application created by wowza.</Description>
    	<Properties>
    		<Property>
    			<Path>/Root/Application</Path>
    			<Name>pushPublishMapPath</Name>
    			<Type>String</Type>
    			<Value>${com.wowza.wms.context.VHostConfigHome}/conf/${com.wowza.wms.context.Application}/PushPublishMap.txt</Value>
    		</Property>
	</Properties>
</Application>

```

Could you please help.
