Filebase Platform APIs
Learn about how to use the Filebase Platform APIs.
Filebase Platform APIs
The Filebase Platform API is a general purpose API that can be used to manage various Filebase resources. These resources include storage usage, bandwidth usage, IPNS names, and dedicated gateways.
Request Body Schema: application/json
Authorization
Authorization: Bearer <access-token>
To generate the access-token
, start by retrieving your Filebase Access Key and Secret Access Key pair.
Then, navigate to Base64Encode and input the following information:
ACCESS-KEY:SECRET-KEY
Then select 'Encode' and copy the result:
Total Storage and Recent Bandwidth (Past 24 Hours) Usage API
Used to generate reports on a user's current storage in bytes across all buckets. This API also returns information regarding the user's bandwidth usage over the last 24 hours.
Payload
Request Body Schema: application/json
List current storage across all buckets and all bandwidth usage in the last 24 hours.
GET
https://api.filebase.io/v1/usage
This API can be used to generate a report that provides information on the user's current storage across all buckets, and all bandwidth usage within the last 24 hours.
Total Storage for a Specific Bucket API
Used to generate reports on a user's current storage in a specific bucket.
Payload
Request Body Schema: application/json
List current storage usage in bytes for a specific bucket.
GET
https://api.filebase.io/v1/usage/storage/<bucket-name>
This API can be used to generate a report that provides information on the user's current storage across a specific bucket.
Path Parameters
Name | Type | Description |
---|---|---|
bucket-name* | String | A Filebase bucket name. |
Bandwidth Usage For an IPFS Dedicated Gateway API
Used to generate a usage report of a dedicated IPFS gateway over the last 24 hours.
Payload
Request Body Schema: application/json
List bandwidth usage over the last 24 hours for a specific IPFS dedicated gateway.
GET
https://api.filebase.io/v1/usage/gateway/<gateway-name>
This API reports bandwidth usage over the last 24 hours for a specific IPFS dedicated gateway.
Path Parameters
Name | Type | Description |
---|---|---|
gateway-name* | String | A Filebase IPFS dedicated gateway name. |
Gateways
This set of APIs can be used to manage dedicated IPFS gateways.
List gateways
GET
https://api.filebase.io/v1/gateways
Returns a list of all Dedicated IPFS Gateways
Return details of a specific gateway
GET
https://api.filebase.io/v1/gateways/<gateway-name>
Response returns details for the specified gateway.
Create a dedicated gateway
POST
https://api.filebase.io/v1/gateways
Allows a user to create a dedicated gateway.
Example JSON Body Payload:
Request Body
Name | Type | Description |
---|---|---|
name* | String | The name of the gateway. The name restrictions here match bucket names, 3..63 characters, must be globally unique. If a bucket name is already taken, a HTTP 409 Conflict will be returned with a message. |
private | Boolean | False by default. This controls whether the gateway is public (can fetch any IPFS content) or private (can only fetch content that you've pinned). |
enabled | Boolean | True by default. This controls whether a gateway is actually functional. A user can disable a gateway to prevent it from serving content. |
Update a gateway
PUT
https://api.filebase.io/v1/gateways/<gateway-name>
Allows a user to update the configuration of a gateway.
Request Body
Name | Type | Description |
---|---|---|
private | Boolean | False by default. This controls whether the gateway is public (can fetch any IPFS content) or private (can only fetch content that you've pinned). |
enabled | Boolean | True by default. This controls whether a gateway is actually functional. A user can disable a gateway to prevent it from serving content. This will keep the gateway created, but transition it into a non-functional state. The only real use case here (so far) is to let a user pause a gateway temporarily without having to give up the name. |
Delete a gateway
DELETE
https://api.filebase.io/v1/gateways/<gateway-name>
No body payload required. Allows a use to delete a dedicated gateway. Upon deletion, the gateway will no longer be functional and it will stop serving content.
Names
This set of APIs can be used to manage IPNS name records.
List Names
GET
https://api.filebase.io/v1/names
Return details of a specific name record
GET
https://api.filebase.io/v1/names/<label>
Path Parameters
Name | Type | Description |
---|---|---|
label* | String | Label of name record |
Create a name
POST
https://api.filebase.io/v1/names
Request Body
Name | Type | Description |
---|---|---|
label* | String | Label used to identify the name |
cid* | String | CID for the name record |
Update a name
PUT
https://api.filebase.io/v1/names/<label>
Request Body
Name | Type | Description |
---|---|---|
label | String | Label used to identify the name |
cid | String | CID for the name record |
Delete a name record
DELETE
https://api.filebase.io/v1/names/<label>
Last updated