Complete Invite
POST
/api/v1/users/invite/complete
const url = 'https://api.spartanauth.com/api/v1/users/invite/complete';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"sub":"example","otp":"example","password":"example","sectorID":"example"}'};
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.spartanauth.com/api/v1/users/invite/complete \ --header 'Content-Type: application/json' \ --data '{ "sub": "example", "otp": "example", "password": "example", "sectorID": "example" }'Validates the invite OTP for a pending invited user, sets their password, marks the invite as active, and returns a JWT when token issuance succeeds. Public endpoint intended for invite links; if token issuance fails, the invite still completes and the client can fall back to a normal login.
Request Body
Section titled “Request Body ” Media type application/json
object
sub
string
otp
string
password
string
sectorID
string
Example generated
{ "sub": "example", "otp": "example", "password": "example", "sectorID": "example"}Responses
Section titled “ Responses ”A successful response.
Media type application/json
object
success
boolean
message
string
token
string
Example generated
{ "success": true, "message": "example", "token": "example"}default
Section titled “default ”An unexpected error response.
Media type application/json
object
code
integer format: int32
message
string
details
Array<object>
object
@type
string
key
additional properties
Example generated
{ "code": 1, "message": "example", "details": [ { "@type": "example" } ]}