Integration .connect
POST /{namespace}/integrations/connect
Connect asks an account holder to approve an outside account for one System and records the grants they approve.
- Noun
- Integration
- Mode
do- Event
Integration.connected
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
system | System | required | The System the Integration serves. |
scope | string | required | One of studio, startup or customer; a person’s own account is startup, narrowed to them. |
grants | string[] | required | The access requested, shown to the account holder before they approve. |
venue | string | The id of the ad, social or app-store venue the account is on. | |
for | Party | The account holder, when an Agent asks on their behalf. |
Outputs
| Output | Type | Required | Description |
|---|---|---|---|
integration | Integration | required | The Integration, connecting until approved. |
connectUrl | url | required | The approval page on the upstream’s own site; it expires in one hour. |
Effects
- Emits
Integration.connected. - Performed by the Integration Engineer.
- Two-way: it runs at once, in the
try,sendanddomodes. - Moves the Integration to
connectedwhen the account holder approves. - Stores the token in Secrets, where no Worker reads it.
- Records the approver as
connectedBy, the outside account and the grants.
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. | Integration.connect |
When it waits
| Gate | Default |
|---|---|
| Decision class | Medium: two-way, visible |
| Delay window | 1 business hour, in which a watcher can pause, redirect or cancel it; then it runs. |
| Limit | The call Limit of the Permission it runs under. |
| Over the Limit | It waits pending for an Approval from the Founder. Approved, it runs; refused, it ends refused with limit-exceeded; unanswered by its deadline, it ends canceled. |