Skip to main content
GET
Poll an agent connect session

Path Parameters

pollToken
string
required
Pattern: ^jcp_[0-9a-f]{64}$
Example:

"jcp_0000000000000000000000000000000000000000000000000000000000000000"

Response

200 - application/json

Where the session stands.

status
enum<string>
required
Available options:
pending,
approved,
consumed,
denied,
expired
message
string
required
apiKey
string

Only on approved. Store it now. If it is lost before it is used (the poller died), poll again with the same token within 10 minutes: Jam revokes that key and answers a new one (replaced: true). Once the key has been used, or after 10 minutes, the poll answers consumed.

replaced
boolean

On approved: true when this key replaces an earlier, never used key from this session, which is now revoked.

workspaceId
string
expiresAt
string
stage
enum<string>

Only on pending: what is left. awaiting_signin (the link is not opened by a signed-in person yet), awaiting_review (they have not approved), awaiting_payment (approved, the trial has not started), setting_up (paid, the project is being created).

Available options:
awaiting_signin,
awaiting_review,
awaiting_payment,
setting_up
reason
enum<string>

Only on awaiting_payment: why the trial has not started. checkout_not_started (approved, checkout not opened yet), checkout_open (the checkout the human opened is still payable, for up to 31 minutes after it opened; they may still be paying), checkout_abandoned (checkout was opened, then closed or expired unpaid), payment_failed (the card payment did not go through).

Available options:
checkout_not_started,
checkout_open,
checkout_abandoned,
payment_failed
checkoutStartedAt
string | null

Only on awaiting_payment: when the human last opened checkout, or null.

checkoutExpiresAt
string | null

Only on awaiting_payment: when the checkout the human last opened stops being payable (31 minutes after it opened), or null. After it, reason is checkout_abandoned and "Finish checkout" opens a fresh one.

resumeUrl
string

Only on awaiting_payment: send the human this link (the same as connectUrl). Signed in as the person who approved, it shows "Finish checkout", which opens a fresh checkout with the plan they chose. It is never a raw checkout link.

Example:

"https://www.spreadjam.com/connect/ABCD234567"

humanMessage
string

Only on awaiting_payment: a sentence you can pass to the human as is, with the link and what to do.