> ## 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.

# प्रोग्रामेटिक पंजीकरण: Auth API

> Auth API से Didit संगठन प्रोग्रामेटिक रूप से बनाएं। एजेंट-अनुकूल, बिना ब्राउज़र। सब-अकाउंट KYC इंफ्रास्ट्रक्चर बनाएं, पे-पर-कॉल, कोई अनुबंध नहीं।



प्रोग्रामेटिक पंजीकरण प्रॉम्प्ट
        प्रॉम्प्ट को क्लिपबोर्ड पर कॉपी करें



      
      

\<pre>

\``Programmatically create a pending Didit account — step 1 of the two-step onboarding (no browser, no console).

Endpoint:
POST https://apx.didit.me/auth/v2/programmatic/register/

Authentication:
None. This is a public endpoint. (Don't confuse the Auth API host `apx.didit.me/auth/v2` with the verification host `verification.didit.me/v3`.)

Request body:
\- email (string, required) — Any real, deliverable email (personal, work, alias). The verification code is mailed synchronously, so reserved test domains (`@example.com`, `@example.org`, `@*.test`, `@*.example`, `@*.invalid`) get rejected by mail delivery and the call returns `500` — substitute the placeholder with an inbox you can read.
\- password (string, required) — Must satisfy ALL of: minimum 8 characters, ≥1 uppercase letter (A-Z), ≥1 lowercase letter (a-z), ≥1 digit (0-9), ≥1 special character from !@#$%^&*()_+-=[]{}|;:,.<>?. Rules are validated one at a time and the first failure short-circuits.

curl example (replace `you@yourdomain.com` with a real inbox):
curl -X POST https://apx.didit.me/auth/v2/programmatic/register/ \
-H "Content-Type: application/json" \
-d '{
"email": "you@yourdomain.com",
"password": "MyStr0ng!Pass"
}'

Response (201 Created):
\- message (string) — "Registration successful. Check your email for the verification code."
\- email (string) — echoed back.

What happens server-side:
\- A pending account is created (NOT usable yet).
\- A 6-character alphanumeric code (e.g. "A3K9F2") is emailed to the supplied address.
\- The code is valid for 15 minutes. After expiry the registration must be redone.

Failure modes (all 400 unless noted):
\- Field-level: { "email": ["Enter a valid email address."] } or { "password": ["Ensure this field has at least 8 characters."] }.
\- Password-strength failures CURRENTLY return as a BARE ARRAY (no field key), one rule at a time: ["Password must contain at least one uppercase letter."] / lowercase / digit / special character. Known server-side inconsistency — treat as { "password": [...] } client-side.
\- Duplicate email: { "detail": "An account with this email already exists." }
\- 429 — { "detail": "Too many registration attempts. Please try again later.", "wait": <seconds> } when more than 5 registrations from the same IP within an hour.
\- 500 — returned (with an HTML body, not JSON) when mail delivery to the supplied address fails synchronously. Most commonly triggered by reserved test domains; use a real inbox.

Rate limits:
5 registrations per IP per hour.

Next step:
After receiving the email, call POST https://apx.didit.me/auth/v2/programmatic/verify-email/ with { "email", "code" } to get your access_token and api_key — see /auth-api/verify-email.

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

\</pre>



      
      

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



## OpenAPI

````yaml hi/openapi-auth.json POST /programmatic/register/
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/register/:
    post:
      tags:
        - Programmatic Auth
      summary: खाता पंजीकृत करें
      description: >-
        प्रोग्रामेटिक ऑनबोर्डिंग का चरण 1। एक पेंडिंग खाता बनाता है और 6-अक्षर
        का कोड ईमेल करता है (10 मिनट का TTL)। कोई भी खाता बनाए जाने से पहले पते
        की जाँच की जाती है: जो कोड प्राप्त नहीं कर सकता वह 400
        `email_undeliverable` लौटाता है। रेट लिमिट: 5/IP/घंटा, साथ ही प्रति
        नेटवर्क एक साझा प्रति घंटा बजट (IPv4 के लिए /24, IPv6 के लिए /64)।
      operationId: programmatic_register
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterRequest'
            examples:
              Gmail:
                summary: व्यक्तिगत Gmail से पंजीकरण करें
                value:
                  email: you@yourdomain.com
                  password: MyStr0ng!Pass
              Work:
                summary: कार्य ईमेल के साथ पंजीकरण करें
                value:
                  email: you@yourcompany.com
                  password: C0mplex#Pass1
      responses:
        '201':
          description: >-
            पंजीकरण सफल रहा। एक 6-वर्णों वाला अल्फ़ान्यूमेरिक सत्यापन कोड (उदा.,
            `A3K9F2`) दिए गए पते पर ईमेल किया गया था और यह 10 मिनट के लिए मान्य
            है। इसके बाद `POST /programmatic/verify-email/` कॉल करें।
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterResponse'
              examples:
                Success:
                  value:
                    message: >-
                      Registration successful. Check your email for the
                      verification code.
                    email: you@yourdomain.com
        '400':
          description: >-
            सत्यापन त्रुटि। अपेक्षित एनवेलप फ़ील्ड-स्तरीय त्रुटियों के लिए
            `{"field": ["..."]}` और व्यावसायिक-नियम त्रुटियों (उदा. डुप्लिकेट
            ईमेल) के लिए `{"detail": "..."}` है। पासवर्ड-मजबूती नियम वर्तमान में
            एक साधारण ऐरे `["..."]` के साथ रिस्पॉन्स देते हैं, एक समय में एक
            नियम -- ज्ञात सर्वर-साइड विसंगति; ठीक होने तक इसे `{"password":
            ["..."]}` के रूप में मानें। जब पता कोड प्राप्त नहीं कर सकता है
            (डिस्पोजेबल, आरक्षित या परीक्षण डोमेन, कोई मेल सर्वर नहीं, संभावित
            टाइपो, या पहले बाउंस हुआ पता), तो रिस्पॉन्स बॉडी `code:
            "email_undeliverable"` के साथ `EmailUndeliverableError` होती है; कोई
            खाता नहीं बनाया या बदला जाता है।
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ValidationError'
                  - $ref: '#/components/schemas/EmailUndeliverableError'
              examples:
                MissingFields:
                  summary: खाली बॉडी
                  value:
                    email:
                      - This field is required.
                    password:
                      - This field is required.
                InvalidEmail:
                  summary: गलत स्वरूपित ईमेल
                  value:
                    email:
                      - Enter a valid email address.
                PasswordTooShort:
                  summary: पासवर्ड 8 वर्णों से कम है
                  value:
                    password:
                      - Ensure this field has at least 8 characters.
                PasswordMissingUppercase:
                  summary: पासवर्ड में अपरकेस अक्षर गायब है
                  value:
                    - Password must contain at least one uppercase letter.
                PasswordMissingLowercase:
                  summary: पासवर्ड में लोअरकेस अक्षर गायब है
                  value:
                    - Password must contain at least one lowercase letter.
                PasswordMissingDigit:
                  summary: पासवर्ड में एक अंक गायब है
                  value:
                    - Password must contain at least one digit.
                PasswordMissingSpecial:
                  summary: पासवर्ड में विशेष वर्ण गायब है
                  value:
                    - >-
                      Password must contain at least one special character
                      (!@#$%^&*()_+-=[]{}|;:,.<>?).
                Duplicate:
                  summary: ईमेल से जुड़ा खाता पहले से मौजूद है
                  value:
                    detail: An account with this email already exists.
                EmailUndeliverable:
                  summary: पता ईमेल प्राप्त नहीं कर सकता (डिस्पोज़ेबल डोमेन)
                  value:
                    detail: >-
                      This email can't receive messages. Please use a different
                      email address.
                    code: email_undeliverable
                    reason: disposable_domain
                EmailLikelyTypo:
                  summary: डोमेन में संभावित टाइपो
                  value:
                    detail: >-
                      This email can't receive messages. Please use a different
                      email address.
                    code: email_undeliverable
                    reason: possible_typo
                    suggestion: gmail.com
        '429':
          description: >-
            रेट लिमिट लागू है। पिछले एक घंटे में समान IP से 5 से अधिक पंजीकरण
            प्रयास, या कॉलर के नेटवर्क (IPv4 के लिए /24, IPv6 के लिए /64, जो
            पंजीकरण और कोड पुनः भेजने के बीच साझा किया जाता है) का प्रति घंटा
            बजट समाप्त हो गया है। दोनों में `Retry-After: 3600` होता है। यह
            `Retry-After: 5` हेडर के साथ तब भी लौटाया जाता है, जब सेवा एक साथ
            अधिक से अधिक पासवर्ड या कोड की क्षणिक जांच कर रही हो; बताए गए सेकंड
            की संख्या के बाद पुनः प्रयास करें।
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
              examples:
                RateLimited:
                  value:
                    detail: Too many registration attempts. Please try again later.
                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/register/ \
              -H "Content-Type: application/json" \
              -d '{
                "email": "you@yourdomain.com",
                "password": "MyStr0ng!Pass"
              }'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

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

            result = client.account.register(
                email="you@yourdomain.com",
                password="MyStr0ng!Pass",
            )
            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.register({
              email: "you@yourdomain.com",
              password: "MyStr0ng!Pass",
            });
            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.Register(ctx, didit.RegisterRequest{\n\tEmail:    \"you@yourdomain.com\",\n\tPassword: \"MyStr0ng!Pass\",\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.RegisterRequest;

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

            var result = client.account().register(RegisterRequest.builder()
                    .email("you@yourdomain.com")
                    .password("MyStr0ng!Pass")
                    .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->register([
                'email' => 'you@yourdomain.com',
                'password' => 'MyStr0ng!Pass',
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

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

            result = didit.account.register(
              email: "you@yourdomain.com",
              password: "MyStr0ng!Pass"
            )
            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.RegisterAsync(new RegisterRequest
            {
                Email = "you@yourdomain.com",
                Password = "MyStr0ng!Pass",
            });
            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    RegisterRequest:
      type: object
      required:
        - email
        - password
      properties:
        email:
          type: string
          format: email
          description: >-
            कोई भी मान्य ईमेल पता (व्यक्तिगत, कार्य, उपनाम)। अद्वितीय खाता
            पहचानकर्ता के रूप में उपयोग किया जाता है।
          example: you@yourdomain.com
        password:
          type: string
          minLength: 8
          description: >-
            न्यूनतम 8 वर्ण। कम से कम एक अपरकेस अक्षर (`A-Z`), एक लोअरकेस अक्षर
            (`a-z`), एक अंक (`0-9`), और `!@#$%^&*()_+-=[]{}|;:,.<>?` में से एक
            विशेष वर्ण होना चाहिए। सत्यापन एक समय में एक विफल नियम की रिपोर्ट
            करता है।
          example: MyStr0ng!Pass
    RegisterResponse:
      type: object
      properties:
        message:
          type: string
          description: मानव-पठनीय पुष्टि कि सत्यापन कोड भेजा गया था।
          example: Registration successful. Check your email for the verification code.
        email:
          type: string
          format: email
          description: वह ईमेल जिस पर सत्यापन कोड भेजा गया था।
          example: you@yourdomain.com
    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.
    EmailUndeliverableError:
      type: object
      description: >-
        `POST /programmatic/register/` द्वारा तब लौटाया जाता है जब पता सत्यापन
        कोड प्राप्त नहीं कर सकता। यह जांच किसी भी खाते के बनने या बदले जाने से
        पहले चलती है, इसलिए कुछ भी पीछे नहीं छूटता।
      required:
        - detail
        - code
        - reason
      properties:
        detail:
          type: string
          description: मानव-पठनीय संदेश।
          example: >-
            This email can't receive messages. Please use a different email
            address.
        code:
          type: string
          enum:
            - email_undeliverable
          description: हमेशा `email_undeliverable`।
        reason:
          type: string
          enum:
            - invalid_address
            - reserved_domain
            - no_mail_records
            - disposable_domain
            - possible_typo
            - suppressed
          description: >-
            पता क्यों अस्वीकार किया गया था: `invalid_address` (मान्य पता नहीं
            है), `reserved_domain` (एक आरक्षित या परीक्षण डोमेन जैसे कि
            `example.com`), `no_mail_records` (डोमेन में कोई मेल सर्वर नहीं है),
            `disposable_domain` (एक थ्रोअवे मेलबॉक्स प्रदाता), `possible_typo`
            (किसी सामान्य प्रदाता की संभावित गलत वर्तनी; `suggestion` देखें),
            `suppressed` (पता पहले बाउंस हुआ था या शिकायत की गई थी)।
        suggestion:
          type: string
          description: >-
            संभावित अभीष्ट डोमेन, केवल तभी मौजूद होता है जब डोमेन में कोई टाइपो
            प्रतीत होता है (उदाहरण के लिए `gmial.com` के स्थान पर `gmail.com`)।
            API पुष्टिकरण स्वीकार नहीं करता है: सही किए गए पते के साथ फिर से
            पंजीकरण करें।
          example: gmail.com
    RateLimitError:
      type: object
      description: >-
        रेट लिमिट या प्रोग्रेसिव लॉकआउट रिस्पॉन्स। `wait` सेकंड में कूलडाउन अवधि
        है।
      properties:
        detail:
          type: string
          example: >-
            Too many login attempts from this IP address. Please wait before
            trying again.

````

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