# Adding \`tag\_ids\` when using upsert

**URL:** <https://integration.keap.com/t/adding-tag-ids-when-using-upsert/11820>\
**Category:** API Q&A\
**Tags:** tags, api, rest\
**Created:** [August 22, 2017, 4:51pm UTC](https://integration.keap.com/t/adding-tag-ids-when-using-upsert/11820 "2017-08-22T16:51:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Corey\_Haines](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/corey_haines/32/1983_2.png) [@Corey\_Haines](https://integration.keap.com/u/Corey_Haines)\
**Post date:** [August 22, 2017, 4:51pm UTC](https://integration.keap.com/t/adding-tag-ids-when-using-upsert/11820/1 "2017-08-22T16:51:18Z")

</div>

Hi,

I’m using the upsert command through the REST API, and it appears that you cannot create with a set of tag ids. I’m getting this error

```auto
{
  "message": "Tags can't be added or removed through this object"
}

```

when I use this JSON

```auto
{"source_type":"WEBFORM","duplicate_option":"Email","given_name":"Zak","family_name":"","email_addresses":[{"email":"zak@example.com","field":"EMAIL1"}],"opt_in_reason":"Opted out of form", "tag_ids": [92]}

```

Note: tag id 92 is “New Lead” in the system list of tags.

I notice that, in the documentation, the `tag_ids` entry is

```auto
"tag_ids": [
    0
  ]

```

Which makes me wonder whether this really isn’t supported yet, and the only valid option is “0”. The schema example, though, says it is

```auto
tag_ids
array[integer](optional)

```

So, I’m hoping that I’m just missing something here. I hope that I don’t have to make two calls: create the contact, then apply tags. If so, I’m confused as to what the `tag_ids` field in the JSON is for.

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![Corey\_Haines](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/corey_haines/32/1983_2.png) [@Corey\_Haines](https://integration.keap.com/u/Corey_Haines)\
**Post date:** [August 22, 2017, 8:32pm UTC](https://integration.keap.com/t/adding-tag-ids-when-using-upsert/11820/2 "2017-08-22T20:32:26Z")

</div>

In the interim, I’m looking at working around this problem by making a second call to the apply tags endpoint (/contacts/{contactId}/tags).

One thing I noticed is that the schema for applying tags uses camel-case  
`tagIds`

While the list of tag ids in the create contact schema uses snake-case  
`tag_ids`

Wondering if this is a consistency oversight or something related to their interpretation in the different calls.
