# Ipfs

## Add file to IPFS.

> Add file to IPFS.

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"3.6.0-rc"},"servers":[{"url":"/api/v1","description":"version 1.0"}],"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.0.0","info":{"title":"Guardian","version":"3.6.0-rc"},"servers":[{"url":"/api/v1","description":"version 1.0"}],"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.0.0","info":{"title":"Guardian","version":"3.6.0-rc"},"servers":[{"url":"/api/v1","description":"version 1.0"}],"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.0.0","info":{"title":"Guardian","version":"3.6.0-rc"},"servers":[{"url":"/api/v1","description":"version 1.0"}],"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.0.0","info":{"title":"Guardian","version":"3.6.0-rc"},"servers":[{"url":"/api/v1","description":"version 1.0"}],"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.0.0","info":{"title":"Guardian","version":"3.6.0-rc"},"servers":[{"url":"/api/v1","description":"version 1.0"}],"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: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.guardian.hedera.com/api-reference/ipfs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
