# Error creating reflection using api

**URL:** <https://community.dremio.com/t/error-creating-reflection-using-api/4046>\
**Category:** Uncategorized\
**Created:** [September 11, 2019, 3:46am UTC](https://community.dremio.com/t/error-creating-reflection-using-api/4046 "2019-09-11T03:46:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![marvinwu](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@marvinwu](https://community.dremio.com/u/marvinwu)\
**Post date:** [September 11, 2019, 3:46am UTC](https://community.dremio.com/t/error-creating-reflection-using-api/4046/1 "2019-09-11T03:46:26Z")

</div>

Hello,

```
 I am trying to create reflection using api.
  
 I am sending a post request to dremio server/api/v3/reflection endpoint, with following body

```

{  
name: ‘RAW Reflection’,  
type: ‘RAW’,  
enabled: false,  
datasetId: “ecc5e46c-983b-4a5a-a21f-e853b4f64656”,  
partitionDistributionStrategy: ‘CONSOLIDATED’  
}

But I got “status:400, statusText:Bad Request”, seems I am missing something obvious, any hint?

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [September 11, 2019, 3:20pm UTC](https://community.dremio.com/t/error-creating-reflection-using-api/4046/2 "2019-09-11T15:20:36Z")

</div>

@marvinwu

Is “ecc5e46c-983b-4a5a-a21f-e853b4f64656” the reflection ID or dataset ID?

Thanks  
@balaji.ramaswamy

---

<div class="post-metadata">

**Author:** ![doron](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/doron/32/294_2.png) [@doron](https://community.dremio.com/u/doron)\
**Post date:** [September 11, 2019, 3:37pm UTC](https://community.dremio.com/t/error-creating-reflection-using-api/4046/3 "2019-09-11T15:37:54Z")

</div>

You need to provide at least one column when creating RAW reflections and you should also provide the `entityType`:

```auto
{
  "type":"RAW",
  "name":"Raw Reflection",
  "datasetId":"d45c6604-3d88-41f4-8d0-0253076e6e52",
  "enabled":true,
  "displayFields":[{"name":"name"}],
  "partitionDistributionStrategy":"CONSOLIDATED",
  "entityType":"reflection"
}

```

---

<div class="post-metadata">

**Author:** ![marvinwu](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@marvinwu](https://community.dremio.com/u/marvinwu)\
**Post date:** [September 12, 2019, 2:08am UTC](https://community.dremio.com/t/error-creating-reflection-using-api/4046/4 "2019-09-12T02:08:04Z")

</div>

@balaji.ramaswamy, it is datasetId

---

<div class="post-metadata">

**Author:** ![marvinwu](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@marvinwu](https://community.dremio.com/u/marvinwu)\
**Post date:** [September 12, 2019, 2:11am UTC](https://community.dremio.com/t/error-creating-reflection-using-api/4046/5 "2019-09-12T02:11:34Z")

</div>

thanks much Doron! It worked after I added displayFields

probably good to update the docs as welll, the display Fields listed as optional, but it is actually required for RAW type reflection.

[https://docs.dremio.com/rest-api/reflections/post-reflection.html](https://docs.dremio.com/rest-api/reflections/post-reflection.html)
