invalid_action
The `action` field is not one of the values this endpoint accepts.
HTTP 400The request was malformed.
When it fires
Channel endpoints that bundle several related operations behind a single route use an action field in the body or query string to pick the operation. invalid_action fires when the value you sent is not on the per-endpoint allowlist:
POST /v1/channels/airbnb/messaging/{threadId}/messages/{messageId}withactionoutsideedit | unsend | read | react.POST /v1/channels/airbnb/reservations/{code}withactionoutsideaccept | decline | cancel.POST /v1/channels/booking/setupwith anactionoutside the documented setup steps.POST /v1/channels/plumguide/availabilitywithactionoutsideblock | unblock.
Response shape
Every Repull error follows the same envelope. The code is stable and safe to switch on.
{
"error": {
"code": "invalid_action",
"message": "<human-readable explanation of what went wrong>",
"docs_url": "https://repull.dev/docs/errors/invalid_action"
}
}How to fix
- Read err.message — it lists the exact set of allowed actions for the endpoint you called.
- Check the corresponding channel doc page (e.g. /docs/channels/airbnb/messaging) for the canonical action list.
- Use lowercase, no whitespace, exact spelling — the allowlist is case-sensitive.
- If your dispatch helper is computing the action dynamically, log the value just before the request to catch typos at the source.
Common gotchas
- Different channels use different action vocabularies for the same business operation.
cancelon Airbnb maps tocancel-reservationon Booking.com — see the channel page before mapping actions across providers. invalid_actionmeans the value was unrecognised. If the value is recognised but not allowed in the resource's current state (e.g. cancelling a reservation that's already cancelled), you will see invalid_state instead.
Examples
curl
# Bad: unknown action
curl -X POST https://api.repull.dev/v1/channels/airbnb/reservations/HMABCD1234 \
-H "Authorization: Bearer sk_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"action": "approve"}'
# {
# "error": {
# "code": "invalid_action",
# "message": "action must be: accept, decline, cancel"
# }
# }
# Good
curl -X POST https://api.repull.dev/v1/channels/airbnb/reservations/HMABCD1234 \
-H "Authorization: Bearer sk_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"action": "accept"}'TypeScript
import { Repull } from '@repull/sdk'
const repull = new Repull({ apiKey: process.env.REPULL_KEY! })
try {
await repull.channels.airbnb.reservations.act('HMABCD1234', { action: 'approve' as any })
} catch (err: any) {
if (err.code === 'invalid_action') {
// err.message lists the allowed actions for this endpoint
console.error('Unknown action:', err.message)
}
throw err
}If you're an AI agent
The action value is not on the allowlist. Read err.message — it lists the allowed actions 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_type
- invalid_state
Hit an error that isn't covered? Email hello@repull.dev with the request id from the response headers.
AI