invalid_type
The `type` field is not one of the values this endpoint accepts.
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:
PUT /v1/channels/booking/availabilitywith bodytypeoutsiderates | availability | derived-pricing.GET /v1/channels/booking/reservations?type=…outsidenew | modified | details.GETorPOST /v1/channels/booking/contentwithtypeoutsidephotos | descriptions | amenities | facilities | policies.POST /v1/channels/airbnb/offerswithtypeoutsideoffer | preapproval.GET /v1/channels/airbnb/listings/{id}/quality?type=…and/settings?type=….PUT /v1/channels/plumguide/pricingwithtypeoutsideseasonal | cleaning.
The Airbnb calendar writes are different. On PUT /v1/channels/airbnb/listings/{id}/pricing and PUT /v1/channels/airbnb/listings/{id}/availability, type is a field in the JSON body, validated with the rest of the body before anything reaches Airbnb. An unknown value there returns 422 invalid_params with field: "type", not invalid_type. Pricing accepts model | standard | los | rate-plan | fees | currency | rule | calendar; availability accepts rules | calendar.
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 error.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 (the property must be connected to this workspace)
curl -X PUT "https://api.repull.dev/v1/channels/booking/availability" \
-H "Authorization: Bearer sk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"type": "foo", "property_id": 1234567, "updates": [{"roomId": "123456701", "rateId": "98765", "dateRange": {"start": "2026-07-01", "end": "2026-07-03"}, "price": 180, "currency": "USD"}]}'
# {
# "error": {
# "code": "invalid_type",
# "message": "type must be: rates, availability, derived-pricing"
# }
# }
# Good
curl -X PUT "https://api.repull.dev/v1/channels/booking/availability" \
-H "Authorization: Bearer sk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"type": "rates", "property_id": 1234567, "updates": [{"roomId": "123456701", "rateId": "98765", "dateRange": {"start": "2026-07-01", "end": "2026-07-03"}, "price": 180, "currency": "USD"}]}'TypeScript
// The SDK has no Booking.com availability method, so call the endpoint directly.
const res = await fetch('https://api.repull.dev/v1/channels/booking/availability', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.REPULL_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ type: 'foo', property_id: 1234567, updates }),
})
if (!res.ok) {
const { error } = await res.json()
if (error.code === 'invalid_type') {
// error.message lists the allowed values verbatim
console.error('Unknown type:', error.message)
}
throw new Error(`${error.code}: ${error.message}`)
}If you're an AI agent
The type value is not on the per-endpoint allowlist. Read error.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.