Registration¶
Invite User¶
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'leadr-api-key': 'string',
'authorization': 'string',
'leadr-client-nonce': 'string'
}
r = requests.post('/v1/register/invite', headers = headers)
print(r.json())
const inputBody = '{
"email": "user@example.com",
"display_name": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'leadr-api-key':'string',
'authorization':'string',
'leadr-client-nonce':'string'
};
fetch('/v1/register/invite',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /v1/register/invite
Invite a user to the authenticated admin's account.
Creates a user with INVITED status and sends an invite email with a verification code. If the user already exists with INVITED status, resends the invite (invalidates old code, sends new one).
Requires admin authentication.
Body parameter
{
"email": "user@example.com",
"display_name": "string"
}
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| account_id | query | any | false | none |
| leadr-api-key | header | any | false | none |
| authorization | header | any | false | none |
| leadr-client-nonce | header | any | false | none |
| body | body | InviteUserRequest | true | none |
Example responses
201 Response
{
"user_id": "string",
"email": "string",
"status": "string",
"message": "string"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Successful Response | InviteUserResponse |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Success
This operation does not require authentication
Create Jam Code¶
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'leadr-api-key': 'string',
'authorization': 'string',
'leadr-client-nonce': 'string'
}
r = requests.post('/v1/jam-codes', headers = headers)
print(r.json())
const inputBody = '{
"code": "string",
"description": "string",
"features": {},
"max_uses": 0,
"expires_at": "2019-08-24T14:15:22Z"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'leadr-api-key':'string',
'authorization':'string',
'leadr-client-nonce':'string'
};
fetch('/v1/jam-codes',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /v1/jam-codes
Create a new jam code (superadmin only).
Jam codes can be used for promotional campaigns, game jams, or referral tracking. They can optionally have usage limits, expiration dates, and custom features.
Body parameter
{
"code": "string",
"description": "string",
"features": {},
"max_uses": 0,
"expires_at": "2019-08-24T14:15:22Z"
}
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| account_id | query | any | false | none |
| leadr-api-key | header | any | false | none |
| authorization | header | any | false | none |
| leadr-client-nonce | header | any | false | none |
| body | body | CreateJamCodeRequest | true | none |
Example responses
201 Response
{
"id": "string",
"code": "string",
"description": "string",
"features": {},
"max_uses": 0,
"current_uses": 0,
"active": true,
"expires_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Successful Response | JamCodeResponse |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Success
This operation does not require authentication
List Jam Codes¶
import requests
headers = {
'Accept': 'application/json',
'leadr-api-key': 'string',
'authorization': 'string',
'leadr-client-nonce': 'string'
}
r = requests.get('/v1/jam-codes', headers = headers)
print(r.json())
const headers = {
'Accept':'application/json',
'leadr-api-key':'string',
'authorization':'string',
'leadr-client-nonce':'string'
};
fetch('/v1/jam-codes',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /v1/jam-codes
List all jam codes (superadmin only).
Returns a paginated list of all jam codes, including their usage statistics.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| account_id | query | any | false | none |
| cursor | query | any | false | Pagination cursor for navigating results |
| limit | query | integer | false | Number of items per page (1-100) |
| sort | query | any | false | Sort specification (e.g., 'value:desc,created_at:asc') |
| leadr-api-key | header | any | false | none |
| authorization | header | any | false | none |
| leadr-client-nonce | header | any | false | none |
Example responses
200 Response
{
"data": [
{
"id": "scr_123",
"value": 1000
}
],
"pagination": {
"count": 20,
"has_next": true,
"has_prev": false,
"next_cursor": "eyJwdiI6WzEwMDAsMTIzXX0="
}
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | PaginatedResponse_JamCodeResponse_ |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Success
This operation does not require authentication
Get Jam Code¶
import requests
headers = {
'Accept': 'application/json',
'leadr-api-key': 'string',
'authorization': 'string',
'leadr-client-nonce': 'string'
}
r = requests.get('/v1/jam-codes/{jam_code_id}', headers = headers)
print(r.json())
const headers = {
'Accept':'application/json',
'leadr-api-key':'string',
'authorization':'string',
'leadr-client-nonce':'string'
};
fetch('/v1/jam-codes/{jam_code_id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /v1/jam-codes/{jam_code_id}
Get a specific jam code by ID (superadmin only).
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| jam_code_id | path | string(uuid) | true | none |
| account_id | query | any | false | none |
| leadr-api-key | header | any | false | none |
| authorization | header | any | false | none |
| leadr-client-nonce | header | any | false | none |
Example responses
200 Response
{
"id": "string",
"code": "string",
"description": "string",
"features": {},
"max_uses": 0,
"current_uses": 0,
"active": true,
"expires_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | JamCodeResponse |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Success
This operation does not require authentication
Update Jam Code¶
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'leadr-api-key': 'string',
'authorization': 'string',
'leadr-client-nonce': 'string'
}
r = requests.patch('/v1/jam-codes/{jam_code_id}', headers = headers)
print(r.json())
const inputBody = '{
"description": "string",
"features": {},
"max_uses": 0,
"active": true,
"expires_at": "2019-08-24T14:15:22Z"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'leadr-api-key':'string',
'authorization':'string',
'leadr-client-nonce':'string'
};
fetch('/v1/jam-codes/{jam_code_id}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
PATCH /v1/jam-codes/{jam_code_id}
Update a jam code (superadmin only).
Can update description, features, max uses, active status, and expiration.
Body parameter
{
"description": "string",
"features": {},
"max_uses": 0,
"active": true,
"expires_at": "2019-08-24T14:15:22Z"
}
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| jam_code_id | path | string(uuid) | true | none |
| account_id | query | any | false | none |
| leadr-api-key | header | any | false | none |
| authorization | header | any | false | none |
| leadr-client-nonce | header | any | false | none |
| body | body | UpdateJamCodeRequest | true | none |
Example responses
200 Response
{
"id": "string",
"code": "string",
"description": "string",
"features": {},
"max_uses": 0,
"current_uses": 0,
"active": true,
"expires_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | JamCodeResponse |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Success
This operation does not require authentication
Initiate Registration¶
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/v1/register/initiate', headers = headers)
print(r.json())
const inputBody = '{
"email": "user@example.com"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/v1/register/initiate',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /v1/register/initiate
Initiate registration by sending a verification code to the provided email.
This endpoint is publicly accessible and requires no authentication. A 6-character verification code will be sent to the email address.
Body parameter
{
"email": "user@example.com"
}
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | InitiateRegistrationRequest | true | none |
Example responses
201 Response
{
"message": "string",
"code_expires_in": 0
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Successful Response | InitiateRegistrationResponse |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Success
This operation does not require authentication
Verify Code¶
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/v1/register/verify', headers = headers)
print(r.json())
const inputBody = '{
"email": "user@example.com",
"code": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/v1/register/verify',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /v1/register/verify
Verify an email verification code and return a temporary token.
This endpoint validates the verification code and returns a short-lived token that can be used to complete the registration process. The response includes the type (REGISTRATION or INVITE) so the client can determine which fields to prompt for.
Body parameter
{
"email": "user@example.com",
"code": "string"
}
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | VerifyCodeRequest | true | none |
Example responses
200 Response
{
"verification_token": "string",
"expires_in": 0,
"type": "string"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | VerifyCodeResponse |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Success
This operation does not require authentication
Complete Registration¶
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/v1/register/complete', headers = headers)
print(r.json())
const inputBody = '{
"verification_token": "string",
"account_name": "string",
"account_slug": "string",
"jam_code": "string",
"display_name": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/v1/register/complete',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /v1/register/complete
Complete registration or invite acceptance.
This endpoint handles two flows based on the verification token type:
Registration flow (new account): - Creates account with the specified name and slug - Creates user as account owner - Creates API key for CLI authentication - Optionally redeems jam code
Invite flow (joining existing account): - Activates the invited user (changes status from INVITED to ACTIVE) - Creates API key for CLI authentication - account_name and jam_code are ignored
The API key is returned in plaintext and should be stored securely by the client.
Body parameter
{
"verification_token": "string",
"account_name": "string",
"account_slug": "string",
"jam_code": "string",
"display_name": "string"
}
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | CompleteRegistrationRequest | true | none |
Example responses
201 Response
{
"account_id": "string",
"account_name": "string",
"account_slug": "string",
"api_key": "string",
"display_name": "string"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Successful Response | CompleteRegistrationResponse |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Success
This operation does not require authentication
Resend Verification Code¶
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/v1/register/resend-code', headers = headers)
print(r.json())
const inputBody = '{
"email": "user@example.com"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/v1/register/resend-code',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /v1/register/resend-code
Resend a verification code to the provided email.
This endpoint invalidates any existing codes for the email and sends a new one.
Body parameter
{
"email": "user@example.com"
}
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | InitiateRegistrationRequest | true | none |
Example responses
200 Response
{
"message": "string",
"code_expires_in": 0
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | InitiateRegistrationResponse |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Success
This operation does not require authentication