# Create Document via script

**URL:** <https://community.fibery.io/t/create-document-via-script/5933>\
**Category:** Get Help\
**Created:** [March 4, 2024, 2:20pm UTC](https://community.fibery.io/t/create-document-via-script/5933 "2024-03-04T14:20:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aoe](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/aoe/32/6018_2.png) [@aoe](https://community.fibery.io/u/aoe)\
**Post date:** [March 4, 2024, 2:20pm UTC](https://community.fibery.io/t/create-document-via-script/5933/1 "2024-03-04T14:20:26Z")

</div>

I’m trying to create and add a Document to an entity on creation.

I don’t see any action connected to Documents so my thought was to use scripts. But I can’t find a way to create a Document via script.

- Any tips?
- Any other methods to achieve what I’m after?

* * *

_Similar question to this:_

> [@Are Documents being deprecated?](https://community.fibery.io/t/are-documents-being-deprecated/2947/5):
>
> How do I create a Document via script? (and add it to entity) I don’t see a “createDocument” call in the API.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [March 4, 2024, 2:43pm UTC](https://community.fibery.io/t/create-document-via-script/5933/2 "2024-03-04T14:43:37Z")

</div>

Documents are considered views in the Fibery API world, so they use the [views API](https://the.fibery.io/@public/User_Guide/Guide/View-API-266).  
AFAIK there are no script functions that simplify the process.

---

<div class="post-metadata">

**Author:** ![aoe](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/aoe/32/6018_2.png) [@aoe](https://community.fibery.io/u/aoe)\
**Post date:** [March 4, 2024, 2:51pm UTC](https://community.fibery.io/t/create-document-via-script/5933/3 "2024-03-04T14:51:34Z")

</div>

I understand.

Would it then be possible to create a view (Document) via an API call in the script, get the ID and link it to the newly created entity?

If so, I will give it a try.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [March 4, 2024, 3:01pm UTC](https://community.fibery.io/t/create-document-via-script/5933/4 "2024-03-04T15:01:01Z")

</div>

Technically yes, but you would be writing a script to make an [http call](https://the.fibery.io/@public/User_Guide/Guide/Scripts-in-Automations-54/anchor=Http-service-functions--af3e5bbc-3359-4268-8b0e-1023398c0d7e) to the Fibery API, so it’s like the internal script pretending to be an external service 😬

As a result, you would need to store an API token in the script, which isn’t great practice.

---

<div class="post-metadata">

**Author:** ![helloitse](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/helloitse/32/498_2.png) [@helloitse](https://community.fibery.io/u/helloitse)\
**Post date:** [March 4, 2024, 8:17pm UTC](https://community.fibery.io/t/create-document-via-script/5933/5 "2024-03-04T20:17:46Z")

</div>

At that point it would be better to use the script to trigger a [Make.com](http://Make.com) or Zapier automation.

---

<div class="post-metadata">

**Author:** ![aoe](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/aoe/32/6018_2.png) [@aoe](https://community.fibery.io/u/aoe)\
**Post date:** [March 5, 2024, 12:39pm UTC](https://community.fibery.io/t/create-document-via-script/5933/6 "2024-03-05T12:39:48Z")

</div>

Thanks for explaining, I’ll have to figure out some other way to achieve what I want.
