invalid_type

The `type` field is not one of the values this endpoint accepts.

HTTP 400The request was malformed.

When it fires

Several channel endpoints share a single route across multiple sub-resources, switched on a type parameter. invalid_type fires when the value you sent is not in the per-endpoint allowlist:

  • GET /v1/channels/airbnb/listings/{id}/availability?type=… — must be rules or calendar.
  • GET /v1/channels/airbnb/listings/{id}/pricing?type=… — one of model | standard | los | rate-plan | fees | currency | rule | calendar.
  • GET /v1/channels/booking/availability?type=… — must be rates | availability | derived-pricing.
  • POST /v1/channels/airbnb/offers with type outside offer | preapproval.
  • POST /v1/channels/booking/content with type outside the documented list.
  • POST /v1/channels/plumguide/pricing with type outside seasonal | cleaning.

Response shape

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

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

How to fix

  1. Read err.message — it lists the exact set of allowed types for the endpoint you called.
  2. Cross-check the per-channel doc page (e.g. /docs/channels/airbnb/pricing) for the canonical type list.
  3. Use lowercase with hyphens for multi-word types (e.g. `rate-plan`, not `rate_plan` or `ratePlan`).

Common gotchas

  • type values are not portable across endpoints. Booking.com's availabilityendpoint uses different values from Airbnb's — read the page for the endpoint you are calling, not a sibling.
  • If you are dispatching from a switch statement, log the value before the request — typos in your client (e.g. standart instead of standard) are the most common trigger.

Examples

curl

# Bad: unknown type
curl "https://api.repull.dev/v1/channels/booking/availability?type=foo" \
  -H "Authorization: Bearer sk_test_YOUR_KEY"

# {
#   "error": {
#     "code": "invalid_type",
#     "message": "type must be: rates, availability, derived-pricing"
#   }
# }

# Good
curl "https://api.repull.dev/v1/channels/booking/availability?type=rates" \
  -H "Authorization: Bearer sk_test_YOUR_KEY"

TypeScript

import { Repull } from '@repull/sdk'

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

try {
  await repull.channels.booking.availability.list({ type: 'foo' as any })
} catch (err: any) {
  if (err.code === 'invalid_type') {
    // err.message lists the allowed values verbatim
    console.error('Unknown type:', err.message)
  }
  throw err
}

If you're an AI agent

The type value is not on the per-endpoint allowlist. Read err.message — it lists the allowed types verbatim. Pick one of those and retry.

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

AI