Skip to content

Tenant programs: invite, pin, provision, requestSetup

The Tenant Verbs invite, pin, provision, requestSetup as MCP do programs, with inputs, result, refusals and an example.

Reference for Tenant, one group of Tenant programs.

Tenant.invite

Invite asks a Person to join a Customer’s Tenant, and resizes the Subscription when the Offer prices per member. Verb page.

Text
do: return await $.Tenant.invite(input)

Emits Tenant.invited.

Inputs

InputTypeRequiredDescription
tenantTenantrequiredThe Customer’s Tenant.
emailemailrequiredWhere the invitation goes.

Returns

OutputTypeRequiredDescription
personPersonrequiredThe invited Person.
tenantTenantrequiredThe Tenant the Person was invited to.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.Tenant.invite({ tenant: 'ten_Bu63f0he26', email: 'dana@leaseline.app' })"
  }
}

Tenant.pin

Pin moves a Tenant’s keys to another API version, or to latest, once a call with its test key passes there. Verb page.

Text
do: return await $.Tenant.pin(input)

Emits Tenant.pinned.

Inputs

InputTypeRequiredDescription
tenantTenantrequiredThe Tenant whose keys move.
apiVersionstringrequiredThe version to answer at, such as v2, or latest to track the newest.

Returns

OutputTypeRequiredDescription
tenantTenantrequiredThe Tenant, answering at its new version.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
Until a call with the Tenant’s test key succeeds at the target versionrefusedClear what the check names, then call it again.None.

Example

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.Tenant.pin({ tenant: 'ten_Bu63f0he26', apiVersion: 'v2' })"
  }
}

Tenant.provision

Provision creates a Customer’s Tenant in a Startup’s App, holding that Customer’s records apart from every other. Verb page.

Text
do: return await $.Tenant.provision(input)

Emits Tenant.provisioned.

Inputs

InputTypeRequiredDescription
customerCustomerrequiredThe Customer the Tenant serves.

Returns

OutputTypeRequiredDescription
tenantTenantrequiredThe new Tenant.

Refuses when

CheckErrorFixThen call
The operation is part of an Offer the caller has not accepted or paid for.payment-requiredAccept the Offer named in the response, then retry the call.Offer.accept
The key is valid, but its scopes do not allow this operation.forbiddenUse 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.refusedRead the record, run the Verb that moves it to an allowed state, then retry.None.

Example

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.Tenant.provision({ customer: 'cus_K1BROJhqzZ' })"
  }
}

Tenant.requestSetup

RequestSetup sends a Customer’s admin a link to connect their own sign-in, directory or verified domain to the Tenant. Verb page.

Text
do: return await $.Tenant.requestSetup(input)

Emits Tenant.setupRequested.

Inputs

InputTypeRequiredDescription
tenantTenantrequiredThe Tenant to set up.
adminPersonrequiredThe Customer’s admin who receives the link.
intentstringrequiredWhat the link sets up.

Returns

OutputTypeRequiredDescription
linkurlrequiredThe single-use setup link, valid for 7 days.
tenantTenantrequiredThe Tenant being set up.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.Tenant.requestSetup({ tenant: 'ten_Bu63f0he26', admin: 'person_sLqbXbW683', intent: 'sso' })"
  }
}