Creates a creator code for one of your players and returns it.
You mint the code first, against a playerId you already have, and the creator claims it later through the link workflow. The code attributes from the moment it exists, so sales earn against it while it is still unclaimed.
That fits programs where the content comes before the creator relationship: generate a code alongside every user-made level, for example, and sales on that level are already attributed if and when its author signs up.
Call it once per player. If that playerId already has a code in the group, the existing code is returned instead of a second one being created, so the call is safe to retry.
A new code is seven lowercase letters and digits (for example k3m9x2p). Until it is claimed the code is publisher-managed: you own it, and it belongs to no Nexus account. If the player has already linked a Nexus account to your group, the new code is attached to that account instead.
This method authenticates with a secret (nexus_sk_...) key.
Authorizations
Section titled “Authorizations”Send your secret API key (nexus_sk_...) in the X-SHARED-SECRET header. Generate one in the Publisher Dashboard.
Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters”Creator group.
Request Body
Section titled “Request Body”object
Your own identifier for the player the code is created for. Reuse the same value to look the player up later.
Example
player_8f2c41d0Additional player information to be applied to this member (such as their in game display name)
object
The players in game display name
Example
Popcorn FrogResponses
Section titled “ Responses ”The player’s creator code, together with the group it belongs to. Returned whether the code was created by this call or already existed.
object
ID of the creator group
Name of the creator group
Unique Identifier provided when this code was created
Additional player information to be applied to this member (such as their in game display name)
object
The players in game display name
The creator code. Seven lowercase letters and digits.
The request could not be fulfilled. Either playerId was missing, or groupId did not match a creator group on your publisher account. Branch on code, not on message.
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 or the nexus it represents is not a member of your program
ExpiredAuthCode: AuchCode provided has expired
NexusNotFound: No Nexus was found to match the provided code
PlayerNotInGroup: No group member found for the given playerId
PlayerAlreadyLinked: The playerId provided has already been linked with a group member
MemberAlreadyLinked: The nexus represented by the auth code specified is already a member of your group and has been linked with a different playerId.
A human-readable explanation. Log it; do not match on it, as the wording can change. Branch on code instead.
curl --request POST \ --url 'https://api.nexus.gg/v1/manage/members' \ --header 'X-SHARED-SECRET: nexus_sk_your_key_here' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data 'playerId=player_8f2c41d0'const response = await fetch('https://api.nexus.gg/v1/manage/members', { method: 'POST', headers: { 'X-SHARED-SECRET': process.env.NEXUS_PRIVATE_KEY, 'Content-Type': 'application/x-www-form-urlencoded', }, body: new URLSearchParams({ playerId: 'player_8f2c41d0' }),});
const { code } = await response.json();Example
{ "groupId": "V1StGXR8_Z5jdHi6B1LiO", "groupName": "Aurora Drift Creators", "playerId": "player_8f2c41d0", "playerMetadata": { "displayName": "Popcorn Frog" }, "code": "k3m9x2p"}Example
{ "code": "InvalidGroup", "message": "Invalid Group ID: V1StGXR8_Z5jdHi6B1LiO"}