# Is it possible to do read and write operations in a Repository by using  pega?

**URL:** <https://forums.pega.com/t/is-it-possible-to-do-read-and-write-operations-in-a-repository-by-using-pega/6881>\
**Category:** General\
**Created:** [May 7, 2024, 9:09am UTC](https://forums.pega.com/t/is-it-possible-to-do-read-and-write-operations-in-a-repository-by-using-pega/6881 "2024-05-07T09:09:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TanyaS58](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@TanyaS58](https://forums.pega.com/u/TanyaS58)\
**Post date:** [May 7, 2024, 9:09am UTC](https://forums.pega.com/t/is-it-possible-to-do-read-and-write-operations-in-a-repository-by-using-pega/6881/1 "2024-05-07T09:09:10Z")

</div>

How can u read from a repository and write it back to it. This was asked in an interview

---

<div class="post-metadata">

**Author:** ![Bhumireddy](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/bhumireddy/32/23248_2.png) [@Bhumireddy](https://forums.pega.com/u/Bhumireddy)\
**Post date:** [May 7, 2024, 11:04am UTC](https://forums.pega.com/t/is-it-possible-to-do-read-and-write-operations-in-a-repository-by-using-pega/6881/2 "2024-05-07T11:04:36Z")

</div>

Hi @TanyaS58,

You need create a repository and give required permissions in repository side.

Please go though below article, you will get a idea.

[How to leverage PEGA Repository API — Amazon S3 for file storage](https://clincher.medium.com/how-to-leverage-pega-repository-api-amazon-s3-for-file-storage-dcb198f670b).

I hope this will help you.

Thanks,

Ashok

---

<div class="post-metadata">

**Author:** ![Bogga](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@Bogga](https://forums.pega.com/u/Bogga)\
**Post date:** [May 7, 2024, 11:54am UTC](https://forums.pega.com/t/is-it-possible-to-do-read-and-write-operations-in-a-repository-by-using-pega/6881/3 "2024-05-07T11:54:01Z")

</div>

@TanyaS58

You can leverage OOTB Pega repository APIs

**D\_pxDelete** : Delete a file from repositoryName in the specified filePath

Eg: D\_pxDelete[repositoryName:Param.repositoryName,filePath:Param.filePath,recursiveDelete:Param.recursiveDelete]

**D\_pxGetFile** : Represents a file stored in a repository. Takes a repository name, a file path, and an optional response type, which must be either “STRING” or “STREAM”, and which defaults to the former.

Eg: D\_pxGetFile[repositoryName:Param.repositoryName,filePath:Param.filePath,responseType:Param.responseType]

D\_pxGetFile[repositoryName:“pegacloudrepository”,filePath:.pyPath,responseType:“String”].pyContents

**D\_pxListFiles** : Load the page with repository name and the path of the folder whose contents need to be listed
