Policies

Create a policy

Creates a policy for your application. Policies define message limits, spam detection settings, and linked rules for Nylas Agent Accounts. The application_id and organization_id are derived from your API key, so you don't need to include them in the request body — they are read-only.

post/v3/policies

Request body

namestring required

A human-readable name for the policy.

rulesstring[]

Rule IDs to link to this policy.

Example request

{
  "name": "Standard Agent Account Policy",
  "limits": {
    "limit_attachment_size_limit": 26214400,
    "limit_attachment_count_limit": 20,
    "limit_attachment_allowed_types": [
      "image/png",
      "application/pdf"
    ],
    "limit_size_total_mime": 31457280,
    "limit_storage_total": 10737418240,
    "limit_count_daily_message_received": 1000,
    "limit_count_daily_email_sent": 1000,
    "limit_inbox_retention_period": 365,
    "limit_spam_retention_period": 30
  },
  "rules": [
    "c1d2e3f4-5678-4abc-9def-0123456789ab"
  ],
  "spam_detection": {
    "use_list_dnsbl": true,
    "use_header_anomaly_detection": true,
    "spam_sensitivity": 1.5
  }
}

Response

OK

request_idstring

ID of the request.

Example response

{
  "request_id": "5fa64c92-e840-4357-86b9-2aa364d35b88",
  "data": {
    "id": "b1c2d3e4-5678-4abc-9def-0123456789ab",
    "name": "Standard Agent Account Policy",
    "application_id": "ad410018-d306-43f9-8361-fa5d7b2172e0",
    "organization_id": "org-abc123",
    "limits": {
      "limit_attachment_size_limit": 26214400,
      "limit_attachment_count_limit": 20,
      "limit_attachment_allowed_types": [
        "image/png",
        "image/jpeg",
        "application/pdf"
      ],
      "limit_size_total_mime": 31457280,
      "limit_storage_total": 10737418240,
      "limit_count_daily_message_received": 1000,
      "limit_count_daily_email_sent": 1000,
      "limit_inbox_retention_period": 365,
      "limit_spam_retention_period": 30
    },
    "rules": [
      "c1d2e3f4-5678-4abc-9def-0123456789ab"
    ],
    "spam_detection": {
      "use_list_dnsbl": true,
      "use_header_anomaly_detection": true,
      "spam_sensitivity": 1.5
    },
    "created_at": 1742932766,
    "updated_at": 1742932766
  }
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.