---
title: "Poll a delegated approval connection"
method: POST
path: "/api/tools/poll_agent_connection"
tags: ["Agent Approval"]
---

# Poll a delegated approval connection

`POST /api/tools/poll_agent_connection`

## Request

- Base URL: `https://spoonjoy.app`
- URL: `https://spoonjoy.app/api/tools/poll_agent_connection`
- Auth: none required

## Request body

- AgentPollRequest
  - `deviceCode` string, required
  - `tokenName` string

## Response `200`

Pending or approved delegated connection

- AgentPollEnvelope
  - `ok` unknown, required
  - `data` AgentPollData, required
    - `status` 'pending' | 'approved' | 'denied' | 'expired' | 'claimed', required
    - `expiresAt` string, date-time, required
    - `authorizationUrl` string, uri
    - `verificationUri` string, uri
    - `verificationUriComplete` string, uri
    - `userCode` string
    - `token` string
    - `credential` AgentCredentialMetadata
      - `id` string, required
      - `name` string, required
      - `tokenPrefix` string, required
      - `scopes` string[], required
      - `createdAt` string, date-time, required
      - `expiresAt` string, date-time, nullable, required
    - `message` string, required

## Other responses

- `400`: Tool error
- `429`: Rate limited. This is the generic Spoonjoy rate-limit shape, not a standard OAuth error.

---

[API](https://skmtc.dev/spoonjoy/apis/spoonjoy-api.md) · [All operations](https://skmtc.dev/spoonjoy/apis/spoonjoy-api/llms.txt) · [OpenAPI document](https://skmtc.dev/spoonjoy/apis/spoonjoy-api/revisions/b96eb5d4697d?raw)
