session_expired

The Connect session lifetime has elapsed. Start a new session.

HTTP 410The resource has expired and is no longer available.

When it fires

You called a Connect session endpoint with an id whose lifetime has elapsed. Connect sessions are short-lived on purpose so a stale link cannot connect an account hours later.

Response shape

Every Repull error follows the same envelope. The code is stable and safe to switch on.

{
  "error": {
    "code": "session_expired",
    "message": "<human-readable explanation of what went wrong>",
    "docs_url": "https://repull.dev/docs/errors/session_expired"
  }
}

How to fix

  1. Start a fresh session: `POST /v1/connect/{provider}` with the same `redirectUrl`.
  2. Hand the new `url` to the user immediately — do not store it for later.
  3. On the callback, complete the session right away rather than queuing it.

Examples

curl

# Start a new session
curl -X POST https://api.repull.dev/v1/connect/airbnb \
  -H "Authorization: Bearer sk_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"redirectUrl": "https://your-app.com/callback"}'

# {
#   "url": "https://connect.repull.dev/...",
#   "sessionId": "cs_01HXYZ...",
#   "provider": "airbnb",
#   "expiresAt": "2026-05-02T13:34:56Z"
# }

TypeScript

import { Repull } from '@repull/sdk'

const repull = new Repull({ apiKey: process.env.REPULL_API_KEY! })

// Session endpoints take the session id as the capability token (no API key).
const res = await fetch(
  `https://api.repull.dev/v1/connect/sessions/${sessionId}/select-provider`,
  {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ provider: 'airbnb' }),
  },
)

if (!res.ok) {
  const { error } = await res.json()
  if (error.code === 'session_expired') {
    // Mint a new session and redirect the user
    const fresh = await repull.connect.airbnb.create({
      redirectUrl: 'https://your-app.com/callback',
    })
    return { redirectTo: fresh.url }
  }
  throw new Error(`${error.code}: ${error.message}`)
}

If you're an AI agent

The Connect session lifetime ran out. Mint a new session with POST /v1/connect/{provider} and redirect the user to the fresh URL. Do not retry the original session id.

Hit an error that isn't covered? Email hello@repull.dev with the request id from the response headers.

AI