401 Unauthorized when accessing REST API (rest.runpod.io/v1) despite API key ALL permissions
Hey, everyone! I need some help, I know its AI-generated in terms of formatting but this is my problem,
We're getting a 401 Unauthorized error when using the REST API (rest.runpod.io/v1) to manage serverless endpoints, even though our API key has Read/Write permissions enabled.
What we're trying to do:
Update workersMin and workersMax for a serverless endpoint via the REST API
Using: PATCH /endpoints/{endpointId} or POST /endpoints/{endpointId}/update
What works:
The same API key works with api.runpod.ai/v2 (Serverless API) for submitting jobs
API key has "All" or "Read/Write" permissions enabled in the dashboard
What doesn't work:
GET https://rest.runpod.io/v1/endpoints/{endpointId} → 401 Unauthorized
PATCH https://rest.runpod.io/v1/endpoints/{endpointId} → 401 Unauthorized
POST https://rest.runpod.io/v1/endpoints/{endpointId}/update → 401 Unauthorized
Request format:
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
response = requests.get("https://rest.runpod.io/v1/endpoints/{endpointId}", headers=headers)
Returns: 401 Unauthorized
Questions:
Does rest.runpod.io/v1 require separate permissions from api.runpod.ai?
Is REST API access included in the "All" permission level, or does it need explicit enablement?
Are there account-tier restrictions for REST API access?
Is there a different authentication method for the REST API?
We need to programmatically adjust worker counts for auto-scaling. Any guidance is appreciated.
Thanks!
5 Replies
you are not sending brackets to the endpoint right?
Unknown User•4d ago
Message Not Public
Sign In & Join Server To View
Is this for an asset owned by a team?
Or, more of an edge case - is your account email verifide :thinkMan:
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View