Create Document via script

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:

Documents are considered views in the Fibery API world, so they use the views API.
AFAIK there are no script functions that simplify the process.

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.

Technically yes, but you would be writing a script to make an http call to the Fibery API, so it’s like the internal script pretending to be an external service :grimacing:

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

At that point it would be better to use the script to trigger a or Zapier automation.

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