> For the complete documentation index, see [llms.txt](https://dev.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://dev.guardian.hedera.com/static-spec-test/data-and-dmrv/ipfs.md).

# IPFS

## Add file to IPFS.

> Add file to IPFS.

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"0.0.1"},"tags":[{"name":"ipfs"}],"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":"0.0.1"},"tags":[{"name":"ipfs"}],"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":"0.0.1"},"tags":[{"name":"ipfs"}],"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":"0.0.1"},"tags":[{"name":"ipfs"}],"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":"0.0.1"},"tags":[{"name":"ipfs"}],"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":"0.0.1"},"tags":[{"name":"ipfs"}],"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"]}}}}
```
