# Serverless function

**URL:** <https://community.hubspot.com/t/serverless-function/72062>\
**Category:** CMS Development\
**Created:** [January 2, 2023, 11:50am UTC](https://community.hubspot.com/t/serverless-function/72062 "2023-01-02T11:50:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ACarr3](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ACarr3](https://community.hubspot.com/u/ACarr3)\
**Post date:** [January 2, 2023, 11:50am UTC](https://community.hubspot.com/t/serverless-function/72062/1 "2023-01-02T11:50:43Z")

</div>

Hello everyone, I’m writing a serverless function and I want to write a json file in the design manager using that serverless function. Right now I’m getting a permissions error so don’t know if this is possible, if so has anyone dealt with this in the past?

---

<div class="post-metadata">

**Author:** ![vbrech](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/vbrech/32/52876_2.png) [@vbrech](https://community.hubspot.com/u/vbrech)\
**Post date:** [January 3, 2023, 10:30am UTC](https://community.hubspot.com/t/serverless-function/72062/2 "2023-01-03T10:30:45Z")

</div>

This should work, provided that your auth token belongs to a private app with the “content” scope. [Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs/api/cms/source-code) (i.e. POST to [https://api.hubapi.com/files/v3/files](https://api.hubapi.com/files/v3/files) ). If this is what you were doing, what error are you seeing?

---

<div class="post-metadata">

**Author:** ![ACarr3](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ACarr3](https://community.hubspot.com/u/ACarr3)\
**Post date:** [January 3, 2023, 2:32pm UTC](https://community.hubspot.com/t/serverless-function/72062/3 "2023-01-03T14:32:01Z")

</div>

Content scope is enabled, I’m no trying to use API. I just want to read/write a json file locally in the design manager. My serverless function contains a json variable, something like this: {“id”:1,“value”: “hello”,…} and I want to put that variable into a json file in the design manager. I’m using fs and I’m getting this error:

INFO error [Error: EROFS: read-only file system, open ‘/myfile.json’] {  
errno: -30,  
code: ‘EROFS’,  
syscall: ‘open’,  
path: ‘/resources.json’  
}
