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 berulesorcalendar.GET /v1/channels/airbnb/listings/{id}/pricing?type=…— one ofmodel | standard | los | rate-plan | fees | currency | rule | calendar.GET /v1/channels/booking/availability?type=…— must berates | availability | derived-pricing.POST /v1/channels/airbnb/offerswithtypeoutsideoffer | preapproval.POST /v1/channels/booking/contentwithtypeoutside the documented list.POST /v1/channels/plumguide/pricingwithtypeoutsideseasonal | 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
- Read err.message — it lists the exact set of allowed types for the endpoint you called.
- Cross-check the per-channel doc page (e.g. /docs/channels/airbnb/pricing) for the canonical type list.
- Use lowercase with hyphens for multi-word types (e.g. `rate-plan`, not `rate_plan` or `ratePlan`).
Common gotchas
typevalues are not portable across endpoints. Booking.com'savailabilityendpoint 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.
standartinstead ofstandard) 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.
Related
- Error reference — the full table of error codes
- Using Repull from AI agents — patterns for handling errors in agent loops
- invalid_action
- invalid_params
Hit an error that isn't covered? Email hello@repull.dev with the request id from the response headers.
AI