---
title: "Buy storage"
method: POST
path: "/v2/farcaster/storage/buy/"
tags: ["Storage"]
---

# Buy storage

`POST /v2/farcaster/storage/buy/`

This api will help you rent units of storage for an year for a specific FID.
A storage unit lets you store 5000 casts, 2500 reactions and 2500 links. Requires x-wallet-id header.

## Headers

- `x-wallet-id` string, required

## Request body

- BuyStorageReqBody
  - `fid` integer, required — The unique identifier of a farcaster user or app (unsigned integer)
  - `idem` string — An Idempotency key is a unique identifier for the request. **Note:** 1) This is used to prevent duplicate requests. Use the same idem key on retry attempts. 2) This should be a unique identifier for each request. 3) Recommended format is a 16-character string generated by the developer at the time of making this request.
  - `units` integer — Number of storage units to buy. A storage unit lets you store 5000 casts, 2500 reactions and 2500 links.

## Response `200`

Success

- StorageAllocationsResponse
  - `allocations` StorageAllocation[]
    - `expiry` string, date-time
    - `object` string
    - `timestamp` string, date-time
    - `units` integer
    - `user` UserDehydrated
      - `custody_address` string — Ethereum address
      - `display_name` string, nullable
      - `fid` integer, required — The unique identifier of a farcaster user or app (unsigned integer)
      - `object` 'user_dehydrated', required
      - `pfp_url` string, nullable
      - `score` number
      - `username` string
  - `total_active_units` integer

## Other responses

- `400` — Bad Request
- `409` — Conflict
- `500` — Server Error

---

[API](https://skmtc.dev/neynar/apis/neynar-api.md) · [All operations](https://skmtc.dev/neynar/apis/neynar-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/neynar/neynar-api/revisions/dbb91bfb0d1a/schema)
