All Products
Search
Document Center

Direct Mail:Control resource access with RAM users

Last Updated:Jun 08, 2026

In a collaborative environment, create RAM users and assign them permission policies scoped to Direct Mail resources. This separates administrative duties, reduces the risk of unauthorized access, and keeps your primary account credentials off shared systems.

Grant Direct Mail permissions to a RAM user

Prerequisites

Before you begin, ensure that you have:

Grant permissions

Grant permissions to the RAM user using one of the following methods:

  • Method 1 — Attach a managed policy to grant access to all Direct Mail resources. Choose this method when the RAM user needs broad access.

  • Method 2 — Create a custom policy scoped to specific Direct Mail APIs. Choose this method when you need fine-grained, least-privilege access.

Method 1: Use a managed policy

Attach one of the following managed policies to the RAM user:

Policy

Access level

AliyunDirectMailFullAccess

Full management access to all Direct Mail resources and APIs

AliyunDirectMailReadOnlyAccess

Read-only access to Direct Mail resources

image

image

Method 2: Create a custom policy

  1. Go to the visual editor to create a permission policy.

daaca4387cfc28c02b8bed846c026d2e.png

Alternatively, create a custom policy using the JSON editor. The following policy grants access to all Direct Mail actions:

    {
        "Version": "1",
        "Statement": [
            {
                "Action": "dm:*",
                "Resource": "*",
                "Effect": "Allow"
            }
        ]
    }

To restrict access to a single API, specify it in the Action field. The following example allows only the SingleSendMail operation:

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "dm:SingleSendMail"
                ],
                "Resource": [
                    "acs:dm:*:*:*"
                ]
            }
        ]
    }

For policy syntax details, see Basic elements of a RAM policy.

  1. Attach the custom policy to the RAM user.

Frequently asked questions

Error: code: 400, The user is not authorized to operate on the specified resource.

The RAM user lacks the required permissions. Use your primary account to grant the RAM user the appropriate Direct Mail permissions — either the managed policy for all resources or a custom policy for the specific API. Also check whether any other custom policies are denying access.

In the console, this error appears as "The user is not authorized to operate on the specified resource."

image