> ## Documentation Index
> Fetch the complete documentation index at: https://docs.didit.me/llms.txt
> Use this file to discover all available pages before exploring further.

# 결정 이메일 미리보기 API: 승인 및 거부 이메일

> Didit의 결정 이메일 미리보기로 세션 상태를 바꾸기 전에 사용자가 받을 승인·거부 이메일의 수신자, 발신자, 언어를 확인하세요.



결정 이메일 미리보기 프롬프트
        프롬프트를 클립보드에 복사



      
      

\<pre>

\`Preview the Approved or Declined email a Didit session sends the person, then confirm the decision so exactly that email goes out.

Endpoint:
POST https://verification.didit.me/v3/session/{session_id}/decision-email-preview/

Authentication:
x-api-key (client API key) or a user-auth token. Privilege: write:sessions. A scoped API key needs write access to decisions.

Path parameter:
\- session_id (UUID): KYC or KYB; Didit resolves it against both session types.

Request body:
\- new_status (string, required): "Approved" or "Declined".
\- email_language (string, optional, default "en"): language of the email. A language that is not offered falls back to English.

The session's current status must be one of: Approved, Declined, In Review, Kyc Expired, Abandoned, Resubmitted.

Previewing changes nothing and sends nothing.

Response (200, Cache-Control: no-store):
\- recipient: the person's own address (the one they verified in the flow, else the one in contact_details). Empty string when none is known.
\- recipient_source: "email_verification", "contact_details", or "" when there is no address.
\- sender, sender_name, sender_email: the From header and its parts.
\- sender_kind: "customer" (your verified sender domain) or "didit" (Didit's sender).
\- subject, html: the email exactly as sent. Render html in a sandboxed frame.
\- language: the language actually used.
\- will_be_sent (boolean) and not_sent_reason: null, "status_unchanged", "notification_emails_disabled", "no_recipient" or "sandbox".
\- preview_token: receipt for this exact email, valid 15 minutes. Empty when there is no recipient.

Confirm with PATCH https://verification.didit.me/v3/session/{session_id}/update-status/:
\{
"new_status": "<same new_status>",
"send_email": true,
"email_address": "<recipient>",
"email_language": "<language>",
"email_preview_token": "<preview_token>"
}
If the recipient, language, session status, sender or email changed since the preview, or the receipt is older than 15 minutes, update-status returns 409 { "detail": "This email preview changed or expired. Preview the message again before confirming." } and changes nothing. Preview again and confirm with the new receipt.

curl example:
curl -X POST https://verification.didit.me/v3/session/<SESSION_ID>/decision-email-preview/ \
-H "x-api-key: <API_KEY>" \
-H "Content-Type: application/json" \
-d '{ "new_status": "Approved", "email_language": "en" }'

Failure modes:
\- 400: the session is not in an accepted status ({ "detail": "Only sessions with status ... can be updated. Current status: ..." }), or new_status is missing or invalid.
\- 401: the scoped API key has expired.
\- 403: missing credentials (a wrong, revoked or expired key gets 401), the caller lacks write:sessions, a scoped key lacks decisions write, or the session belongs to another application ({ "detail": "You do not have permission to perform this action." }).
\- 404: { "detail": "Not found." } when no session with this session_id exists.

For end-to-end Didit integration, paste in the full prompt at /integration/integration-prompt.`

\</pre>



      
      

붙여넣을 곳

미리보기는 아무것도 변경하지 않으며 이메일도 발송하지 않습니다.
응답에는 `Approved` 또는 `Declined`로 세션을 설정하고 `send_email: true`를 지정했을 때 수신자가 받게 될 이메일이 그대로 표시됩니다.
또한 누가 이메일을 받는지, 누가 발신하는지, 그리고 변경을 확인했을 때 실제로 발송되는지 여부도 알려 줍니다.## 이메일 수신자이메일은 사용자 본인의 주소로 발송됩니다. 흐름의 이메일 인증 단계에서 확인된 주소이며, 그런 단계가 없으면 세션을 생성할 때 `contact_details`에 입력한 주소입니다.
`recipient_source`는 어느 주소가 적용되었는지 알려 줍니다(`email_verification` 또는 `contact_details`).
세션에 사용자의 주소가 없으면 `recipient`, `recipient_source`, `preview_token`은 빈 문자열이 되며, 이메일은 발송할 수 없습니다.[화이트 라벨 구성](https://docs.didit.me/ko/console/white-label.md)이 적용되면(`sender_kind: customer`) 이메일은 애플리케이션에서 인증된 발신 도메인에서 발송되고, 그렇지 않으면(`sender_kind: didit`) Didit의 발신자로부터 발송됩니다.## 이메일 발송 여부`send_email: true`로 변경을 확인했을 때 이메일이 발송되면 `will_be_sent`는 `true`입니다.
`false`이면 `not_sent_reason`에 그 이유가 표시됩니다.| `not_sent_reason` | 의미 |
| - | - |
| `status_unchanged` | 세션에 이미 이 상태가 설정되어 있으므로, 업데이트해도 아무것도 바뀌지 않으며 이메일도 발송되지 않습니다. |
| `notification_emails_disabled` | 세션이 `contact_details.send_notification_emails: true` 없이 생성되었으므로, `contact_details`에 입력된 주소로 결정 이메일이 발송되지 않습니다. |
| `no_recipient` | 사용자의 주소를 알 수 없습니다. |
| `sandbox` | 샌드박스 세션이며 수신자가 샌드박스 이메일 발송에 동의하지 않았으므로, 이메일은 시뮬레이션만 됩니다. [이메일 수신 동의](https://docs.didit.me/ko/integration/sandbox-testing.md#otp-코드와-이메일-수신-동의)를 참조하십시오. |## 결정 확인다음 필드를 사용하여 [세션 상태 업데이트](https://docs.didit.me/ko/sessions-api/update-status.md) API를 호출합니다.| 세션 상태 업데이트 필드 | 값 |
| - | - |
| `new_status` | 미리보기에서 지정한 것과 같은 `new_status` |
| `send_email` | `true` |
| `email_address` | 미리보기의 `recipient` |
| `email_language` | 미리보기의 `language` |
| `email_preview_token` | 미리보기의 `preview_token` |미리보기 토큰은 15분 후에 만료됩니다.
미리보기 이후 수신자, 언어, 세션 상태, 발신자 또는 이메일이 변경되었다면, 업데이트 요청은 아무것도 변경되기 전에 `409`를 반환합니다.
다시 미리보기를 수행한 다음, 새 토큰으로 확인하십시오.## 관련 항목- [세션 상태 업데이트](https://docs.didit.me/ko/sessions-api/update-status.md): 세션을 승인하거나 거부하고 이메일을 발송합니다.
- [재제출 이메일 미리보기](https://docs.didit.me/ko/sessions-api/preview-resubmission.md): 대신 재제출 이메일을 미리 봅니다.
- [화이트 라벨](https://docs.didit.me/ko/console/white-label.md): 이메일에 사용되는 발신자와 브랜딩입니다.


## OpenAPI

````yaml ko/openapi-25.json POST /v3/session/{sessionId}/decision-email-preview/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: 신분증 인증 API입니다. x-api-key 헤더로 인증합니다.
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/session/{sessionId}/decision-email-preview/:
    post:
      tags:
        - Sessions
      summary: 세션의 결정 이메일 미리보기
      description: >-
        세션을 변경하거나 아무것도 전송하지 않고, `send_email: true`로 세션을 `Approved` 또는
        `Declined`로 설정할 때 해당 사용자가 받게 될 이메일을 렌더링합니다. 응답에는 실제로 전송되는 제목과 HTML, 수신자,
        발신자, 언어 및 변경을 확정할 때 이메일이 실제로 전송되는지 여부(`will_be_sent`,
        `not_sent_reason`)가 정확히 표시됩니다.


        수신자는 해당 사용자의 자체 주소입니다. 즉, 플로우의 이메일 인증 단계에서 검증한 주소이거나, 세션 생성 시
        `contact_details`에 입력된 주소입니다. 발신자는 화이트 라벨이 적용되는 경우 애플리케이션의 인증된 발신자
        도메인(`sender_kind: customer`)이고, 그렇지 않은 경우 Didit의 발신자(`sender_kind:
        didit`)입니다.


        미리 본 내용 그대로 전송하려면 동일한 `new_status`, `send_email: true`, `recipient`로 설정된
        `email_address`, `language`로 설정된 `email_language`, `preview_token`으로 설정된
        `email_preview_token`을 사용하여 [세션 상태
        업데이트](/ko/sessions-api/update-status)을 호출합니다. 영수증은 15분 후에 만료됩니다. 미리보기 이후
        수신자, 언어, 세션 상태, 발신자 또는 이메일이 변경된 경우 업데이트는 아무것도 변경되기 전에 `409`를 반환합니다. 이 경우
        다시 미리보기를 수행하고 새 영수증으로 확인하십시오.


        `Approved`, `Declined`, `In Review`, `Kyc Expired`, `Abandoned` 또는
        `Resubmitted` 상태의 사용자 인증(KYC) 및 기업 확인(KYB) 세션에서 작동합니다. 상태 확인은 본문 유효성 검사
        전에 실행됩니다. `write:sessions` 권한이 필요하며, 범위가 지정된 API 키에는 결정에 대한 쓰기 권한이
        필요합니다. 응답은 `Cache-Control: no-store`를 사용하므로 민감한 인증 콘텐츠로 취급해야 합니다.
      operationId: post_v3_session_decision_email_preview
      parameters:
        - in: path
          name: sessionId
          required: true
          description: 인증 세션의 UUID입니다. 사용자(KYC) 및 기업(KYB) 세션 ID를 모두 지원합니다.
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - new_status
              properties:
                new_status:
                  type: string
                  enum:
                    - Approved
                    - Declined
                  description: 이메일을 미리 보려는 결정입니다.
                  example: Approved
                email_language:
                  type: string
                  default: en
                  description: >-
                    이메일 언어로, Update Session Status와 기본값이 동일합니다. 제공되지 않는 언어는 영어로
                    대체되며, 응답의 `language`에 사용된 언어가 표시됩니다.
                  example: en
            examples:
              Approved:
                summary: 영어 'Approved' 이메일 미리보기
                value:
                  new_status: Approved
              Declined in Spanish:
                summary: 스페인어 'Declined' 이메일 미리보기
                value:
                  new_status: Declined
                  email_language: es
      responses:
        '200':
          description: 미리보기 전용입니다. 세션은 변경되지 않으며 이메일도 전송되지 않습니다.
          headers:
            Cache-Control:
              description: 항상 `no-store`입니다. 미리보기에는 인증 콘텐츠가 포함되어 있으므로 캐시해서는 안 됩니다.
              schema:
                type: string
                example: no-store
          content:
            application/json:
              schema:
                type: object
                required:
                  - recipient
                  - recipient_source
                  - sender
                  - sender_name
                  - sender_email
                  - sender_kind
                  - subject
                  - html
                  - text
                  - language
                  - will_be_sent
                  - not_sent_reason
                  - preview_token
                properties:
                  recipient:
                    type: string
                    description: >-
                      이메일이 전송되는 주소입니다. 사용자의 주소를 알 수 없는 경우 빈 문자열입니다: 이 경우 이메일을
                      전송할 수 없으며 `preview_token`도 비어 있습니다. 확인할 때 `email_address`로
                      전달하십시오.
                    example: person@example.com
                  recipient_source:
                    type: string
                    enum:
                      - email_verification
                      - contact_details
                      - ''
                    description: >-
                      `recipient`의 출처입니다. `email_verification`: 플로우의 이메일 인증 단계에서
                      사용자가 인증한 주소입니다. `contact_details`: 세션 생성 시
                      `contact_details`에 제공된 주소입니다. 주소가 없는 경우 빈 문자열입니다.
                    example: email_verification
                  sender:
                    type: string
                    description: 이메일 발송에 사용되는 `From` 헤더입니다.
                    example: Example App <no-reply@mail.example.com>
                  sender_name:
                    type: string
                    description: '`sender`의 표시 이름 부분입니다.'
                    example: Example App
                  sender_email:
                    type: string
                    format: email
                    description: '`sender`의 주소 부분입니다.'
                    example: no-reply@mail.example.com
                  sender_kind:
                    type: string
                    enum:
                      - customer
                      - didit
                    description: >-
                      `customer`: 이메일이 애플리케이션의 인증된 발신자 도메인(화이트 라벨)에서 발송됩니다.
                      `didit`: Didit의 자체 발신자에서 발송됩니다.
                    example: customer
                  subject:
                    type: string
                    description: 전송된 그대로의 제목 라인입니다.
                    example: Your verification has been approved in Example App
                  html:
                    type: string
                    description: >-
                      전송된 그대로의 이메일 HTML이며, 로고는 data URL로 임베드되어 있습니다. 애플리케이션 DOM에
                      직접 렌더링하지 말고 반드시 샌드박스 처리된 프레임에서 렌더링하세요.
                    example: <!DOCTYPE html><html><body>...</body></html>
                  text:
                    type: string
                    description: >-
                      간결한 미리보기를 제공하기 위해 수신자의 메시지 스레드에 보관되는 일반 텍스트 형태의 이메일
                      내용입니다(HTML은 수신자가 받는 이메일 그대로 유지됨).
                    example: >-
                      Verification Approved


                      Your identity has been successfully verified with Acme
                      Pay. No further action is needed on your part.
                  language:
                    type: string
                    description: >-
                      이메일이 작성된 언어입니다. 요청한 `email_language`가 제공되지 않는 경우 영어(`en`)로
                      설정됩니다.
                    example: en
                  will_be_sent:
                    type: boolean
                    description: >-
                      `send_email: true`로 변경 사항을 확인할 때 이 이메일을 발송할지 여부입니다.
                      `not_sent_reason`이 설정된 경우 `false`입니다.
                    example: true
                  not_sent_reason:
                    type: string
                    nullable: true
                    enum:
                      - status_unchanged
                      - notification_emails_disabled
                      - no_recipient
                      - sandbox
                      - null
                    description: >-
                      확인 시 이메일이 전송되지 않는 이유 또는 전송될 예정인 경우 `null`입니다.
                      `status_unchanged`: 세션이 이미 이 상태이므로 업데이트로 인해 변경되거나 전송되는 항목이
                      없습니다. `notification_emails_disabled`:
                      `contact_details.send_notification_emails: true` 없이 세션이
                      생성되었으므로 `contact_details`에 지정된 주소로 결정 이메일이 전송되지 않습니다.
                      `no_recipient`: 사용자의 알려진 주소가 없습니다. `sandbox`: 수신자가 샌드박스
                      이메일 전송에 동의하지 않은 샌드박스 세션이므로 전송이 시뮬레이션만 됩니다.
                    example: null
                  preview_token:
                    type: string
                    description: >-
                      해당 이메일에 대한 서명된 영수증으로, 15분 동안 유효합니다. [세션 상태
                      업데이트](/ko/sessions-api/update-status)에
                      `email_preview_token`으로 전달하십시오. 수신자가 없는 경우 빈 문자열입니다.
                    example: >-
                      eyJkaWdlc3QiOiI0ZjJhIn0:1uExAm:Pl3x4mpleS1gnatureValue000000000000000
              examples:
                Will Be Sent:
                  summary: 승인 완료 이메일은 플로우에서 인증된 주소로 전송됩니다
                  value:
                    recipient: person@example.com
                    recipient_source: email_verification
                    sender: Example App <no-reply@mail.example.com>
                    sender_name: Example App
                    sender_email: no-reply@mail.example.com
                    sender_kind: customer
                    subject: Your verification has been approved in Example App
                    html: <!DOCTYPE html><html><body>...</body></html>
                    language: en
                    will_be_sent: true
                    not_sent_reason: null
                    preview_token: >-
                      eyJkaWdlc3QiOiI0ZjJhIn0:1uExAm:Pl3x4mpleS1gnatureValue000000000000000
                No Recipient:
                  summary: 해당 인물에 대해 알려진 주소가 없습니다
                  value:
                    recipient: ''
                    recipient_source: ''
                    sender: Example App <no-reply@mail.example.com>
                    sender_name: Example App
                    sender_email: no-reply@mail.example.com
                    sender_kind: customer
                    subject: Your verification has been declined in Example App
                    html: <!DOCTYPE html><html><body>...</body></html>
                    language: en
                    will_be_sent: false
                    not_sent_reason: no_recipient
                    preview_token: ''
        '400':
          description: >-
            세션이 이 endpoint에서 허용하는 상태가 아니거나(`{"detail": ...}`), 본문이 올바르지
            않습니다(`{"<field>": ["<message>"]}`).
          content:
            application/json:
              examples:
                Wrong Current Status:
                  summary: 세션이 이 endpoint에서 허용하는 상태가 아닙니다
                  value:
                    detail: >-
                      Only sessions with status Approved, Declined, In Review,
                      Kyc Expired, Abandoned, Resubmitted can be updated.
                      Current status: In Progress
                Invalid new_status:
                  summary: new_status가 Approved 또는 Declined가 아닙니다.
                  value:
                    new_status:
                      - '"Resubmitted" is not a valid choice.'
                Missing new_status:
                  summary: 필수 필드가 누락됨
                  value:
                    new_status:
                      - This field is required.
        '401':
          description: 스코프가 지정된 API 키가 만료되었습니다.
          content:
            application/json:
              examples:
                Expired API Key:
                  summary: 만료일이 지난 스코프 지정 API 키
                  value:
                    detail: This API key has expired.
        '403':
          description: >-
            자격 증명이 누락되었거나, 호출자에게 `write:sessions` 권한이 없거나, 범위 지정 API 키에 이
            endpoint가 필요로 하는 접근 권한이 없거나, `session_id`가 다른 애플리케이션에 속해 있습니다.
          content:
            application/json:
              examples:
                Invalid Credentials:
                  summary: x-api-key가 누락되었거나 유효하지 않음
                  value:
                    detail: >-
                      Authentication credentials were not provided or are
                      invalid.
                Missing Privilege:
                  summary: 호출자에게 write:sessions 권한이 없습니다
                  value:
                    detail: You do not have permission to perform this action.
                Scoped Key Without Access:
                  summary: 이 접근 권한이 없는 스코프 지정 API 키
                  value:
                    detail: This API key has no write access to decisions.
        '404':
          description: 이 `session_id`를 가진 KYC 또는 KYB 세션이 존재하지 않습니다.
          content:
            application/json:
              examples:
                Not Found:
                  summary: 알 수 없는 session_id
                  value:
                    detail: Not found.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: |-
            curl -X POST \
              https://verification.didit.me/v3/session/3fa85f64-5717-4562-b3fc-2c963f66afa6/decision-email-preview/ \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{"new_status": "Approved", "email_language": "en"}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.sessions.preview_decision_email(
                "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                new_status="Approved",
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: >-
            import Didit from "@didit-protocol/sdk-node";


            // Reads DIDIT_API_KEY.

            const didit = new Didit();


            const result = await
            didit.sessions.previewDecisionEmail("3fa85f64-5717-4562-b3fc-2c963f66afa6",
            {
              new_status: "Approved",
            });

            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Sessions.PreviewDecisionEmail(ctx, \"3fa85f64-5717-4562-b3fc-2c963f66afa6\", didit.SessionsPreviewDecisionEmailParams{\n\tNewStatus: \"Approved\",\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;

            import me.didit.types.SessionsPreviewDecisionEmailParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.sessions().previewDecisionEmail("3fa85f64-5717-4562-b3fc-2c963f66afa6",
            SessionsPreviewDecisionEmailParams.builder()
                    .newStatus(SessionsPreviewDecisionEmailParams.NewStatus.of("Approved"))
                    .build());
            System.out.println(result);
        - lang: php
          label: PHP
          source: >-
            <?php


            require 'vendor/autoload.php';


            use Didit\DiditClient;


            // Reads DIDIT_API_KEY.

            $didit = new DiditClient();


            $result =
            $didit->sessions->previewDecisionEmail('3fa85f64-5717-4562-b3fc-2c963f66afa6',
            [
                'new_status' => 'Approved',
            ]);

            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY.
            didit = Didit::Client.new

            result = didit.sessions.preview_decision_email(
              "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              new_status: "Approved"
            )
            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var result = await
            client.Sessions.PreviewDecisionEmailAsync("3fa85f64-5717-4562-b3fc-2c963f66afa6",
            new SessionsPreviewDecisionEmailParams

            {
                NewStatus = "Approved",
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Business Console의 Developers -> API keys에서 발급받은 귀하 애플리케이션의 API 키입니다. 기본
        키는 전체 접근 권한을 갖습니다. 이름이 지정된 키는 리소스별 none, read, write 범위로 권한을 제한할 수 있으며
        특정 워크플로나 승인된 세션, IP 주소 목록, 만료일 등으로 제한할 수도 있습니다. 401은 키가 잘못되었거나 폐기되었거나
        만료되었음을 의미합니다. 403은 키가 전송되지 않았거나, 키에 해당 리소스나 작업에 대한 접근 권한이 없거나, 요청이 허용된
        IP 목록 외부 주소에서 발생했음을 의미합니다. 세션 경로에서의 404는 해당 세션이 키의 허용 워크플로 또는 상태 범위를
        벗어났음을 의미합니다. 미디어 접근 권한이 없는 키는 이미지, 비디오, PDF URL을 null로 수신하며, 세션 write
        권한이 없는 키는 세션 링크와 token을 null로 수신합니다.
        https://docs.didit.me/console/api-keys 를 참고하십시오.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.