> For the complete documentation index, see [llms.txt](https://guardian.hedera.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guardian.hedera.com/api-reference-guardian/data-and-dmrv/ipfs.md).

# IPFS

Decentralized file storage via the InterPlanetary File System.

## Add file to IPFS.

> Add file to IPFS.

```json
{"openapi":"3.2.0","info":{"title":"Guardian","version":"3.7.1"},"tags":[{"name":"ipfs","description":"Decentralized file storage via the InterPlanetary File System.","parent":"data"}],"servers":[{"url":"/api/v1","description":"API v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"BadRequestErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"error":{"type":"string"}},"required":["statusCode","message"]},"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/ipfs/file":{"post":{"description":"Add file to IPFS.","operationId":"IpfsApi_postFile","parameters":[],"requestBody":{"required":true,"description":"Binary data.","content":{"binary/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"File added successfully.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestErrorDTO"}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"422":{"description":"Body content in request is empty.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Add file to IPFS.","tags":["ipfs"]}}}}
```

## Add file to IPFS directly.

> Add file to IPFS directly.

```json
{"openapi":"3.2.0","info":{"title":"Guardian","version":"3.7.1"},"tags":[{"name":"ipfs","description":"Decentralized file storage via the InterPlanetary File System.","parent":"data"}],"servers":[{"url":"/api/v1","description":"API v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"BadRequestErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"error":{"type":"string"}},"required":["statusCode","message"]},"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/ipfs/file/direct":{"post":{"description":"Add file to IPFS directly.","operationId":"IpfsApi_postFileDirect","parameters":[],"requestBody":{"required":false,"description":"Binary data.","content":{"binary/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"File added successfully.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestErrorDTO"}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"422":{"description":"Body content in request is empty.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Add file to IPFS directly.","tags":["ipfs"]}}}}
```

## Add file to local IPFS simulation for dry run mode.

> Add file to local IPFS simulation for dry run mode.

```json
{"openapi":"3.2.0","info":{"title":"Guardian","version":"3.7.1"},"tags":[{"name":"ipfs","description":"Decentralized file storage via the InterPlanetary File System.","parent":"data"}],"servers":[{"url":"/api/v1","description":"API v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/ipfs/file/dry-run/{policyId}":{"post":{"description":"Add file to local IPFS simulation for dry run mode.","operationId":"IpfsApi_postFileDryRun","parameters":[{"name":"policyId","required":true,"in":"path","description":"Policy id","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Binary data.","content":{"binary/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"File added successfully.","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"422":{"description":"Body content in request is empty.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Add file to local IPFS simulation for dry run mode.","tags":["ipfs"]}}}}
```

## Get file from IPFS.

> Get file from IPFS.

```json
{"openapi":"3.2.0","info":{"title":"Guardian","version":"3.7.1"},"tags":[{"name":"ipfs","description":"Decentralized file storage via the InterPlanetary File System.","parent":"data"}],"servers":[{"url":"/api/v1","description":"API v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"NotFoundErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/ipfs/file/{cid}":{"get":{"description":"Get file from IPFS.","operationId":"IpfsApi_getFile","parameters":[{"name":"cid","required":true,"in":"path","description":"File cid","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation. Returns file content.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Unauthorized request.","content":{"application/octet-stream":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/octet-stream":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"404":{"description":"File is not found.","content":{"application/octet-stream":{"schema":{"$ref":"#/components/schemas/NotFoundErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/octet-stream":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Get file from IPFS.","tags":["ipfs"]}}}}
```

## Remove file from IPFS.

> Remove file from IPFS.

```json
{"openapi":"3.2.0","info":{"title":"Guardian","version":"3.7.1"},"tags":[{"name":"ipfs","description":"Decentralized file storage via the InterPlanetary File System.","parent":"data"}],"servers":[{"url":"/api/v1","description":"API v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/ipfs/file/{cid}":{"delete":{"description":"Remove file from IPFS.","operationId":"IpfsApi_deleteFile","parameters":[{"name":"cid","required":true,"in":"path","description":"File cid","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"type":"object","nullable":true}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Remove file from IPFS.","tags":["ipfs"]}}}}
```

## Get file from local IPFS simulation for dry-run mode

> Get file from local IPFS simulation for dry-run mode

```json
{"openapi":"3.2.0","info":{"title":"Guardian","version":"3.7.1"},"tags":[{"name":"ipfs","description":"Decentralized file storage via the InterPlanetary File System.","parent":"data"}],"servers":[{"url":"/api/v1","description":"API v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"NotFoundErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/ipfs/file/{cid}/dry-run":{"get":{"description":"Get file from local IPFS simulation for dry-run mode","operationId":"IpfsApi_getFileDryRun","parameters":[{"name":"cid","required":true,"in":"path","description":"File cid","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation. Returns file content.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Unauthorized request.","content":{"application/octet-stream":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/octet-stream":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"404":{"description":"File is not found.","content":{"application/octet-stream":{"schema":{"$ref":"#/components/schemas/NotFoundErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/octet-stream":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Get file from local IPFS simulation for dry-run mode","tags":["ipfs"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://guardian.hedera.com/api-reference-guardian/data-and-dmrv/ipfs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
