# ShotGrid API - How to create a new Version entity associated with a specific Shot using CLI?

**URL:** <https://community.shotgridsoftware.com/t/shotgrid-api-how-to-create-a-new-version-entity-associated-with-a-specific-shot-using-cli/14316>\
**Category:** Flow Production Tracking\
**Created:** [December 23, 2021, 6:15am UTC](https://community.shotgridsoftware.com/t/shotgrid-api-how-to-create-a-new-version-entity-associated-with-a-specific-shot-using-cli/14316 "2021-12-23T06:15:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cmq](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@Cmq](https://community.shotgridsoftware.com/u/Cmq)\
**Post date:** [December 23, 2021, 6:15am UTC](https://community.shotgridsoftware.com/t/shotgrid-api-how-to-create-a-new-version-entity-associated-with-a-specific-shot-using-cli/14316/1 "2021-12-23T06:15:39Z")

</div>

Trying to create a Version in a specific Project associated with an existing Shot.

I got as far as associating the new Version with an existing Project. The following CLI works:

```auto
curl -X POST 'https://myproject.shotgrid.autodesk.com/api/v1/entity/_batch' \
-H 'Authorization: Bearer [activeToken]'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-d [See JSON below]

{
	"requests": [
		{
			"request_type": "create",
			"entity": "Version",
			"data": {
				"code": "Custom name here",
				"description": "Custom Description here",
				"sg_path_to_movie": "/Volumes/Path/To/File",
				"project": {
					"type": "Project",
					"id": 189
				}
			}
		}
	]
}

```

The challenge comes when trying to associate the new Version with an existing Shot.  
What’s the syntax?

Adding the following to the above didn’t work:

```auto
shot: { type: "Shot", id: 1549 }

```

Error is

```auto
{
   "errors": [
      {
         "id": "8779585553465e403ef0c49d134cefe1",
         "status": 400,
         "code": 104,
         "title": "Invalid field value, update failed [2 - Invalid field name: field [Version.shot] does not exist or user does not have access permission.]",
         "source": null,
         "detail": null,
         "meta": {
            "crud_error_uuid": "1aad7ab6-63b5-11ec-9165-0242ac110009"
         }
      }
   ]
}

```

---

<div class="post-metadata">

**Author:** ![mminsel](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@mminsel](https://community.shotgridsoftware.com/u/mminsel)\
**Post date:** [December 23, 2021, 11:09am UTC](https://community.shotgridsoftware.com/t/shotgrid-api-how-to-create-a-new-version-entity-associated-with-a-specific-shot-using-cli/14316/2 "2021-12-23T11:09:53Z")

</div>

Hi @Cmq ,

The problem that you encounter is caused by a wrong field-name. The link field for a Shot entity is by default named: `entity`

If you use `entity: { type: "Shot", id: 1549 }` instead, it should start working.

---

<div class="post-metadata">

**Author:** ![Cmq](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@Cmq](https://community.shotgridsoftware.com/u/Cmq)\
**Post date:** [December 23, 2021, 2:09pm UTC](https://community.shotgridsoftware.com/t/shotgrid-api-how-to-create-a-new-version-entity-associated-with-a-specific-shot-using-cli/14316/3 "2021-12-23T14:09:29Z")

</div>

@mminsel  
I had suspected that, based on the data returned for Reviews, tested it and “proved” it “absolutely, positively, no doubt about it, does not work”

But of course after trying again based on your comment, it works perfectly. Thank you!
