Morpheus API Gateway LogoMorpheus API Gateway
Session

Approve Spending

Approve the contract to spend MOR tokens on your behalf. Connects to the proxy-router's /blockchain/approve endpoint. For creating sessions, approve enough tokens by calculating: bid_price * session_duration. Uses the DIAMOND_CONTRACT_ADDRESS environment variable as the spender contract address.

POST
/api/v1/session/approve

Authorization

Authorization<token>

Provide the API key in either format: 'Bearer sk-xxxxxx.yyyyyyy' or just 'sk-xxxxxx.yyyyyyy'. The prefix is 9 characters long including 'sk-'.

In: header

Query Parameters

amountRequiredAmount

The amount to approve, consider bid price * duration for sessions

Response Body

Successful Response

TypeScript Definitions

Use the response body type in TypeScript.

responseRequiredunknown
curl -X POST "http://api.mor.org/api/v1/session/approve?amount=0" \
  -H "Authorization: <token>"
null

How is this guide?