> ## 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 API क्रेडेंशियल प्राप्त करें

> POST /programmatic/verify-email/ से ईमेल की पुष्टि करें और Didit से access token, client_id व api_key पाएँ। एजेंट-नेटिव, प्रति उपयोग मूल्य।



ईमेल सत्यापित करने और क्रेडेंशियल प्राप्त करने का प्रॉम्प्ट
        प्रॉम्प्ट को क्लिपबोर्ड पर कॉपी करें



      
      

\<pre>

\`Exchange the email verification code for usable Didit credentials — step 2 of programmatic onboarding.

Endpoint:
POST https://apx.didit.me/auth/v2/programmatic/verify-email/

Authentication:
None. The email + code pair is the credential.

Request body:
\- email (string, required) — Same email used in /programmatic/register/.
\- code (string, required) — 6-character alphanumeric code from the registration email (e.g. "A3K9F2"). Valid for 15 minutes.

curl example:
curl -X POST https://apx.didit.me/auth/v2/programmatic/verify-email/ \
-H "Content-Type: application/json" \
-d '{
"email": "you@yourdomain.com",
"code": "A3K9F2"
}'

Response (200 OK):
\{
"access_token": "eyJ...RS256 JWT",
"refresh_token": "eyJ...RS256 JWT",
"expires_in": 86400,
"organization": {
"uuid": "a1b2c3d4-5678-...",
"name": "you"
},
"application": {
"uuid": "b2c3d4e5-6789-...",
"name": "you",
"client_id": "S9LIYGSoWNuGMLHsvEt9dQ",
"api_key": "sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"data_location": "eu"
}
}

What happens server-side:
1\. The pending account is marked email-verified.
2\. A default organization is created (named after the local part of the email, e.g. "you" from "you@yourdomain.com").
3\. A default application is created inside the organization with a fresh client_id and api_key, in the European Union (data_location "eu"). Its location can be chosen once with PATCH /organizations/me/{org_id}/applications/{app_id}/ before the application is used; see /auth-api/update-application.
4\. JWTs are issued (RS256, default 24h / 86400 seconds lifetime).

How to use the response:
\- application.api_key → set as the x-api-key header on EVERY call to https://verification.didit.me/v3/... (sessions, workflows, questionnaires, billing, etc.). PERSIST IT SECURELY. You can read it again later with GET /organizations/me/{org_id}/applications/{app_id}/.
\- access_token → use as "Authorization: Bearer <access_token>" against Account Management endpoints on https://apx.didit.me/auth/v2 (e.g. to create more applications).
\- refresh_token → exchange for a new access_token after expiry.

Save the api_key, the organization.uuid (org_id), and the application.uuid (app_id) — you will need all three to manage applications later.

Failure modes (400 unless noted):
\- Field-level: { "email": ["Enter a valid email address."] } or { "code": ["Ensure this field has at least 6 characters."] }.
\- Wrong or expired code CURRENTLY returns a BARE ARRAY ["Invalid or expired verification code."] — known server-side inconsistency; treat as { "code": [...] } client-side.
\- Unknown email: { "detail": "User not found." }

Recovery if you lose the api_key later:
Call POST /programmatic/login/ with email + password to get a fresh access_token, then GET /organizations/me/{org_id}/applications/{app_id}/ to read the api_key back. See /auth-api/login and /auth-api/get-credentials.

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

\</pre>



      
      

यहाँ पेस्ट करें



## OpenAPI

````yaml hi/openapi-auth.json POST /programmatic/verify-email/
openapi: 3.0.0
info:
  version: 1.0.0
  title: Didit Auth API
  description: >-
    डेवलपर्स और AI एजेंट्स के लिए प्रोग्रामेटिक रजिस्ट्रेशन और प्रमाणीकरण API। 2
    API कॉल्स में रजिस्टर करें -- किसी ब्राउज़र की आवश्यकता नहीं। सबसे अधिक
    एजेंट-अनुकूल पहचान सत्यापन प्लेटफ़ॉर्म।


    ## बेस URL


    इस विनिर्देश के सभी endpoints `https://apx.didit.me/auth/v2` पर होस्ट किए गए
    हैं। यह सत्यापन API (`https://verification.didit.me/v3`) से एक अलग होस्ट है।
    इनका अंतर स्पष्ट रखें: यह ऑथ होस्ट आपके **JWT access tokens** जारी करता है
    और आपको अपने **संगठनों** और **एप्लिकेशन्स** को सूचीबद्ध और प्रबंधित करने की
    अनुमति देता है। सत्यापन होस्ट वह जगह है जहां आप इस API द्वारा लौटाए गए
    **`api_key`** के साथ प्रमाणित होकर सत्रों, वर्कफ़्लो, AML आदि को कॉल करते
    हैं।


    ## ऑथ फ़्लो कैसे काम करता है


    1. `POST /programmatic/register/` — ईमेल + पासवर्ड सबमिट करें।

    2. ईमेल द्वारा 6-वर्णों का अल्फ़ान्यूमेरिक कोड प्राप्त करें।

    3. `POST /programmatic/verify-email/` — कोड सबमिट करें। आपको एक JWT
    `access_token`, एक `refresh_token`, एक संगठन और `client_id` + `api_key` के
    साथ एक डिफ़ॉल्ट एप्लिकेशन वापस मिलता है।

    4. `api_key` को सहेजें। `https://verification.didit.me/v3/...` पर प्रत्येक
    कॉल के लिए इसे `x-api-key` के रूप में उपयोग करें।

    5. भविष्य में किसी भी मशीन से, `POST /programmatic/login/` आपके ईमेल +
    पासवर्ड के बदले एक नया JWT प्राप्त करता है, फिर क्रेडेंशियल्स को रिकवर या
    रोटेट करने के लिए `GET /organizations/me/` और एप्लिकेशन endpoints को कॉल
    करें।


    JWT केवल इस विनिर्देश में **Account Management** endpoints के लिए आवश्यक है;
    सत्यापन API ट्रैफ़िक लंबी अवधि वाले `api_key` का उपयोग करता है, न कि JWT का।


    ## कन्वेंशन


    - सभी अनुरोध और रिस्पॉन्स बॉडी JSON (`Content-Type: application/json`) हैं।

    - **`POST /programmatic/register/` का परीक्षण करते समय वास्तविक, डिलीवर होने
    योग्य ईमेल पते का उपयोग करें।** endpoint सत्यापन कोड को सिंक्रोनस रूप से
    भेजता है, इसलिए आरक्षित परीक्षण डोमेन (`@example.com`, `@example.org`,
    `@*.test`, `@*.example`, `@*.invalid`) पर पतों को मेल डिलीवरी द्वारा
    अस्वीकार कर दिया जाता है और अनुरोध `500` लौटाता है। नमूनों में दिए गए
    `you@yourdomain.com` प्लेसहोल्डर को ऐसे इनबॉक्स से बदलें जिसे आप वास्तव में
    पढ़ सकते हैं।

    - सत्यापन त्रुटियां दो में से किसी एक एन्वेलप के साथ HTTP `400` लौटाती हैं:
    फ़ील्ड-स्तरीय समस्याओं के लिए `{"field": ["message", ...]}` या
    व्यावसायिक-नियम त्रुटियों के लिए `{"detail": "message"}`। कुछ वैलिडेटर
    (रजिस्टर पर पासवर्ड की मजबूती, verify-email पर कोड की समय-सीमा समाप्ति)
    वर्तमान में फ़ील्ड-की वाले फ़ॉर्म के बजाय केवल एक ऐरे `["message"]` के साथ
    रिस्पॉन्स देते हैं -- यह एक ज्ञात सर्वर-साइड विसंगति है, इसलिए क्लाइंट कोड
    को दोनों प्रारूपों को स्वीकार करना चाहिए।

    - प्रमाणीकरण त्रुटियां HTTP `401` (अमान्य bearer token) या `403` (अनुपलब्ध
    bearer token / अपर्याप्त विशेषाधिकार) के साथ `{"detail": "..."}` के रूप में
    वापस आती हैं।

    - रेट लिमिट रिस्पॉन्स में सेकंड में कूलडाउन के साथ एक `wait` फ़ील्ड शामिल
    होता है।
servers:
  - url: https://apx.didit.me/auth/v2
    description: प्रोडक्शन ऑथ सर्वर
security: []
tags:
  - name: Programmatic Auth
    description: >-
      ईमेल-और-पासवर्ड खाता जीवनचक्र: रजिस्टर करें, सत्यापित करें, लॉगिन करें। यह
      JWT `access_token` लौटाता है जिसका उपयोग आप खाता प्रबंधन endpoints के लिए
      करते हैं, साथ ही (सत्यापन पर) आपके पहले एप्लिकेशन की `client_id` और
      `api_key` भी।
  - name: Account Management
    description: >-
      प्रमाणित endpoints (JWT bearer) जो संगठनों को सूचीबद्ध करते हैं और
      एप्लिकेशन बनाते, प्राप्त करते या अपडेट करते हैं। इनका उपयोग उस `api_key`
      को पुनर्प्राप्त या रोटेट करने के लिए करें जिसके साथ आप सत्यापन API कॉल को
      प्रमाणित करते हैं।
paths:
  /programmatic/verify-email/:
    post:
      tags:
        - Programmatic Auth
      summary: ईमेल सत्यापित करें और क्रेडेंशियल जारी करें
      description: >-
        ऑनबोर्डिंग का चरण 2। 6-अक्षर के कोड के बदले एक सत्यापित खाता, एक
        डिफ़ॉल्ट org+app, और एक JWT युग्म प्रदान करता है। लौटाई गई `api_key` को
        सहेज कर रखें।
      operationId: programmatic_verify_email
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyEmailRequest'
            examples:
              Default:
                summary: पंजीकरण ईमेल से कोड सबमिट करें
                value:
                  email: you@yourdomain.com
                  code: A3K9F2
      responses:
        '200':
          description: >-
            ईमेल सत्यापित हो गया। रिस्पॉन्स में इस ऑथ API के लिए टोकन और बिल्कुल
            नए एप्लिकेशन की `client_id` और `api_key` शामिल हैं। `api_key` को
            सुरक्षित रूप से सहेजें — यह प्रत्येक सत्यापन API कॉल द्वारा उपयोग
            किया जाने वाला दीर्घकालिक क्रेडेंशियल है।
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerifyEmailResponse'
              examples:
                Success:
                  value:
                    access_token: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
                    refresh_token: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
                    expires_in: 86400
                    organization:
                      uuid: a1b2c3d4-5678-90ab-cdef-111111111111
                      name: developer
                    application:
                      uuid: b2c3d4e5-6789-01bc-defg-222222222222
                      name: developer
                      client_id: S9LIYGSoWNuGMLHsvEt9dQ
                      api_key: sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                      data_location: eu
        '400':
          description: >-
            सत्यापन त्रुटि। अपेक्षित एनवेलप फ़ील्ड-स्तरीय समस्याओं के लिए
            `{"field": ["..."]}` और व्यावसायिक-नियम त्रुटियों (उदा. उपयोगकर्ता
            नहीं मिला) के लिए `{"detail": "..."}` है। गलत-या-समाप्त-कोड
            त्रुटियां वर्तमान में एक साधारण सरणी `["Invalid or expired
            verification code."]` के साथ प्रतिक्रिया देती हैं -- ज्ञात
            सर्वर-साइड विसंगति; ठीक होने तक इसे `{"code": ["..."]}` के रूप में
            मानें।
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              examples:
                MissingFields:
                  summary: खाली बॉडी
                  value:
                    email:
                      - This field is required.
                    code:
                      - This field is required.
                CodeTooShort:
                  summary: 6 वर्णों से कम का कोड
                  value:
                    code:
                      - Ensure this field has at least 6 characters.
                InvalidEmail:
                  summary: गलत स्वरूपित ईमेल
                  value:
                    email:
                      - Enter a valid email address.
                InvalidCode:
                  summary: गलत या समय-सीमा समाप्त कोड
                  value:
                    - Invalid or expired verification code.
                UserNotFound:
                  summary: उस ईमेल के लिए कोई लंबित खाता नहीं है
                  value:
                    detail: User not found.
        '429':
          description: >-
            सर्विस वर्तमान में एक साथ जितने हो सके उतने पासवर्ड या कोड जांच रही
            है। यह `Retry-After: 5` हेडर के साथ भेजा जाता है; निर्दिष्ट सेकंड की
            संख्या के बाद पुनः प्रयास करें।
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
              examples:
                PasswordChecksBusy:
                  summary: बहुत सारे पासवर्ड सत्यापन प्रगति पर हैं
                  value:
                    detail: >-
                      Too many sign-in attempts are being processed right now.
                      Please try again in a few seconds.
      security:
        - {}
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST https://apx.didit.me/auth/v2/programmatic/verify-email/
            \
              -H "Content-Type: application/json" \
              -d '{
                "email": "you@yourdomain.com",
                "code": "A3K9F2"
              }'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # This call needs no API key.
            client = Didit()

            result = client.account.verify_email(
                email="you@yourdomain.com",
                code="A3K9F2",
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit from "@didit-protocol/sdk-node";

            // This call needs no API key.
            const didit = new Didit();

            const result = await didit.account.verifyEmail({
              email: "you@yourdomain.com",
              code: "A3K9F2",
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// This call needs no API key.\nclient := didit.NewClient()\n\nresult, err := client.Account.VerifyEmail(ctx, didit.VerifyEmailRequest{\n\tEmail: \"you@yourdomain.com\",\n\tCode:  \"A3K9F2\",\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.VerifyEmailRequest;


            // This call needs no API key.

            Didit client = new Didit();


            var result =
            client.account().verifyEmail(VerifyEmailRequest.builder()
                    .email("you@yourdomain.com")
                    .code("A3K9F2")
                    .build());
            System.out.println(result);
        - lang: php
          label: PHP
          source: |-
            <?php

            require 'vendor/autoload.php';

            use Didit\DiditClient;

            // This call needs no API key.
            $didit = new DiditClient();

            $result = $didit->account->verifyEmail([
                'email' => 'you@yourdomain.com',
                'code' => 'A3K9F2',
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # This call needs no API key.
            didit = Didit::Client.new

            result = didit.account.verify_email(
              email: "you@yourdomain.com",
              code: "A3K9F2"
            )
            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // This call needs no API key.

            using var client = new DiditClient();


            var result = await client.Account.VerifyEmailAsync(new
            VerifyEmailRequest

            {
                Email = "you@yourdomain.com",
                Code = "A3K9F2",
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    VerifyEmailRequest:
      type: object
      required:
        - email
        - code
      properties:
        email:
          type: string
          format: email
          description: '`POST /programmatic/register/` के दौरान उपयोग किया गया ईमेल।'
          example: you@yourdomain.com
        code:
          type: string
          minLength: 6
          maxLength: 6
          description: >-
            सत्यापन ईमेल से 6-वर्ण का अल्फ़ान्यूमेरिक कोड। सबसे हालिया कोड भेजे
            जाने के 10 मिनट बाद कोड की समय-सीमा समाप्त हो जाती है।
          example: A3K9F2
    VerifyEmailResponse:
      type: object
      properties:
        access_token:
          type: string
          description: >-
            RS256-हस्ताक्षरित JWT। `apx.didit.me/auth/v2` पर खाता प्रबंधन
            endpoints के लिए `Authorization: Bearer <token>` के रूप में उपयोग
            करें।
        refresh_token:
          type: string
          description: एक्सेस token के साथ जोड़ा गया रीफ़्रेश token।
        expires_in:
          type: integer
          description: एक्सेस token का लाइफ़टाइम सेकंड में (डिफ़ॉल्ट 86400)।
          example: 86400
        organization:
          $ref: '#/components/schemas/OrganizationSummary'
        application:
          $ref: '#/components/schemas/ApplicationCredentialsSummary'
    ValidationError:
      description: >-
        सत्यापन त्रुटि बॉडी। अभीष्ट एनवलप फ़ील्ड-स्तरीय त्रुटियों के लिए
        `{field: ["message", ...]}` मैप या व्यावसायिक-नियम त्रुटियों के लिए
        `{detail: "..."}` सिंगल-की एनवलप है। मुट्ठी भर सत्यापनकर्ता (register पर
        पासवर्ड स्ट्रेंथ, verify-email पर कोड वैधता) वर्तमान में एक बेयर ऐरे
        `["message"]` के साथ रिस्पॉन्स देते हैं -- ज्ञात सर्वर-साइड विसंगति।
        नीचे दिया गया स्कीमा उस बेयर-ऐरे शाखा को बनाए रखता है ताकि इस विनिर्देश
        से उत्पन्न क्लाइंट कोड आज के रिस्पॉन्स को डिसेरिएलाइज़ कर सके, लेकिन नए
        क्लाइंट कोड को इसे प्रासंगिक फ़ील्ड-की वाले रूप (`{password: [...]}` या
        `{code: [...]}`) के रूप में मानना चाहिए और सर्वर अनुबंध उस आकार पर
        अभिसरित होगा।
      oneOf:
        - type: object
          additionalProperties:
            type: array
            items:
              type: string
          example:
            email:
              - Enter a valid email address.
        - type: object
          properties:
            detail:
              type: string
          example:
            detail: An account with this email already exists.
        - type: array
          items:
            type: string
          example:
            - Invalid or expired verification code.
    RateLimitError:
      type: object
      description: >-
        रेट लिमिट या प्रोग्रेसिव लॉकआउट रिस्पॉन्स। `wait` सेकंड में कूलडाउन अवधि
        है।
      properties:
        detail:
          type: string
          example: >-
            Too many login attempts from this IP address. Please wait before
            trying again.
    OrganizationSummary:
      type: object
      description: >-
        `POST /programmatic/verify-email/` द्वारा इनलाइन लौटाई गई न्यूनतम संगठन
        संरचना।
      properties:
        uuid:
          type: string
          format: uuid
          example: a1b2c3d4-5678-90ab-cdef-111111111111
        name:
          type: string
          example: developer
    ApplicationCredentialsSummary:
      type: object
      description: >-
        `POST /programmatic/verify-email/` द्वारा इनलाइन लौटाई गई न्यूनतम
        एप्लिकेशन संरचना। `api_key` को तुरंत स्थायी रूप से सहेजें।
      properties:
        uuid:
          type: string
          format: uuid
          example: b2c3d4e5-6789-01bc-defg-222222222222
        name:
          type: string
          example: developer
        client_id:
          type: string
          example: S9LIYGSoWNuGMLHsvEt9dQ
        api_key:
          type: string
          description: >-
            प्रत्येक सत्यापन API कॉल पर इसे `x-api-key` के रूप में उपयोग करें।
            नई कुंजियाँ `sk_live_` (लाइव एप्लिकेशन) या `sk_test_` (सैंडबॉक्स
            एप्लिकेशन) से शुरू होती हैं, जिसके बाद 43 URL-सुरक्षित वर्ण (अक्षर,
            अंक, `-` और `_`) आते हैं। इस प्रारूप से पहले बनाई गई कुंजियों में
            कोई उपसर्ग नहीं होता है और वे बिना किसी बदलाव के काम करती रहती हैं।
          example: sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        data_location:
          $ref: '#/components/schemas/ApplicationDataLocation'
    ApplicationDataLocation:
      type: string
      enum:
        - eu
        - au
        - mx
      description: >-
        एप्लिकेशन का सत्यापन डेटा कहाँ संग्रहीत और संसाधित किया जाता है, जिसे
        एप्लिकेशन बनाते समय चुना जाता है। `eu` यूरोपीय संघ (आयरलैंड) है, जो
        डिफ़ॉल्ट है। `au` (ऑस्ट्रेलिया, सिडनी) और `mx` (मेक्सिको) जल्द ही आ रहे
        हैं: उनका नाम देने वाला अनुरोध 400 `This data location is not available
        yet.` उत्तर देता है। किसी संगठन का सैंडबॉक्स एप्लिकेशन हमेशा यूरोपीय संघ
        में होता है।
      example: eu

````

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