MasChain API Key Management
Create API Key
Create a new API key for an organisation.
POST /maschain/api-key/create
| Header | Value | Description |
|---|
| maschain-api-key | YOUR_API_KEY | Your MasChain API key |
| content-type | application/json | Content type of the request |
Body
| Name | Type | Required | Description |
|---|
| id | string | Yes | API key ID |
| secret | string | Yes | API key secret |
| name | string | No | Name for the API key |
| organisationId | string | Yes | ID of the organisation |
| organisationName | string | Yes | Name of the organisation |
| isActive | boolean | No | Whether the key is active (defaults to true) |
Get API Key by ID
Retrieve details of a specific API key.
GET /maschain/api-key/{id}
| Header | Value | Description |
|---|
| maschain-api-key | YOUR_API_KEY | Your MasChain API key |
URL Parameters
| Name | Type | Required | Description |
|---|
| id | string | Yes | API key ID |
Response
| Name | Type | Description |
|---|
| id | string | API key ID |
| name | string | Name of the API key |
| organisationId | string | Organisation ID |
| isActive | boolean | Whether the key is active |
Get Organisation API Keys
Retrieve all API keys for a specific organisation.
GET /maschain/api-key/organisation/{organisationId}
| Header | Value | Description |
|---|
| maschain-api-key | YOUR_API_KEY | Your MasChain API key |
URL Parameters
| Name | Type | Required | Description |
|---|
| organisationId | string | Yes | Organisation ID |
Response
Returns an array of API keys with the following structure for each key:
| Name | Type | Description |
|---|
| id | string | API key ID |
| name | string | Name of the API key |
| organisationId | string | Organisation ID |
| isActive | boolean | Whether the key is active |
Update API Key
Update an existing API key.
POST /maschain/api-key/update/{id}
| Header | Value | Description |
|---|
| maschain-api-key | YOUR_API_KEY | Your MasChain API key |
| content-type | application/json | Content type of the request |
URL Parameters
| Name | Type | Required | Description |
|---|
| id | string | Yes | API key ID |
Body
| Name | Type | Required | Description |
|---|
| name | string | No | New name for the API key |
| isActive | boolean | Yes | Whether the key should be active |
Sync Contracts
Synchronize smart contracts.
POST /maschain/sync-contracts
| Header | Value | Description |
|---|
| maschain-api-key | YOUR_API_KEY | Your MasChain API key |
Response
| Name | Type | Description |
|---|
| message | string | Success message |
Sync Wallet Names
Synchronize wallet names.
POST /maschain/sync-wallet-names
| Header | Value | Description |
|---|
| maschain-api-key | YOUR_API_KEY | Your MasChain API key |
Response
| Name | Type | Description |
|---|
| message | string | Success message |
Sync Token Price
Synchronize price for a specific token contract.
POST /maschain/sync-token-price/{contractAddress}
| Header | Value | Description |
|---|
| maschain-api-key | YOUR_API_KEY | Your MasChain API key |
URL Parameters
| Name | Type | Required | Description |
|---|
| contractAddress | string | Yes | Address of the token contract |
Response
| Name | Type | Description |
|---|
| message | string | Success message |