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

# Perbarui Pengaturan Verifikasi Telepon API

> Perbarui default verifikasi, retensi data, dan residensi data pilihan di Didit. Pelajari cara menjaga pengaturan bertingkat.

API Pengaturan Telepon Didit memperbarui default verifikasi, retensi pesan, dan wilayah data pilihan Anda. Untuk mengubah satu pengaturan verifikasi, seperti `verification.code_length`, kirim hanya pengaturan tersebut. Setiap pengaturan yang Anda kirim menggantikan nilai tersimpannya, dan pengaturan yang berada di luar rentang akan mengembalikan `400 invalid_setting`.

Atur `messages.retention_days` ke 7, 30, 90, atau 365. Untuk mencatat preferensi wilayah, atur `data_region` ke `eu` atau `us`.

[Ambil pengaturan saat ini](https://docs.didit.me/id/standalone-apis/phone-settings-retrieve.md) sebelum mengubah default. Untuk mengubah rute mana yang terbuka di setiap pasar, [perbarui negara dan rute](https://docs.didit.me/id/standalone-apis/phone-countries.md). Kunci API terbatas memerlukan akses tulis ke `applications`. Kunci tanpa cakupan ini menerima `403`. Nilai di luar rentang akan mengembalikan `400 invalid_setting`.


## OpenAPI

````yaml id/openapi-25.json PATCH /v3/phone/settings/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: Identity verification API. Authenticate with x-api-key header.
servers:
  - url: https://verification.didit.me
security: []
tags:
  - name: Bank Data
    description: >-
      Bank Link, connections, accounts, balances, transactions, institutions and
      coverage. One-time reads of real banks are open to live applications.
      Ongoing access with real banks is not open yet for live applications: it
      is available for sandbox applications with the Didit Test Bank, and opens
      country by country. Nothing is charged in sandbox. A call made with an API
      key needs a key that can reach Bank data: a full-access key can, and a
      scoped key needs `bank-data` in its scopes (read for reads, write for
      operations that change something). A scoped key without it is refused, and
      the call answers `403 bank_data_access_denied`. The account check is the
      exception: it needs write access to sessions, or full access, and not the
      Bank data scope. Raw bank data (accounts, balances, transactions and the
      change feed) also refuses a request that carries no API key.


      Every refusal under `/v3/bank/` except the account check's has the same
      JSON body (`code`, `message`, `request_id`, `field`, `next_action`,
      `retry_after`). A path that is not an operation, an id that is not a UUID
      or an unknown sub-resource answers `404 not_found` for every method, and
      any unexpected error answers `500 internal_error` with a `request_id`.
      Where Bank data is not available, every operation answers the platform's
      standard `404`, exactly as an unknown route does.
paths:
  /v3/phone/settings/:
    patch:
      tags:
        - Phone
      summary: Change the Phone settings
      description: >-
        Update verification options, the message retention period
        (`messages.retention_days`) and the data region preference
        (`data_region`). Send only what you want to change: each property you
        send under `verification` replaces its saved value, and
        `cancel_on_resend` is accepted here too. A value out of range answers
        `400 invalid_setting` (`code_length` 4 to 10, `valid_minutes` 1 to 15,
        `max_attempts` 3 to 10, `resend_limit` 1 to 10, `routing` `fixed` or
        `conversion`, `channel_order` a list of Phone channels,
        `messages.retention_days` 7, 30, 90 or 365). A restricted API key needs
        write access to `applications`.
      operationId: patchPhoneSettings
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhoneSettingsUpdate'
            example:
              verification:
                code_length: 6
                routing: conversion
              messages:
                retention_days: 30
      responses:
        '200':
          description: The settings, updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneSettingsUpdateResponse'
              example:
                updated_at: '2026-11-21T10:00:00Z'
        '400':
          description: >-
            `invalid_setting`: a value is out of range or not valid:
            `code_length` 4 to 10, `valid_minutes` 1 to 15, `max_attempts` 3 to
            10, `resend_limit` 1 to 10, `routing` `fixed` or `conversion`,
            `channel_order` a list of Phone channels, `cancel_on_resend` true or
            false, `messages.retention_days` 7, 30, 90 or 365.
        '401':
          description: The API key is invalid, revoked or expired.
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    type: string
              example:
                detail: Authentication credentials were not provided or are invalid.
        '403':
          description: The API key lacks write access to `applications`.
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    type: string
              example:
                detail: This API key has no write access to application settings.
        '429':
          $ref: '#/components/responses/RateLimitedWrite'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: |-
            curl -X PATCH 'https://verification.didit.me/v3/phone/settings/' \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{
                "verification": {
                  "code_length": 6,
                  "routing": "conversion"
                },
                "messages": {
                  "retention_days": 30
                }
              }'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Optional retry-safety key you choose for one operation, up to 255
        characters (a UUID works). A request repeated with the same key,
        endpoint, query and body is answered with the first response, same
        status and same body, and runs and bills nothing a second time. The same
        key with another endpoint, query or body returns `409`
        `idempotency_key_reused`, and while the first request is still running,
        `409` `idempotency_key_in_progress` with `Retry-After`. A failed request
        (any `4xx` or `5xx`) is not stored, so you can send it again with the
        same key. Keys belong to your application, whether you call with an API
        key or an access token. See [Retries and
        idempotency](/integration/api-errors#retries-and-idempotency).
      schema:
        type: string
        minLength: 1
        maxLength: 255
  schemas:
    PhoneSettingsUpdate:
      type: object
      properties:
        verification:
          type: object
          properties:
            code_length:
              type: integer
              description: 4 to 10 digits.
              minimum: 4
              maximum: 10
              example: 6
            valid_minutes:
              type: integer
              description: 1 to 15.
              minimum: 1
              maximum: 15
            max_attempts:
              type: integer
              description: >-
                Maximum wrong code entries per standalone verification. The
                default is 5.
              minimum: 3
              maximum: 10
            resend_limit:
              type: integer
              description: 1 to 10 per hour.
              minimum: 1
              maximum: 10
            cancel_on_resend:
              type: boolean
              description: A new code cancels the previous one.
            channel_order:
              type: array
              items:
                type: string
                description: A verification channel.
                enum:
                  - silent
                  - sms
                  - whatsapp
                  - telegram
                  - voice
                  - rcs
                  - viber
                  - zalo
                  - email
                  - push
                  - totp
                  - passkey
              description: The default order.
            routing:
              type: string
              description: >-
                conversion picks the route and channel with the best conversion
                per country over 7 days; fixed keeps your order.
              enum:
                - conversion
                - fixed
              example: conversion
            voice:
              type: object
              properties:
                tts_voice:
                  type: string
                  description: >-
                    The identifier of the voice that reads verification codes
                    aloud.
                speech_rate:
                  type: number
                  description: '0.8 to 1.2: slower reads each digit more clearly.'
                  minimum: 0.8
                  maximum: 1.2
              description: Voice policy.
            email:
              type: object
              properties:
                domain_id:
                  type: string
                  description: The verified domain email codes go out from.
                from_address:
                  type: string
                  description: The address on that domain.
                from_name:
                  type: string
                  description: The name people see.
              description: Email policy.
          description: Each property you supply replaces its saved value.
        messages:
          type: object
          properties:
            retention_days:
              type: integer
              description: 7, 30, 90 or 365.
              enum:
                - 7
                - 30
                - 90
                - 365
          description: Message settings to change.
        data_region:
          type: string
          description: The data region preference to save for the application.
          enum:
            - eu
            - us
      description: >-
        The application settings to update. Omit a section to keep its current
        settings.
      example:
        verification:
          code_length: 6
          routing: conversion
        messages:
          retention_days: 30
    PhoneSettingsUpdateResponse:
      type: object
      properties:
        updated_at:
          type: string
          description: When the settings changed.
          format: date-time
          example: '2026-11-21T10:00:00Z'
    RateLimitBudgetError:
      type: object
      description: >-
        Returned only for a rate-limit middleware budget refusal. Other 429
        errors, including idempotency conflicts and endpoint-specific caps, do
        not promise these metadata fields.
      required:
        - detail
        - reference
        - limit
        - remaining
        - reset
        - window_seconds
      properties:
        detail:
          type: string
          description: Existing human-readable budget refusal message.
        reference:
          type: string
          pattern: ^RL-[0-9a-f]{32}$
          description: >-
            Opaque support reference: RL- followed by 32 lowercase UUID
            hexadecimal characters.
        limit:
          type: integer
          description: Budget for the exceeded scope; equals X-RateLimit-Limit.
        remaining:
          type: integer
          minimum: 0
          description: Remaining budget, clamped to zero; equals X-RateLimit-Remaining.
        reset:
          type: integer
          format: int64
          description: Window reset time in Unix seconds; equals X-RateLimit-Reset.
        window_seconds:
          type: integer
          description: >-
            Fixed-window duration in seconds, not the remaining wait. Honor
            Retry-After before retrying.
      example:
        detail: >-
          Write request rate limit exceeded. You can make up to 300 requests per
          minute.
        reference: RL-00000000000040008000000000000001
        limit: 300
        remaining: 0
        reset: 1794358860
        window_seconds: 60
  responses:
    RateLimitedWrite:
      description: >-
        The shared write limit of 300 requests per minute per API key was
        exceeded. Honor `Retry-After` before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitBudgetError'
          example:
            detail: >-
              Write request rate limit exceeded. You can make up to 300 requests
              per minute.
            reference: RL-00000000000040008000000000000001
            limit: 300
            remaining: 0
            reset: 1794358860
            window_seconds: 60
      headers:
        Retry-After:
          $ref: '#/components/headers/BudgetRetryAfter'
        X-RateLimit-Scope:
          $ref: '#/components/headers/BudgetXRateLimitScope'
        X-RateLimit-Limit:
          $ref: '#/components/headers/BudgetXRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/BudgetXRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/BudgetXRateLimitReset'
  headers:
    BudgetRetryAfter:
      description: >-
        Seconds to wait, rounded up to the next window. Present on middleware
        budget refusals.
      schema:
        type: integer
    BudgetXRateLimitScope:
      description: >-
        The scope whose budget was exceeded. Present on middleware budget
        refusals.
      schema:
        type: string
    BudgetXRateLimitLimit:
      description: >-
        Budget for the exceeded scope; equals body limit. Present on middleware
        budget refusals.
      schema:
        type: integer
    BudgetXRateLimitRemaining:
      description: >-
        Remaining budget, clamped to zero; equals body remaining. Present on
        middleware budget refusals.
      schema:
        type: integer
    BudgetXRateLimitReset:
      description: >-
        Reset time in Unix seconds; equals body reset. Present on middleware
        budget refusals.
      schema:
        type: integer
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your application's API key, from Developers -> API keys in the Business
        Console. The primary key has full access. A named key can be scoped:
        none, read or write per resource, limited to some workflows or to
        approved sessions, to a list of IP addresses, and to an expiry date. 401
        means the key is wrong, revoked or expired; 403 means no key was sent,
        the key has no access to this resource or action, or the request came
        from an address outside its IP list; 404 on a session route means the
        session is outside the key's workflows or statuses. A key without media
        access receives image, video and PDF URLs as null, and a key without
        sessions write receives session links and tokens as null. See
        https://docs.didit.me/console/api-keys.

````

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