---
title: Web3.Storage API (1.0)
---

import Callout from 'components/callout/callout';
import { Tabs, TabItem } from 'components/tabs/tabs';
import AccordionSingle from 'components/accordionsingle/accordionsingle';

# Web3.Storage API (1.0)

[Download](https://web3.storage/docs/schema.yml) OpenAPI specification

This documentation describes the HTTP API for [Web3.Storage](https://web3.storage), which allows you to quickly and easily build applications using decentralized data storage persisted by [Filecoin](https://filecoin.io/) and available over [IPFS](https://ipfs.io/).

You can also interact with this API using client libraries. See [web3.storage/docs](https://web3.storage/docs) for more information on using a client library, as well as a variety of other guides and how-tos for Web3.Storage as a whole.

## API endpoint URL

The main public API endpoint URL for Web3.Storage is https://api.web3.storage. All endpoints described in this document should be made relative to this root URL. For example, to post to the /car endpoint, send your request to https://api.web3.storage/car.

### Rate limits

This API imposes rate limits to ensure quality of service. You may receive a 429 "Too many requests" error if you make more than 30 requests with the same API token within a ten second window. Upon receiving a response with a 429 status, clients should retry the failed request after a small delay. To avoid 429 responses, you may wish to implement client-side request throttling to stay within the limits.

## Authentication

### bearerAuth

The Web3.Storage API uses bearer tokens to authenticate requests. You can view and manage these tokens on the [API Tokens page](https://web3.storage/tokens/) in your Web3.Storage account dashboard.

Your tokens carry many privileges, so be sure to keep them secure! Do not share your secret tokens in publicly accessible locations such as a GitHub repository, client-side code, and so forth.

**Bearer authentication** (also called token authentication) is an HTTP authentication scheme that involves security tokens called bearer tokens. The term “bearer authentication” can be understood as “give access to the bearer of this token.” The bearer token is a cryptic string, usually generated by the server in response to a login request. The client must send this token in the `Authorization` header when making requests to protected resources:

```js
Authorization: Bearer <token>
```

| Security Scheme Type      | HTTP   |
| ------------------------- | ------ |
| HTTP Authorization Scheme | bearer |
| Bearer format             | "JWT"  |

## Web3.Storage HTTP API

## Upload a CAR

<Callout>
##### POST&nbsp;&nbsp;&nbsp;`/car`
</Callout>

Upload a [CAR](https://ipld.io/specs/transport/car/) (Content Addressable aRchive) file and store the [IPFS DAG](https://docs.ipfs.io/concepts/merkle-dag/) (Directed Acyclic Graph) it contains.

See the [Working with Content Archives guide](https://web3.storage/docs/how-tos/work-with-car-files/) for details on creating CARs and splitting them into chunks for upload using the [carbites JavaScript API](https://github.com/nftstorage/carbites), [command line tool](https://github.com/nftstorage/carbites-cli/), or [Go library](https://github.com/alanshaw/go-carbites).

Requests to this endpoint have a maximum payload size of 100MB, but you may experience a high error rate when sending requests this large. Partial DAGs are supported, so multiple CAR files with the same root but with different sub-trees can be sent. This enables uploading of large files in multiple smaller payloads. We recommend a payload size of around 10MB. You may wish to use the JS client, which will do this chunking for you, as well as parallelize the uploads and handle rate limiting.

Note that only one CAR can be uploaded at a time, and only CAR files are accepted. This is in contrast to `/upload`, which can upload multiple files at once and accepts both CAR files and files from the client.

You can also provide a name for the file using the header `X-NAME`, but be sure to encode the filename first. For example `LICENSE–MIT` should be sent as `LICENSE%E2%80%93MIT`.

#### Request Body

|                     |                          |
| ------------------- | ------------------------ |
| Authorizations      | bearerAuth               |
| Request Body schema | application/vnd.ipld.car |
|                     | application/octet-stream |

#### Responses

<AccordionSingle heading="200 OK">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
    "cid": "bafkreidivzimqfqtoqxkrpge6bjyhlvxqs3rhe73owtmdulaxr5do5in7u"
}
```

</AccordionSingle>

<AccordionSingle heading="400 Bad Request">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
    "name": "string",
    "message": "string"
}
```

</AccordionSingle>

<AccordionSingle heading="401 Unauthorized">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
  "name": "HTTP Error",
  "message": "Unauthorized"
}
```

</AccordionSingle>

<AccordionSingle heading="403 Forbidden">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
  "name": "HTTP Error",
  "message": "Token is not valid"
}
```

</AccordionSingle>

<AccordionSingle heading="5XX Internal Server Error">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
  "name": "string",
  "message": "string"
}
```

</AccordionSingle>

## Retrieve a CAR

<Callout>
##### GET&nbsp;&nbsp;&nbsp;`/car/{cid}`
</Callout>

Retrieve an [IPFS DAG](https://docs.ipfs.io/concepts/merkle-dag/) (Directed Acyclic Graph) packaged in a CAR file by using `/car/{cid}`, supplying the CID of the data you are interested in.

### Path Parameters

| Name           | Description                                                                                                                            |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| cid (required) | string (CID)                                                                                                                           |
|                | `bafkreidivzimqfqtoqxkrpge6bjyhlvxqs3rhe73owtmdulaxr5do5in7u`                                                                          |
|                | Self-describing content-addressed identifiers for distributed systems. Check the CID (Content IDentifier) Specification for more info. |

### Responses

<AccordionSingle heading="200 OK">

|                 |                          |
| --------------- | ------------------------ |
| Response Schema | application/vnd.ipld.car |

```
string
```

</AccordionSingle>

<AccordionSingle heading="400 Bad Request">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
  "name": "string",
  "message": "string"
}
```

</AccordionSingle>

<AccordionSingle heading="5XX Internal Server Error">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
  "name": "string",
  "message": "string"
}
```

</AccordionSingle>

## Retrieve HTTP headers regarding a CAR

<Callout>
##### HEAD&nbsp;&nbsp;&nbsp;`/car/{cid}`
</Callout>

This method is useful for doing a dry run of a call to `/car/{cid}`. Because it only returns HTTP header information, it is far more lightweight and can be used to get only the metadata about the given CAR file without retrieving a whole payload in the body of the HTTP response.

### Path Parameters

| Name           | Description                                                                                                                                                                   |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| cid (required) | string (CID)                                                                                                                                                                  |
|                | `bafkreidivzimqfqtoqxkrpge6bjyhlvxqs3rhe73owtmdulaxr5do5in7u`                                                                                                                 |
|                | Self-describing content-addressed identifiers for distributed systems. Check the [CID (Content IDentifier) Specification](https://github.com/multiformats/cid) for more info. |

### Responses

<AccordionSingle heading="200 OK">

</AccordionSingle>

<AccordionSingle heading="400 Bad Request">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
  "name": "string",
  "message": "string"
}
```

</AccordionSingle>

<AccordionSingle heading="5XX Internal Server Error">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
  "name": "string",
  "message": "string"
}
```

</AccordionSingle>

## Retrieve information about an upload

<Callout>
##### GET&nbsp;&nbsp;&nbsp;`/status/{cid}`
</Callout>

Retrieve metadata about a specific file by using `/status/{cid}`, supplying the CID of the file you are interested in. This metadata includes the creation date and file size, as well as details about how the network is storing your data. Using this information, you can identify peers on the IPFS (InterPlanetary File System) network that are pinning the data, and Filecoin storage providers that have accepted deals to store the data.

### Path Parameters

| Name           | Description                                                                                                                                                                   |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| cid (required) | string (CID)                                                                                                                                                                  |
|                | `bafkreidivzimqfqtoqxkrpge6bjyhlvxqs3rhe73owtmdulaxr5do5in7u`                                                                                                                 |
|                | Self-describing content-addressed identifiers for distributed systems. Check the [CID (Content IDentifier) Specification](https://github.com/multiformats/cid) for more info. |

### Responses

<AccordionSingle heading="200 OK">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
  "cid": "bafkreidivzimqfqtoqxkrpge6bjyhlvxqs3rhe73owtmdulaxr5do5in7u",
  "dagSize": 132614,
  "created": "2021-03-12T17:03:07.787Z",
  "pins": [
    {
      "peerId": "12D3KooWMbibcXHwkSjgV7VZ8TMfDKi6pZvmi97P83ZwHm9LEsvV",
      "peerName": "web3-storage-dc13",
      "region": "US-DC",
      "status": "PinQueued",
      "updated": "2021-03-12T17:03:07.787Z"
    }
  ],
  "deals": [
    {
      "dealId": 138,
      "storageProvider": "f05678",
      "status": "Queued",
      "pieceCid": "bafkreidivzimqfqtoqxkrpge6bjyhlvxqs3rhe73owtmdulaxr5do5in7u",
      "dataCid": "bafkreidivzimqfqtoqxkrpge6bjyhlvxqs3rhe73owtmdulaxr5do5in7u",
      "dataModelSelector": "Links/100/Hash/Links/0/Hash/Links/0/Hash",
      "activation": "2021-03-18T11:46:50.000Z",
      "created": "2021-03-18T11:46:50.000Z",
      "updated": "2021-03-18T11:46:50.000Z"
    }
  ]
}
```

</AccordionSingle>

<AccordionSingle heading="400 Bad Request">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
  "name": "string",
  "message": "string"
}
```

</AccordionSingle>

<AccordionSingle heading="5XX Internal Server Error">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
  "name": "string",
  "message": "string"
}
```

</AccordionSingle>

## Upload and store one or more files

<Callout>
##### POST&nbsp;&nbsp;&nbsp;`/upload`
</Callout>

Store files using Web3.Storage. You can upload either a single file or multiple files.

Send the POST request with one of the following:

a single file, with a single blob/file object as the body
multiple files, as FormData with Content-Disposition headers for each part to specify filenames and the request header `Content-Type: multipart/form-data`
Requests to this endpoint have a maximum payload size of 100MB. To upload larger files, see the documentation for the `/car` endpoint.

You can also provide a name for the file using the header X-NAME, but be sure to encode the filename first. For example `LICENSE–MIT` should be sent as `LICENSE%E2%80%93MIT`.

### Path Parameters

|                      |                       |
| -------------------- | --------------------- |
| Authorizations:      | bearerAuth            |
| Request Body schema: | multipart/form-data   |
|                      | file Array of strings |

### Responses

<AccordionSingle heading="200 OK">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
  "cid": "bafkreidivzimqfqtoqxkrpge6bjyhlvxqs3rhe73owtmdulaxr5do5in7u"
}
```

</AccordionSingle>

<AccordionSingle heading="400 Bad Request">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
  "name": "string",
  "message": "string"
}
```

</AccordionSingle>

<AccordionSingle heading="401 Unauthorized">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
  "name": "HTTP Error",
  "message": "Unauthorized"
}
```

</AccordionSingle>

<AccordionSingle heading="403 Forbidden">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
  "name": "HTTP Error",
  "message": "Token is not valid"
}
```

</AccordionSingle>

<AccordionSingle heading="5XX Internal Server Error">

|                 |                  |
| --------------- | ---------------- |
| Response Schema | application/json |

```
{
  "name": "string",
  "message": "string"
}
```

</AccordionSingle>
