Waitlist routes: admit, join
The Waitlist Verbs admit, join as api.sb routes, with inputs, result, refusals and an example.
Reference for Waitlist, one group of Waitlist routes.
Waitlist.admit
Admit releases Leads from a Waitlist to the Offer they waited for, in the order the Waitlist ranks them. Verb page.
POST /{namespace}/ waitlists/ {waitlist}/ admitPath: waitlist. Body, as JSON: the other inputs. Emits Waitlist.admitted.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
waitlist | Waitlist | required | The Waitlist. |
count | integer | required | How many Leads to admit. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
leads | list of Lead | required | The admitted Leads. |
waitlist | Waitlist | required | The Waitlist after the admitted Leads left it. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | refused | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |
Example
curl -X POST https: //api.sb/ leaseline.app/ waitlists/ waitlist_rBixb72HGB/ admit \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
-H "Content-Type: application/ json" \
-d '{"count": 1}'{
"api": "https: //api.sb/ leaseline.app",
"leads": [
{
"$id": "https: //api.sb/ leaseline.app/ leads/ lead_Kz1R9fhqzZ",
"$type": "Lead",
"status": "new"
}
],
"waitlist": {
"$id": "https: //api.sb/ leaseline.app/ waitlists/ waitlist_rBixb72HGB",
"$type": "Waitlist",
"invited": 1,
"rank": "signup"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Waitlist.admit",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}Waitlist.join
Join adds a Lead to a Waitlist for an Offer that is not open to them. Verb page.
POST /{namespace}/ waitlists/ {waitlist}/ joinPath: waitlist. Body, as JSON: the other inputs. Emits Waitlist.joined.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
waitlist | Waitlist | required | The Waitlist to join. |
email | email | required | Where to reach the Lead. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
lead | Lead | required | The waiting Lead. |
waitlist | Waitlist | required | The Waitlist joined. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The input does not match the schema of the operation. | invalid-input | Read the schema of the operation, then send every required field with the right type. | None. |
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
curl -X POST https: //api.sb/ leaseline.app/ waitlists/ waitlist_rBixb72HGB/ join \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
-H "Content-Type: application/ json" \
-d '{"email": "dana@leaseline.app"}'{
"api": "https: //api.sb/ leaseline.app",
"lead": {
"$id": "https: //api.sb/ leaseline.app/ leads/ lead_Kz1R9fhqzZ",
"$type": "Lead",
"status": "new"
},
"waitlist": {
"$id": "https: //api.sb/ leaseline.app/ waitlists/ waitlist_rBixb72HGB",
"$type": "Waitlist",
"invited": 1,
"rank": "signup"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Waitlist.join",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}