FilSwan API
This is a Postman Collection for the FilSwan API v2 endpoints. The page below describes different components of our API offering.
Authorization
These endpoints return details about Authorization.
Get Auth Token
POST
https://api.filswan.com/auth/login
This endpoint allows you to get an JWT Bearer Token (auth_token) from email and password. The auth_token can be used for generate other API Keys.
Request Body
Name | Type | Description |
---|---|---|
string | ||
password | string |
Generate API Key
POST
https://api.filswan.com/user/api_keys/jwt
This endpoint allows you to issue new API keys for their account programmatically. The only key-type that can be used to issue new keys is the login user's JWT Bearer Token. The purpose of this endpoint is to allow for programmatic creation of API keys that may be used for multiple projects, individual users, or a variety of other use cases where a single API key pair across an account is not sufficient. This endpoint will return three values: The API Key, the API Secrect, and a JWT Bearer Token. Make sure to record the API Secret and the JWT as they will not be accessible again.
Request Body
Name | Type | Description |
---|---|---|
key_name | string |
Generate JWT token
POST
https://api.filswan.com/user/api_keys/jwt
To use the bearer authentication model, you will need the JWT that is generated using this API. This token can be used as an Authorization header for all your API requests in the following format: "Authorization": "Bearer YOUR_JWT"
Request Body
Name | Type | Description |
---|---|---|
access_token | string | |
apikey | string |
Miners
These endpoints return details about storage providers specified by the requested IDs.
List Storager Provider
GET
https://api.filswan.com/miners?limit={{limit}}&offset={{offset}}&location={{location}}&offline_deal_available={{offline_deal_available}}&status={{status}}&sort_by={{sort_by}}&order={{order}}
This endpoint allows you to get a list of storage providers.
Path Parameters
Name | Type | Description |
---|---|---|
limit | integer | Number of items in one page. Default: 10 |
offset | integer | Page number, starts from 0. Default: 0 |
location | string | The location of miners. If empty, it shows miners at all locations. Possible values: Global, Asia, Africa, North America, South America, Europe, Oceania |
offline_deal_available | integer | Miner accept offline deals or not. If empty, it shows all miners. Possible values: 1, 0 |
status | string | The status of miners. If empty, it shows all miners in any status. Possible values: Active, Offline. |
sort_by | string | Possible values: update_time_str, price, verified_price, score, status, location |
order | string | Possible values: asc, desc |
Single Storage Providers Detail
GET
https://api.filswan.com/miners/{{miner_id}}
This endpoint allows you to get details of the miner specified by the requested provider ID.
Update Storage Provider Info
POST
https://api.filswan.com/miner/info
This endpoint allows you to update your storage provider information.
Headers
Name | Type | Description |
---|---|---|
authorization | string |
Request Body
Name | Type | Description |
---|---|---|
miner_fid | string | |
bid_mode | integer | Possible values: 1,0 |
start_epoch | number | |
location | string | |
offline_deal_available | string | Possible values: true/false |
expected_sealing_time | number |
Tasks
These endpoints return details about tasks specified by the requested IDs.
Public Tasks
List Public Tasks
GET
https://api.filswan.com/tasks?created_after={{created_after}}&has_miner={{has_miner}}&status={{status}}&is_public={{is_public}}&task_name={{task_name}}&type={{type}}&tags={{tags}}&max_price={{max_price}}&min_price={{min_price}}
This endpoint allows you to get a list of public tasks.
Path Parameters
Name | Type | Description |
---|---|---|
created_after | integer | Filter tasks after a specific time. If empty, it shows all tasks created at any time. Value is Unix timestamp in seconds. |
has_miner | integer | Filter tasks had already been designated to a miner or not. If empty, show all tasks. Possible values: 1, 0 |
status | string | Filter tasks in various status. If empty, it shows tasks in any status. Possible values: created, completed. |
is_public | integer | Tasks are public or private. Possible values: 1, 0 |
task_name | string | Search tasks by task name |
type | string | The deals in this task is verified or not. Possible values: regular, verified |
tags | string | Search tasks by tags. Use comma to separate multiple tags. |
max_price | number | Max price per Gib per epoch |
min_price | number | Min price per Gib per epoch |
Client Tasks
List User Tasks
GET
https://api.filswan.com/tasks?limit={{limit}}&offset={{offset}}
This endpoint allows you to get details of tasks created by a client.
Path Parameters
Name | Type | Description |
---|---|---|
limit | integer | The number of items to return in the response |
offset | integer | Page number, starts from 0. Default: 0 |
Headers
Name | Type | Description |
---|---|---|
authorization | string | Bearer token |
Single Task Details
GET
https://api.filswan.com/tasks/{{task_uuid}}?limit={{limit}}&offset={{offset}}
This endpoint allows you to get details about the task specified by the requested task UUID.
Path Parameters
Name | Type | Description |
---|---|---|
limit | integer | Number of items in one page. Default: 10 |
offset | integer | Page number, starts from 0. Default: 0 |
Create Task
POST
https://api.filswan.com/tasks
This endpoint allows you to create a new task on FilSwan Platform.
Headers
Name | Type | Description |
---|---|---|
authorization | string | Bearer token |
Request Body
Name | Type | Description |
---|---|---|
fast_retrieval | string | Possible values: true/false |
bid_mode | string | This task is available for autobid or not. Possible values: 1, 0 |
task_name | string | Task name you prefered |
is_public | integer | This task is whether public or private. The possible values: 1, 0 |
type | string | The deals in this task is whether regular or verified. Possible values: regular, verified |
file | object | The CSV file containing all deal information in the task to create. It is required when creating a private task. |
miner_id | string | The provider you want to assign the task to. Required if is_public is set to 0. |
description | string | |
tags | string | Up to 5 tags. Use comma to separate multiple tags. |
max_price | number | Max price per Gib per epoch |
min_price | number | Min price per Gib per epoch |
Storage Provider Tasks
List Storage Provider Tasks
GET
https://api.filswan.com/my_miner/tasks?limit={{limit}}&offset={{offset}}
This endpoint allows you to get a list of tasks when your role is a miner.
Path Parameters
Name | Type | Description |
---|---|---|
limit | integer | The number of items to return in the response. Default: 20 |
offser | integer | Page number, starts from 0. Default: 0 |
Deals.
Get storage provider's deals by status
GET
https://api.filswan.com/offline_deals/{{miner_fid}}?deal_status={{deal_status}}&limit={{limit}}&offset={{offset}}
This endpoint allows you to get a list of offline deals belongs to a specified provider ID.
Path Parameters
Name | Type | Description |
---|---|---|
deal_status | string | The deal status. Possible values: ReadyForImport, FileImporting, FileImported, DealActive, ImportFailed |
limit | integer | The number of items to return in the response. Default: 20 |
offset | integer | Page number, starts from 0. Default: 0 |
Headers
Name | Type | Description |
---|---|---|
authorization | string | Bearer token |
Update Single Deal Details
PUT
https://api.filswan.com/my_miner/deals/<deal_cid>
Headers
Name | Type | Description |
---|---|---|
authorization | string | Bearer token |
Request Body
Name | Type | Description |
---|---|---|
status | string | The new deal status. Possible values: FileImporting, FileImported, DealActive, ImportFailed |
note | string | The additional information you would like to provide regarding the deal. |
file_path | string | The path where the car file is downloaded. |
file_size | string | The size of the car file. |
Update Deal Status
PUT
https://api.filswan.com/my_miner/tasks/<task_uuid>/deals/<deal_cid>
Headers
Name | Type | Description |
---|---|---|
authorization | string | Bearer token |
Request Body
Name | Type | Description |
---|---|---|
status | string | The new deal status. Possible values: FileImporting, FileImported, DealActive, ImportFailed |
note | string | The additional information you would like to provide regarding the deal |
List of Supported API Methods
The list below documents the API methods that the FilSwan platform currently supports. When a response payload is present, all responses are returned in JSON format.
Get Auth Token
Generate API Key
Generate JWT token
List storage providers
Single storage provider
List Public Tasks
List User Tasks
Single task
Create Task
List storage provider Tasks
Get storage provider's deals by status
Update Single deal details
Update deal status of a task
Find out more about our APIs.
If you have an API-related question, you can also discuss in the developer community forum.
Last updated