Skip to content

Errors

The Pulls API uses conventional HTTP status codes and returns structured error responses.

CodeMeaning
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Insufficient permissions
404Not Found - Resource doesn’t exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Something went wrong

All errors follow a consistent structure:

{
"_tag": "ErrorType",
"message": "Human-readable description",
...additional fields
}

The _tag field identifies the error type for programmatic handling.

{
"_tag": "Unauthorized",
"message": "Invalid or missing API key"
}

Causes:

  • Missing Authorization header
  • Invalid API key
  • Revoked or expired key

Fix: Check your API key is valid and correctly formatted.

{
"_tag": "CardNotFound",
"message": "Card not found",
"cardId": "invalid-id-123"
}

Causes:

  • Card ID doesn’t exist
  • Typo in card ID
  • Card from unsupported TCG

Fix: Verify the card ID using the search endpoint first.

{
"_tag": "RateLimitExceeded",
"message": "Rate limit exceeded. Retry after 60 seconds.",
"retryAfter": 60
}

Causes:

  • Exceeded daily request quota
  • Exceeded per-minute limit

Fix: Wait for the retryAfter period or upgrade your plan.

{
"_tag": "ValidationError",
"message": "Invalid request parameters",
"errors": [
{
"path": ["query", "limit"],
"message": "Expected number, got string"
}
]
}

Causes:

  • Invalid parameter types
  • Missing required fields
  • Values out of range

Fix: Check the API reference for correct parameter types and constraints.

import { PullsAPI, CardNotFoundError } from '@pulls/sdk'
try {
const card = await pulls.cards.get('sv7-001')
} catch (error) {
if (error instanceof CardNotFoundError) {
console.log(`Card ${error.cardId} not found`)
} else {
throw error
}
}
import { Effect } from 'effect'
import { CardNotFoundError } from '@pulls/sdk'
const program = pulls.cards.get('sv7-001').pipe(
Effect.catchTag('CardNotFound', (error) =>
Effect.succeed({ fallback: true, cardId: error.cardId })
)
)

Include request IDs when contacting support:

X-Request-Id: req_abc123xyz

Every response includes this header for tracking.