Logs a bounty event for a player and, optionally, credits it to the creator whose referral code triggered it. eventCode must match an event already configured for the creator group, or the request fails with 400 InvalidEventCode. If referralCode is supplied, it must resolve to an approved member of the group, or the request fails with 400 ReferralNexusNotFound. If the matching event is not repeatable and this playerId already has one, the request fails with 409. The event is created and queued for bounty progress evaluation asynchronously, so a successful response does not mean any bounty’s progress has updated yet. A request that fails schema validation (for example, a missing playerId or eventCode) returns {status: 400, errors: [...]}.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters”Example
V1StGXR8_Z5jdHi6B1LiOCreator group to use for this operation. If your key is scoped to a single program, that group is always used regardless of this value; otherwise falls back to your default group when omitted.
Request Body
Section titled “Request Body”object
The code representing the event to be logged
Example
reachLevel20Unique id of the player that the event pertains to
Example
player_8f2c41d0Optional code for the creator that referred this user
Example
popcornfrogResponses
Section titled “ Responses ”Event created successfully
object
ID of the generated event
Referral code the event was associated with
Player ID the event was associated with
Bad request
object
CodeNotInGroup: Creator group is private, and specified code is not linked to it
InvalidGroup: No creator group was found with the specified groupId
InvalidAuthCode: AuthCode provided is not valid
ExpiredAuthCode: AuchCode provided has expired
ReferralNexusNotFound: No Nexus was found to match the provided referral code
BountyNotFound: No bounty was found with the specified bountyId
CreatorNotFound: No creator found with the specified creatorId
InvalidEventCode: No event found with the specifed event code
Event has already been logged and is not repeatable
const url = 'https://api.nexus.gg/v1/bounties/event?groupId=V1StGXR8_Z5jdHi6B1LiO';const options = { method: 'POST', headers: { 'X-SHARED-SECRET': 'nexus_sk_your_key_here', 'Content-Type': 'application-x-www-form-urlencoded' }, body: '{ "eventCode": "reachLevel20", "playerId": "player_8f2c41d0", "referralCode": "popcornfrog" }'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://api.nexus.gg/v1/bounties/event?groupId=V1StGXR8_Z5jdHi6B1LiO' \ --header 'Content-Type: application-x-www-form-urlencoded' \ --header 'X-SHARED-SECRET: nexus_sk_your_key_here' \ --data '{ "eventCode": "reachLevel20", "playerId": "player_8f2c41d0", "referralCode": "popcornfrog" }'Example
{ "id": "2ixlNNFdJh-9scoXek80w", "referralCode": "popcornfrog", "playerId": "player_8f2c41d0"}Example
{ "code": "InvalidEventCode", "message": "No event found with code: reachLevel20."}