Create a new subscription (blockchain or snag)
This endpoint allows you to create a stratus subscription, which runs its associated functions and calls its callback URL whenever a matching event is detected. Provide either `blockchainSubscriptions`, for contract events or function calls to watch on a given chain, or `snagSubscriptions`, for changes to Snag platform tables. Exactly one of the two is required — sending both, or neither, is rejected.
This endpoint allows you to create a stratus subscription, which runs its associated functions and calls its callback URL whenever a matching event is detected. Provide either blockchainSubscriptions, for contract events or function calls to watch on a given chain, or snagSubscriptions, for changes to Snag platform tables. Exactly one of the two is required — sending both, or neither, is rejected.
Authorizations
API key passed in the header.
Body
Body
namestringrequired<= 1000websiteIdstringrequiredorganizationIdstringrequiredfunctionIdsarray<string>callbackUrlstring<uri>Must be the one below!!
metadataanystartsAtstringendsAtstringmaxEventsPerDaynumberblockchainSubscriptionsarray<object>blockchainSubscriptions.triggerIdstringblockchainSubscriptions.chainIdnumberrequiredblockchainSubscriptions.contractAddressstringrequiredblockchainSubscriptions.blockchainSubscriptionType"EVENT" | "FUNCTION"required"EVENT" | "FUNCTION"blockchainSubscriptions.eventAbistringblockchainSubscriptions.functionAbistringblockchainSubscriptions.fromBlockstringsnagSubscriptionsarray<object>snagSubscriptions.triggerIdstringsnagSubscriptions.tableNamesarray<string>requiredsnagSubscriptions.mainLoyaltyAccountIdsarray<string>Response
200
namestringrequiredwebsiteIdstringrequiredorganizationIdstringrequiredfunctionIdsarray<string>callbackUrlstringrequiredmetadataanystartsAtstringendsAtstringidstringrequiredversion"v1" | "v2""v1" | "v2"signingKeystringrequiredcreatedAtstring<date-time>requiredupdatedAtstring<date-time>requireddeletedAtstring<date-time>requireddisabledbooleandisabledAtstring<date-time>disabledReasonstringconsecutiveFailuresnumberblockchainSubscriptionsarray<object>blockchainSubscriptions.idstringrequiredblockchainSubscriptions.chainIdnumberrequiredblockchainSubscriptions.contractAddressstringrequiredblockchainSubscriptions.blockchainSubscriptionType"EVENT" | "FUNCTION"required"EVENT" | "FUNCTION"blockchainSubscriptions.eventSelectorstringrequiredblockchainSubscriptions.eventAbistringrequiredblockchainSubscriptions.functionAbistringrequiredblockchainSubscriptions.fromBlockstringrequiredblockchainSubscriptions.createdAtBlockstringrequiredblockchainSubscriptions.createdAtstring<date-time>requiredblockchainSubscriptions.updatedAtstring<date-time>requiredblockchainSubscriptions.deletedAtstring<date-time>requiredsnagSubscriptionsarray<object>snagSubscriptions.idstringrequiredsnagSubscriptions.tablestringrequiredsnagSubscriptions.createdAtstring<date-time>requiredsnagSubscriptions.updatedAtstring<date-time>requiredsnagSubscriptions.deletedAtstring<date-time>requiredPOST /api/stratus/subscriptions