How do I troubleshoot HTTP 403 errors from API Gateway?
Key Takeaways
The video demonstrates how to troubleshoot HTTP 403 errors from API Gateway using tools like curl, Postman, and the AWS Management Console, covering topics such as IAM authorization, resource policies, and stage names.
Full Transcript
[music] Hello, I'm Sahil, a cloud support engineer here at the AWS office in Bangalore. Today I'm going to show you how to troubleshoot HTTP 403 forbidden errors that occur when calling APIs hosted on Amazon API gateway. Let's get started. When a client can't access a valid URL, you get an HTTP 403 forbidden response code, the server understands the request but can't fulfill it because of the client side issues. API gateway can return 403 forbidden errors for various reasons. Let's take a look at how to identify and troubleshoot these 403 forbidden errors. For this demonstration, let's say that we have a regional rest API with a basic as Lambda integrations. When we try to invoke the API from an Amazon Elastic Compute Cloud instance which is having a public internet access, we get the 403 error. To identify the root cause of the issue when invoking the API through the curl command, we first have to identify the following error characteristics. Error response header X Amazon error type error message error status code in the curl commands response. We can see that we are getting the error access denied exception in the response header X Amazon error type with the status code as 403 forbidden. The error message appears as user anonymous is not authorized to perform execute API invoke action on my API gateway source with an explicit deny. The error message could be because of either the caller isn't authorized to access an API that uses IM authorization or the API has an attached resource policy that doesn't explicitly allow the caller to invoke the API. For more information, see IM authentication and the resource policy. The first root cause is because of AWS identity and access management authorization. In this case, I don't have IM authorization attached in my method request for my API. So, this root cause isn't applicable. Now, let's look at the second root cause where my resource policy is denying access to the API. As we can see, I have a resource policy that denies all invocation on my resource. To resolve this issue, allow access to invoke this API in its resource policy. Make sure that you redeploy the API whenever there are any changes in the resource policy. Now, let's make a request to the rest API endpoint from Amazon EC2 instance. The request returns a 200 okay status code with a desired response. Now let's talk about how to troubleshoot the 403 forbidden error and find the response headers when invoking the API from any browser or third party API testing tools such as postman. For this demonstration we have a regional rest API which has a basic AWS Lambda integration. When we try to invoke the API from a browser, we get the error message forbiddenness. Let's take a look at the response headers for this request. Right click anywhere on the browser web page. Select inspect. Navigate to the network tab. As we can see, we are getting the response headers X Amazon error type forbidden exception when we invoke the rest API. Let's try invoking the API through the third party API testing tool Postman. When invoking the API using the same API gateway invocation URL, we get the error message forbidden. Let's check the response headers in the headers tab. We can see that we are getting the X Amazon error type forbidden exception error response header. The error message could be because of multiple reasons. One of the reasons is the caller request URL includes a stage that doesn't exist. This reason means that I'm invoking the API with an incorrect stage name for my API. Let's take a look at my API gateway stage. I have deployed the API with a stage name prod while I'm invoking the API with a stage name which doesn't exist in my API. Let's invoke the API with the correct stage name from the browser and Postman. When we use the correct stage invocation URL, we can see successful API invocation and request returning 200 okay status with the desired response. For more information about troubleshooting 403 forbidden errors, refer to the knowledge center article linked in the video description below. And now you know how to troubleshoot HTTP 403 forbidden errors that occur when calling APIs hosted on Amazon API gateway. Thanks for watching and happy cloud computing from all of us here at AWS. [music]
Original Description
For more details on this topic, visit the AWS Knowledge Center on AWS re:Post and read the full article associated with this video: https://repost.aws/knowledge-center/api-gateway-troubleshoot-403-forbidden
The AWS Knowledge Center contains trusted, expert-reviewed answers to frequently asked questions across AWS services — including EC2, S3, IAM, Lambda, Bedrock, and more.
Sahil shows you how to troubleshoot HTTP 403 forbidden errors that occur when calling APIs hosted on Amazon API Gateway.
0:00 Introduction
0:21 403 Forbidden Errors
0:47 API Gateway Setup
1:25 Error Characteristics
2:10 Root Causes
2:53 Resolving Issues
3:19 Browser Troubleshooting
4:12 Common Reasons
4:43 Correct API Invocation
5:15 Closing
Subscribe to AWS: https://go.aws/subscribe
Create a free AWS account: https://go.aws/signup
Try AWS for free: https://go.aws/free
Connect with an expert: https://go.aws/contact
Explore more: https://go.aws/more
Next steps:
Explore on AWS in Analyst Research: https://go.aws/reports
Discover, deploy, and manage software that runs on AWS: https://go.aws/marketplace
Join the AWS Partner Network: https://go.aws/partners
Learn more on how Amazon builds and operates software: https://go.aws/library
Do you have technical AWS questions?
Ask the community of experts on AWS re:Post: https://go.aws/3lPaoPb
Why AWS?
Amazon Web Services is the world’s most comprehensive and broadly adopted cloud, enabling customers to build anything they can imagine. We offer the greatest choice of innovative cloud capabilities and expertise, on the most extensive global infrastructure with industry-leading security, reliability, and performance.
#AWS #AmazonWebServices #CloudComputing
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Amazon Web Services · Amazon Web Services · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Agentic AI Design Patterns Introduction and walkthrough | Amazon Web Services
Amazon Web Services
Galileo on modernizing on banking infrastructure | Amazon Web Services
Amazon Web Services
Alliander Speeds Innovation and Energy Transition Using AWS | Amazon Web Services
Amazon Web Services
AWS and Scuderia Ferrari HP streamline F1 power unit assembly | Amazon Web Services
Amazon Web Services
How AWS machine learning supports Scuderia Ferrari HP pit stops | Amazon Web Services
Amazon Web Services
Nasdaq Builds Market Infrastructure of the Future with AWS | Amazon Web Services
Amazon Web Services
AWS Security Hub Exposure Findings | Amazon Web Services
Amazon Web Services
How do I use Session Manager port forwarding to connect to my EC2 instance through RDP?
Amazon Web Services
How do I extend an EBS volume with LVM partitions?
Amazon Web Services
AWS Graviton makes it easy to optimize performance, cost, and sustainability | Amazon Web Services
Amazon Web Services
Run Cloud Adoption Framework workshops with Miro | Amazon Web Services
Amazon Web Services
Getting Started with AWS Cost Optimization Hub | Amazon Web Services
Amazon Web Services
Why did my Amazon SQS messages get sent to a dead-letter queue?
Amazon Web Services
Declarative Policies for EC2 | Amazon Web Services
Amazon Web Services
How do I troubleshoot IAM permission issues for the Billing and Cost Management console?
Amazon Web Services
Integrity at Scale: Inside the Flo Health Mission | Amazon Web Services
Amazon Web Services
Fueling Success: Small shifts, powerful performance | Amazon Web Services
Amazon Web Services
WEX enhances customer experience with AI-powered chatbot | Amazon Web Services
Amazon Web Services
Accelerate troubleshooting with Amazon CloudWatch investigations | Amazon Web Services
Amazon Web Services
Why is my Windows WorkSpace stuck in the starting, rebooting, or stopping status?
Amazon Web Services
Telemetry Pipelines for AI | Amazon Web Services
Amazon Web Services
Getting Control over Security and Observability Data | Amazon Web Services
Amazon Web Services
The Problem with Telemetry Data Volume | Amazon Web Services
Amazon Web Services
Telemetry Pipelines on AWS | Amazon Web Services
Amazon Web Services
What are Telemetry Pipelines? | Amazon Web Services
Amazon Web Services
Using AI for RegEx on Telemetry Pipelines | Amazon Web Services
Amazon Web Services
Multi-Session Support in the AWS Console | Amazon Web Services
Amazon Web Services
How CloudHedge delivers assessment with AWS ISV Tooling Program at no cost?
Amazon Web Services
How customers speed up migration and modernization to AWS with CloudHedge | Amazon Web Services
Amazon Web Services
Chaos Experiment with Amazon ElastiCache | Amazon Web Services
Amazon Web Services
Amazon S3 Access Points: Easily manage access for shared datasets on S3 | Amazon Web Services
Amazon Web Services
ElastiCache Valkey 8.0 - Savings and Efficiency | Amazon Web Services
Amazon Web Services
Pennymac scales document processing with AWS | Amazon Web Services
Amazon Web Services
AWS | Next Level Innovation | Amazon Web Services
Amazon Web Services
Driving Cloud Innovation: Mindtickle's Partnership with AWS Enterprise Support | Amazon Web Services
Amazon Web Services
A Leader's Edge from Executive Insights | Amazon Web Services
Amazon Web Services
How do I create a custom Amazon WorkSpaces image?
Amazon Web Services
Charles Leclerc tests his AI-generated race track | Amazon Web Services
Amazon Web Services
Redington Scales India’s Cloud Access with AWS Partnership | Amazon Web Services
Amazon Web Services
How do I prevent the resources in my CloudFormation stack from getting deleted or updated?
Amazon Web Services
How do I troubleshoot authentication errors when I use RDP to connect to an EC2 Windows instance?
Amazon Web Services
Exploring the Possibilities of Digital Twin & AI at the Edge | Amazon Web Services
Amazon Web Services
Exploring the Possibilities of Digital Twin & AI at the Edge | Amazon Web Services
Amazon Web Services
AWS at the FORMULA 1 AWS GRAN PREMIO DELL'EMILIA-ROMAGNA 2025 | Amazon Web Services
Amazon Web Services
What's new in RCPs | Amazon Web Services
Amazon Web Services
API Caching using Amazon ElastiCache | Amazon Web Services
Amazon Web Services
Pendula: Amazon Nova Customer Testimonial | Amazon Web Services
Amazon Web Services
InDebted : Amazon Nova Customer Testimonial | Amazon Web Services
Amazon Web Services
Amazon DynamoDB global tables with multi-Region strong consistency | Amazon Web Services
Amazon Web Services
Siemens Mobility uses AWS to operate securely, efficiently on a global scale | Amazon Web Services
Amazon Web Services
How do I reuse a knowledge base session in Amazon Bedrock?
Amazon Web Services
EP5: MBZUAI, CMU : Causal AI, Answering The “Why“ and “What if“ Questions | AWS for AI Podcast
Amazon Web Services
Hema scales time to market developing a data mesh on AWS (Technical) - Cloud Adventures
Amazon Web Services
Hema scales time to market developing a data mesh on AWS (Business) - Cloud Adventures
Amazon Web Services
How Langfuse Scaled Their AI Platform with AWS: From Open-Source to Enterprise | Amazon Web Services
Amazon Web Services
SLMs and LLMs: What’s the Difference? | Amazon Web Services
Amazon Web Services
SLMs and LLMs: When to use them? | Amazon Web Services
Amazon Web Services
SLMs on CPU | Amazon Web Services
Amazon Web Services
Intelligent Model Routing | Amazon Web Services
Amazon Web Services
SLMs, LLMs, and Model Routing in Agents | Amazon Web Services
Amazon Web Services
More on: API Design
View skill →Related Reads
📰
📰
📰
📰
We Kept Writing More Terraform to Fix Terraform’s Problems. There’s a Simpler Way.
Medium · DevOps
Apple Just Built Its Own Docker Alternative — Apple Container 1.0
Medium · DevOps
Your Cron Job Works. That’s Not the Same as Surviving Cron.
Medium · DevOps
Your Cron Job Works. That's Not the Same as Surviving Cron
Dev.to · Anguishe
Chapters (10)
Introduction
0:21
403 Forbidden Errors
0:47
API Gateway Setup
1:25
Error Characteristics
2:10
Root Causes
2:53
Resolving Issues
3:19
Browser Troubleshooting
4:12
Common Reasons
4:43
Correct API Invocation
5:15
Closing
🎓
Tutor Explanation
DeepCamp AI