Skip to main content

MasChain API Key Management

Create API Key

Create a new API key for an organisation.

POST /maschain/api-key/create

Headers

HeaderValueDescription
maschain-api-keyYOUR_API_KEYYour MasChain API key
content-typeapplication/jsonContent type of the request

Body

NameTypeRequiredDescription
idstringYesAPI key ID
secretstringYesAPI key secret
namestringNoName for the API key
organisationIdstringYesID of the organisation
organisationNamestringYesName of the organisation
isActivebooleanNoWhether the key is active (defaults to true)

Get API Key by ID

Retrieve details of a specific API key.

GET /maschain/api-key/{id}

Headers

HeaderValueDescription
maschain-api-keyYOUR_API_KEYYour MasChain API key

URL Parameters

NameTypeRequiredDescription
idstringYesAPI key ID

Response

NameTypeDescription
idstringAPI key ID
namestringName of the API key
organisationIdstringOrganisation ID
isActivebooleanWhether the key is active

Get Organisation API Keys

Retrieve all API keys for a specific organisation.

GET /maschain/api-key/organisation/{organisationId}

Headers

HeaderValueDescription
maschain-api-keyYOUR_API_KEYYour MasChain API key

URL Parameters

NameTypeRequiredDescription
organisationIdstringYesOrganisation ID

Response

Returns an array of API keys with the following structure for each key:

NameTypeDescription
idstringAPI key ID
namestringName of the API key
organisationIdstringOrganisation ID
isActivebooleanWhether the key is active

Update API Key

Update an existing API key.

POST /maschain/api-key/update/{id}

Headers

HeaderValueDescription
maschain-api-keyYOUR_API_KEYYour MasChain API key
content-typeapplication/jsonContent type of the request

URL Parameters

NameTypeRequiredDescription
idstringYesAPI key ID

Body

NameTypeRequiredDescription
namestringNoNew name for the API key
isActivebooleanYesWhether the key should be active

Sync Contracts

Synchronize smart contracts.

POST /maschain/sync-contracts

Headers

HeaderValueDescription
maschain-api-keyYOUR_API_KEYYour MasChain API key

Response

NameTypeDescription
messagestringSuccess message

Sync Wallet Names

Synchronize wallet names.

POST /maschain/sync-wallet-names

Headers

HeaderValueDescription
maschain-api-keyYOUR_API_KEYYour MasChain API key

Response

NameTypeDescription
messagestringSuccess message

Sync Token Price

Synchronize price for a specific token contract.

POST /maschain/sync-token-price/{contractAddress}

Headers

HeaderValueDescription
maschain-api-keyYOUR_API_KEYYour MasChain API key

URL Parameters

NameTypeRequiredDescription
contractAddressstringYesAddress of the token contract

Response

NameTypeDescription
messagestringSuccess message