> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spreadjam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Poll an agent connect session

> No API key needed. `pending` (with `stage`: what is left) until the human approves and, for a session started with `onboarding`, until the trial has started and the project exists; then `approved` with the API key; then `consumed`. The raw key is never stored, so it is not shown twice: a poll within 10 minutes of the first `approved` whose key was never used gets a replacement key (the first is revoked, `replaced: true`), so a poller that died before storing it can recover. `denied` and `expired` are final.



## OpenAPI

````yaml https://api.spreadjam.com/openapi.json get /v1/agent-connect/{pollToken}
openapi: 3.0.0
info:
  title: SpreadJam API
  version: 1.0.0
servers:
  - url: https://api.spreadjam.com
security: []
tags:
  - name: Meta
    description: Identity and metadata about the authenticated key.
  - name: Keywords
    description: Keyword and topic visibility rankings.
  - name: API keys
    description: Manage the workspace's API keys.
  - name: Analytics
    description: AI-visibility analytics for the workspace.
  - name: Brand
    description: The workspace's brand profile and competitors.
  - name: Prompts
    description: Tracked GEO prompts and their cap state.
  - name: Visibility runs
    description: Run the AI-visibility scan now.
  - name: Credits
    description: The workspace's credit balance and recent charges.
  - name: Actions
    description: Recommended visibility actions and reporting them done.
  - name: Agent connect
    description: >-
      Sign a human up from an agent with one link, then receive an API key once
      they approve. No API key needed.
  - name: Pricing
    description: >-
      The plans an agent can choose for a human and their monthly prices. No API
      key needed.
  - name: Site changes
    description: >-
      Code changes Jam prepares for page edits and technical fixes: preview,
      open the pull request, discard.
  - name: Research
    description: >-
      The research that writes the Plan: its state, its latest report, and
      running it again.
  - name: Answers
    description: >-
      What each AI platform answered to the tracked prompts, with the sources it
      cited.
  - name: Projects
    description: The workspace's projects and the status of each one.
  - name: Billing
    description: The workspace's plan and the links where a person manages billing.
  - name: Webhooks
    description: >-
      HTTP destinations the workspace notifications are POSTed to, signed with a
      per-webhook secret.
  - name: Notifications
    description: >-
      Which notifications reach which channels (including webhooks), per event
      category.
  - name: Opportunities
    description: >-
      Article opportunities: the article pipeline behind the Plan's `new_page`
      actions, and requests to create content from them.
  - name: Planning
    description: Run automatic content planning now.
  - name: Content
    description: Content items, their drafts, and requests to rewrite them.
  - name: Revisions
    description: A content item's revisions.
  - name: Publishing
    description: Publishing content to destinations, now or on a schedule.
  - name: Deliveries
    description: A content item's delivery history.
  - name: Publications
    description: Where a content item is live.
  - name: Destinations
    description: Where content is published, its publishing policy, and its connection.
paths:
  /v1/agent-connect/{pollToken}:
    get:
      tags:
        - Agent connect
      summary: Poll an agent connect session
      description: >-
        No API key needed. `pending` (with `stage`: what is left) until the
        human approves and, for a session started with `onboarding`, until the
        trial has started and the project exists; then `approved` with the API
        key; then `consumed`. The raw key is never stored, so it is not shown
        twice: a poll within 10 minutes of the first `approved` whose key was
        never used gets a replacement key (the first is revoked, `replaced:
        true`), so a poller that died before storing it can recover. `denied`
        and `expired` are final.
      operationId: get_agent_connect
      parameters:
        - schema:
            type: string
            pattern: ^jcp_[0-9a-f]{64}$
            example: >-
              jcp_0000000000000000000000000000000000000000000000000000000000000000
          required: true
          name: pollToken
          in: path
      responses:
        '200':
          description: Where the session stands.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentConnectPoll'
      security: []
components:
  schemas:
    AgentConnectPoll:
      type: object
      properties:
        status:
          type: string
          enum:
            - pending
            - approved
            - consumed
            - denied
            - expired
        message:
          type: string
        apiKey:
          type: string
          description: >-
            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:
          type: boolean
          description: >-
            On `approved`: true when this key replaces an earlier, never used
            key from this session, which is now revoked.
        workspaceId:
          type: string
        expiresAt:
          type: string
        stage:
          type: string
          enum:
            - awaiting_signin
            - awaiting_review
            - awaiting_payment
            - setting_up
          description: >-
            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).
        reason:
          type: string
          enum:
            - checkout_not_started
            - checkout_open
            - checkout_abandoned
            - payment_failed
          description: >-
            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).
        checkoutStartedAt:
          type: string
          nullable: true
          description: >-
            Only on `awaiting_payment`: when the human last opened checkout, or
            null.
        checkoutExpiresAt:
          type: string
          nullable: true
          description: >-
            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:
          type: string
          description: >-
            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:
          type: string
          description: >-
            Only on `awaiting_payment`: a sentence you can pass to the human as
            is, with the link and what to do.
      required:
        - status
        - message

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.