<p>Most probably your user <code>arn:aws:XXX::XXXXXXXXXXXX:user/ABC-DEF-SNS</code> does not have the required permissions to the <code>sns:Publish</code> API.</p>

<p>You can check using the IAM Policy Simulator at <a href="https://policysim.aws.amazon.com/" rel="nofollow noreferrer">https://policysim.aws.amazon.com/</a></p>

<p><sup>using policy simulator is explained in depth here <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_testing-policies.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_testing-policies.html</a></sup></p>

CC BY-SA 3.0
2018-01-02T12:05:42.743Z
2018-01-02T12:05:42.743Z
Evgeny Zislis
<p>I am using the following command. Getting Authorization error.</p>

<pre><code>aws sns publish --phone-number +91XXXXXXXXXX --message hello

An error occurred (AuthorizationError) when calling the Publish operation: User: arn:aws:XXX::XXXXXXXXXXXX:user/ABC-DEF-SNS is not authorized to perform: SNS:Publish on resource: +91XXXXXXXXXX
</code></pre>

<p>Other related sns commands are working. I can also able to send sms through a topic to a subscribed number.</p>

CC BY-SA 3.0
2018-01-03T13:52:09.457Z
I'm voting to close this question as off-topic because this is a question for AWS support and it's in no way related to devops.
Tensibai
<aws-cli>
How to send sms to a phone number using aws sns cli?
Saikat Kundu Chowdhury
# How to send sms to a phone number using aws sns cli?

(Asked by: username_0 on 2018-01-01)

I am using the following command. Getting Authorization error.
aws sns publish --phone-number +91XXXXXXXXXX --message hello

An error occurred (AuthorizationError) when calling the Publish operation: User: arn:aws:XXX::XXXXXXXXXXXX:user/ABC-DEF-SNS is not authorized to perform: SNS:Publish on resource: +91XXXXXXXXXX

Other related sns commands are working. I can also able to send sms through a topic to a subscribed number.

**Tags:** aws-cli

> **Comments:**
> **username_1**: I'm voting to close this question as off-topic because this is a question for AWS support and it's in no way related to devops.  

---

## 1 answers

### Answer by username_2 on 2018-01-02. Score: 1 | Accepted answer

Most probably your user `arn:aws:XXX::XXXXXXXXXXXX:user/ABC-DEF-SNS` does not have the required permissions to the `sns:Publish` API.

You can check using the IAM Policy Simulator at <https://policysim.aws.amazon.com/>

using policy simulator is explained in depth here <https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_testing-policies.html>


---

