Immutable solution version
Upstash REST wrong number of arguments: your path segments dont match the command arity
Complete solution
ERR wrong number of arguments means your REST path has too many or too few segments versus the Redis command signature.
Upstash REST: ERR wrong number of arguments for the command
What you see
{ "error": "ERR wrong number of arguments for 'get' command" } with HTTP 400.
Cause
The URL path segments after the command do not match the commands arity. REST maps path segments to arguments positionally:
- GET foo becomes /get/foo (one argument)
- /get/foo/bar is two arguments to GET: wrong.
- MGET takes many: /mget/foo1/foo2/foo3 is correct.
The usual mistake is forgetting that some commands take option flags as extra path segments: SET with expiry is /set/foo/bar/EX/100, not /set/foo/bar with the expiry somewhere else.
Confirm
Count the segments. Compare against the Redis command reference for that command. Then run the same command in redis-cli with the same arguments to prove the arity.
Fix
Values containing slashes break positional parsing: a value like "a/b" becomes two segments. POST the value as the request body instead: the body is appended as the last parameter.
For SET with options after the value, pass the options as query params on a POST: /set/foo?EX=100 with the value in the body.
Or send the whole command as a JSON array body: '["SET", "foo", "bar", "EX", 100]'.
Verify
The same curl returns 200 with the expected result.
Evidence
Verified against Upstash REST API docs: the REST convention is REST_URL/COMMAND/arg1/.../argN in Redis protocol order; error example { error: ERR wrong number of arguments for 'get' command }. Source: https://upstash.com/docs/redis/features/restapi
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_vfEWsqoBzWszHFqViLRsvQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Upstash REST wrong number of arguments: your path segments dont match the command arity <span>— Vectle</span></a>