새로운 문서를 작성 중입니다.새 문서로 이동
ClawOps Docs
API Reference

이메일 발송

POST
/v1/accounts/{accountId}/emails

이메일 한 통을 발송합니다. from 은 이 계정에 등록되고 검증(verified)된 도메인의 주소여야 합니다 — 도메인 등록·검증은 「이메일 발신 도메인」 API 로 먼저 마치십시오.

기본 사용법

{
  "from": "no-reply@example.com",
  "to": ["customer@gmail.com"],
  "subject": "주문이 접수되었습니다",
  "body": "주문번호 1024 접수되었습니다."
}

첨부

첨부는 URL 로 전달합니다. 파일 바이트를 요청 본문에 실을 수 없습니다.

{
  "from": "no-reply@example.com",
  "to": ["customer@gmail.com"],
  "subject": "영수증",
  "body": "영수증을 첨부합니다.",
  "attachmentUrl": ["https://files.example.com/receipt-1024.pdf"]
}

우리가 그 URL 을 서버에서 내려받아 메일에 붙입니다. 그래서 URL 은 인증 없이 접근 가능한 공개 주소여야 하고, 사설 대역(10.*·192.168.*·127.*)이나 클라우드 메타데이터 주소를 가리키면 400 attachment_url_not_allowed 로 거절합니다.

수신자와 크기 상한

  • 수신자는 to·cc·bcc 를 합쳐 최대 50명입니다(공급자 제약, 조정 불가). 넘으면 400 too_many_recipients.

  • 메시지 전체는 5MB 입니다. ⚠️ 이 값은 첨부를 base64 로 인코딩한 뒤 기준이라 원본 파일 크기의 약 1.37배로 계산됩니다 — 즉 원본 파일 기준 약 3.6MB 까지입니다. 넘으면 400 message_too_large.

    대부분의 거래 메일(영수증·주문확인·계약서 PDF)은 이 안에 들어갑니다. 더 큰 파일은 첨부 대신 링크로 보내 주세요 — 받는 사람의 메일 서버가 큰 첨부를 거부하는 경우가 많아(Gmail 25MB · Outlook 20MB 대) 반송으로 돌아올 가능성이 높습니다.

과금 단위는 "통"이 아니라 "수신자"입니다

⚠️ 한 통을 3명에게 보내면 3건으로 과금됩니다. to·cc·bcc 를 가리지 않습니다. 첨부가 있으면 전송 데이터량도 함께 과금됩니다.

발송 결과

이 API 의 201 은 공급자가 접수했다는 뜻이지 수신함에 도착했다는 뜻이 아닙니다. 실제 전달·반송·수신거부는 비동기로 확인되며, 그 결과를 보는 API 는 아직 제공하지 않습니다.

Authorization

BearerAuth
AuthorizationBearer <token>

API Key를 Bearer 토큰으로 전달

In: header

Path Parameters

accountId*string

계정 ID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/accounts/AC1a2b3c4d/emails" \  -H "Content-Type: application/json" \  -d '{    "from": "no-reply@example.com",    "to": [      "customer@gmail.com"    ],    "subject": "주문이 접수되었습니다",    "body": "주문번호 1024 접수되었습니다.",    "attachmentUrl": [      "https://files.example.com/receipt-1024.pdf"    ],    "idempotencyKey": "order-1024-receipt"  }'
{
  "emailId": "clx9eml00001",
  "direction": "inbound",
  "status": "sent",
  "from": "no-reply@example.com",
  "to": [
    "customer@gmail.com"
  ],
  "cc": [],
  "bcc": [],
  "suppressed": [],
  "subject": "주문이 접수되었습니다",
  "recipientCount": 1,
  "attachmentCount": 1,
  "createdAt": "2026-09-03T07:20:00.000Z",
  "failureCode": null,
  "failureMessage": null,
  "replyTo": [
    "support@example.com"
  ],
  "messageId": "CAF7n8xW1p_abc@mail.gmail.com",
  "inReplyTo": null,
  "references": [
    "CAF7n8xW1p_xyz@mail.gmail.com",
    "CAF7n8xW1p_abc@mail.gmail.com"
  ],
  "recipients": [
    "support@example.com"
  ],
  "receivedAt": "2026-09-04T05:48:00.000Z",
  "sizeBytes": 4030,
  "verdicts": {
    "spam": "PASS",
    "virus": "PASS",
    "spf": "PASS",
    "dkim": "PASS",
    "dmarc": "GRAY"
  },
  "parseStatus": "parsed"
}
{
  "error": "string",
  "code": "recipient_blocked",
  "ip": "52.79.213.41",
  "blockers": [
    {
      "number": "07012340002",
      "code": "number_not_carrier_issued",
      "message": "이용증명원은 한국AI통신이 개통한 070·대표번호만 발급됩니다."
    }
  ]
}
{
  "error": "string",
  "code": "recipient_blocked",
  "ip": "52.79.213.41",
  "blockers": [
    {
      "number": "07012340002",
      "code": "number_not_carrier_issued",
      "message": "이용증명원은 한국AI통신이 개통한 070·대표번호만 발급됩니다."
    }
  ]
}
{
  "error": "string",
  "code": "recipient_blocked",
  "ip": "52.79.213.41",
  "blockers": [
    {
      "number": "07012340002",
      "code": "number_not_carrier_issued",
      "message": "이용증명원은 한국AI통신이 개통한 070·대표번호만 발급됩니다."
    }
  ]
}
{
  "error": "string",
  "code": "recipient_blocked",
  "ip": "52.79.213.41",
  "blockers": [
    {
      "number": "07012340002",
      "code": "number_not_carrier_issued",
      "message": "이용증명원은 한국AI통신이 개통한 070·대표번호만 발급됩니다."
    }
  ]
}
{
  "error": "string",
  "code": "recipient_blocked",
  "ip": "52.79.213.41",
  "blockers": [
    {
      "number": "07012340002",
      "code": "number_not_carrier_issued",
      "message": "이용증명원은 한국AI통신이 개통한 070·대표번호만 발급됩니다."
    }
  ]
}
{
  "error": "string",
  "code": "recipient_blocked",
  "ip": "52.79.213.41",
  "blockers": [
    {
      "number": "07012340002",
      "code": "number_not_carrier_issued",
      "message": "이용증명원은 한국AI통신이 개통한 070·대표번호만 발급됩니다."
    }
  ]
}