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

# Full phone number intelligence lookup

> Full number intelligence (carrier / portability / SIM swap / roaming / live status) for a single E.164 phone number. Uses Devotel HLR as primary and Telnyx as fallback. When `fields=` is supplied (comma-separated or JSON array), the response also carries a `dataPackages` map keyed by the requested field names — each entry carries a discriminated `status` enum (`available` | `coming_soon` | `not_implemented` | `error`), a `reason` string, the intended `provider`, and an optional `data` payload when realised. The `number_reputation` field (Twilio Lookup v2 Number Reputation parity) returns a transparent 0-1 spam/fraud risk score in `data.risk_score` with a `data.risk_bucket` (`low`/`medium`/`high`), the `data.factors` that fired, and the contributing signals (`line_type`, `reachable`, `ported`, `sim_swapped`) — DERIVED from the same HLR/Telnyx upstream the lookup already fetched (flagged `data.derived: true`, NOT a paid reputation feed) whenever any usable HLR signal is present, and falls back to `not_implemented` only when no usable signal exists. `call_forwarding` returns a DERIVED, best-effort signal in `data.call_forwarding` (boolean) inferred from the HLR reachability dip — explicitly flagged `data.derived: true` with `data.confidence: low` (not an operator-asserted flag; the paid Telnyx forwarding add-on is not contracted) and falling back to `coming_soon` only when HLR returns no usable reachability signal. `cnam` and its Twilio-compat alias `caller_name` resolve against the Telnyx Lookup v2 caller-name dip and return `available` with the registered caller name, falling back to `coming_soon` only when Telnyx is not configured. Mirrors the Twilio Lookup v2 add-on selector.



## OpenAPI

````yaml /openapi.yaml get /api/v1/numbers/lookup/{phoneNumber}
openapi: 3.1.0
info:
  title: Devotel CPaaS API
  description: Orbit by Devotel — Communications Platform as a Service API
  version: 1.0.0
  contact:
    name: Devotel
    url: https://devotel.io
    email: support@devotel.io
  license:
    name: Proprietary
servers:
  - url: https://api.orbit.devotel.io
    description: Production
security:
  - Bearer: []
  - ApiKey: []
tags:
  - name: Messages
    description: >-
      Send and manage messages across all channels (SMS, WhatsApp, RCS, Email,
      Viber, etc.)
  - name: Fax
    description: >-
      List and track fax (MMS/T.38) transmissions on Telnyx-backed fax numbers
      (sending flows through the Messaging API)
  - name: Agents
    description: AI agent creation, configuration, and execution
  - name: Voice
    description: Voice calls, IVR, conferencing, and SIP trunking
  - name: OnCall
    description: On-call rotations and escalation policy planning for incident alerting
  - name: Webhooks
    description: Webhook endpoint management and delivery logs
  - name: Numbers
    description: Phone number search, provisioning, and configuration
  - name: Brand Identity
    description: >-
      Unified cross-channel brand trust posture (10DLC, toll-free, WhatsApp,
      RCS, branded calling, number KYC)
  - name: Contacts
    description: Contact management, segmentation, and lifecycle tracking
  - name: Campaigns
    description: Marketing campaign orchestration and analytics
  - name: Flows
    description: Automation flow builder and execution engine
  - name: Templates
    description: Message template management and approval workflows
  - name: Settings
    description: Organization, channel, and user preference settings
  - name: Verify
    description: OTP generation and verification across channels
  - name: Push
    description: Push notification delivery via FCM and APNs
  - name: Integrations
    description: Third-party service connections and OAuth management
  - name: CDP
    description: >-
      Customer Data Platform — activation surface (CRM object sync, streaming
      destinations, ad-audience activation)
  - name: Files
    description: >-
      Server-to-server media upload, listing, retrieval, and deletion
      (signed-URL backed)
  - name: Commerce
    description: >-
      Omnichannel conversational-commerce — persistent cart + checkout state
      machine, channel-agnostic hosted pay-by-link, native WhatsApp checkout,
      and AP2-style agent payment mandates.
  - name: Sync
    description: >-
      Real-time shared-state primitive (Twilio Sync parity) — Documents, Maps,
      Lists, and ephemeral Streams, with change events relayed over the
      /api/v1/ws/sync WebSocket gateway
paths:
  /api/v1/numbers/lookup/{phoneNumber}:
    get:
      tags:
        - Numbers
      summary: Full phone number intelligence lookup
      description: >-
        Full number intelligence (carrier / portability / SIM swap / roaming /
        live status) for a single E.164 phone number. Uses Devotel HLR as
        primary and Telnyx as fallback. When `fields=` is supplied
        (comma-separated or JSON array), the response also carries a
        `dataPackages` map keyed by the requested field names — each entry
        carries a discriminated `status` enum (`available` | `coming_soon` |
        `not_implemented` | `error`), a `reason` string, the intended
        `provider`, and an optional `data` payload when realised. The
        `number_reputation` field (Twilio Lookup v2 Number Reputation parity)
        returns a transparent 0-1 spam/fraud risk score in `data.risk_score`
        with a `data.risk_bucket` (`low`/`medium`/`high`), the `data.factors`
        that fired, and the contributing signals (`line_type`, `reachable`,
        `ported`, `sim_swapped`) — DERIVED from the same HLR/Telnyx upstream the
        lookup already fetched (flagged `data.derived: true`, NOT a paid
        reputation feed) whenever any usable HLR signal is present, and falls
        back to `not_implemented` only when no usable signal exists.
        `call_forwarding` returns a DERIVED, best-effort signal in
        `data.call_forwarding` (boolean) inferred from the HLR reachability dip
        — explicitly flagged `data.derived: true` with `data.confidence: low`
        (not an operator-asserted flag; the paid Telnyx forwarding add-on is not
        contracted) and falling back to `coming_soon` only when HLR returns no
        usable reachability signal. `cnam` and its Twilio-compat alias
        `caller_name` resolve against the Telnyx Lookup v2 caller-name dip and
        return `available` with the registered caller name, falling back to
        `coming_soon` only when Telnyx is not configured. Mirrors the Twilio
        Lookup v2 add-on selector.
      parameters:
        - schema:
            type: string
          examples:
            sim_swap,line_type_intelligence:
              value: sim_swap,line_type_intelligence
            caller_name,phone_number_quality_score,call_forwarding:
              value: caller_name,phone_number_quality_score,call_forwarding
          in: query
          name: fields
          required: false
          description: >-
            Optional Twilio-compat data-package selector. Comma-separated list
            of field names from the enumeration below (case-insensitive, deduped
            server-side, max 16 fields per request). Unknown field names reject
            the whole request with 400.
        - schema:
            type: string
          in: path
          name: phoneNumber
          required: true
          description: >-
            Phone number in E.164 format. URL-encode the leading `+` (or use
            `%2B`). The route also accepts an unencoded `+` for back-compat —
            decodeURIComponent runs server-side.
      responses:
        '200':
          description: Phone number intelligence result
          content:
            application/json:
              schema:
                type: object
                description: Phone number intelligence result
                properties:
                  data:
                    type: object
                    required:
                      - phoneNumber
                      - valid
                    properties:
                      phoneNumber:
                        type: string
                        description: Queried phone number in E.164 format.
                      valid:
                        type: boolean
                        description: Whether the number is a valid, allocated number.
                      callingCountryCode:
                        type: string
                        description: >-
                          ISO 3166-1 alpha-2 calling country code (e.g. `US`,
                          `TR`).
                      nationalFormat:
                        type: string
                        description: >-
                          Number formatted in national convention (e.g. `(555)
                          123-4567`).
                      carrier:
                        type: object
                        description: Carrier / operator information.
                        properties:
                          name:
                            type: string
                          type:
                            type: string
                            description: 'Line type: mobile / landline / voip / etc.'
                          mcc:
                            type: string
                            description: Mobile Country Code (ITU-T E.212).
                          mnc:
                            type: string
                            description: Mobile Network Code.
                      portability:
                        type: object
                        properties:
                          ported:
                            type: boolean
                          portedDate:
                            type: string
                            format: date-time
                            description: ISO 8601 date when ported, if available.
                          mnp_original_carrier:
                            type:
                              - 'null'
                              - string
                            description: >-
                              MNP recipient/original carrier the number was
                              ported FROM (carrier of record before the port).
                              `null` when the upstream HLR does not surface
                              ported-from carrier attribution. Devotel HLR
                              enrichment is the prerequisite to populate a
                              non-null value (see TODO PARITY-R1-009 in the
                              handler).
                          mnp_ported_at:
                            type:
                              - 'null'
                              - string
                            format: date-time
                            description: >-
                              ISO 8601 timestamp the number was ported, sourced
                              from the MNP/portability record. `null` when the
                              upstream does not return a port timestamp.
                              Distinct from `portedDate` (legacy alias kept for
                              back-compat).
                          originalCarrier:
                            type:
                              - 'null'
                              - string
                            description: >-
                              PARITY-R1-009 — name of the carrier the number was
                              ported AWAY FROM (the donor/original network),
                              when the HLR/Telnyx upstream supplies it.
                              Populated by the service layer from the Telnyx
                              Lookup v2 donor SPID; `null` when the upstream
                              omits it — never fabricated.
                          originalMnc:
                            type:
                              - 'null'
                              - string
                            description: >-
                              MNC the number was ported away from (E.212), when
                              the HLR upstream supplies it. `null` on the Telnyx
                              path (Lookup v2 exposes no donor-MNC field) —
                              never fabricated.
                      simSwap:
                        type: object
                        properties:
                          swapped:
                            type:
                              - 'null'
                              - boolean
                            description: >-
                              Whether the SIM was recently swapped; null if data
                              unavailable from the carrier.
                          lastSwapDate:
                            type:
                              - 'null'
                              - string
                          riskLevel:
                            type: string
                            enum:
                              - low
                              - medium
                              - high
                              - unknown
                      roaming:
                        type: object
                        description: >-
                          Roaming detection — Vonage/Sinch parity. Present only
                          when an HLR upstream answered with serving-network
                          MCC.
                        properties:
                          roaming:
                            type:
                              - 'null'
                              - boolean
                            description: >-
                              True when the serving network differs from the
                              home network; null means indeterminate (no signal
                              — do NOT treat as false).
                          servingMcc:
                            type:
                              - 'null'
                              - string
                          homeMcc:
                            type:
                              - 'null'
                              - string
                          servingCountry:
                            type:
                              - 'null'
                              - string
                            description: >-
                              ISO 3166-1 alpha-2 country currently serving the
                              SIM (e.g. `FR` when a US SIM is in France).
                      liveStatus:
                        type: string
                        enum:
                          - 'yes'
                          - 'no'
                          - na
                        description: >-
                          HLR live status — whether the device is currently
                          reachable on-network.
                      reachable:
                        type: boolean
                        description: 'Convenience boolean: `liveStatus === "yes"`.'
                      cached:
                        type: boolean
                      cachedAt:
                        type: string
                        format: date-time
                      available:
                        type: boolean
                        description: >-
                          Present (and `false`) only when the lookup service is
                          not configured (no DEVOTEL_TELNYX_API_KEY or HLR
                          provider).
                      message:
                        type: string
                        description: >-
                          Present only on the unconfigured negative-path
                          envelope.
                      dataPackages:
                        type: object
                        description: >-
                          Twilio Lookup v2 data-package realisation map. Present
                          only when the request supplied `?fields=`. Keys are
                          the requested field names (subset of the enum below);
                          values are per-field discriminated results.
                        additionalProperties:
                          type: object
                          required:
                            - status
                            - reason
                            - provider
                          properties:
                            status:
                              type: string
                              enum:
                                - available
                                - coming_soon
                                - not_implemented
                                - error
                              description: >-
                                `available` — provider returned real data (in
                                `data`). `coming_soon` — field is advertised in
                                the catalog but the upstream provider has not
                                yet been contracted (`reason:
                                "upstream_provider_not_contracted"`); replays
                                will not change the answer until the vendor work
                                lands. `not_implemented` — no provider has wired
                                this field yet (transient: a future route can
                                populate hints to flip to `available` without a
                                schema change). `error` — provider call failed
                                for this specific field; per-field error
                                isolation per Twilio Lookup v2.
                            reason:
                              type: string
                              description: >-
                                Operator-supplied reason string. For
                                `not_implemented` always
                                `vendor_integration_pending`. For `coming_soon`
                                always `upstream_provider_not_contracted`.
                            provider:
                              type: string
                              description: >-
                                Intended upstream provider for the field (e.g.
                                `devotel-hlr`, `telnyx`, `devotel-wholesale`).
                            data:
                              type: object
                              additionalProperties: true
                              description: >-
                                Realised payload when `status === "available"`.
                                Shape varies per-field — SDK consumers should
                                branch on the parent field name. Omitted for
                                `not_implemented` and `error`.
                        propertyNames:
                          enum:
                            - sim_swap
                            - cnam
                            - caller_name
                            - operator_name
                            - line_type_intelligence
                            - phone_number_quality_score
                            - call_forwarding
                            - number_reputation
                  meta:
                    type: object
                    properties:
                      request_id:
                        type: string
                      timestamp:
                        type: string
                        format: date-time
        '400':
          description: >-
            Validation error — phone number not in E.164, or `fields=` contains
            an unknown name / exceeds the 16-entry cap.
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Validation error — phone number not in E.164, or `fields=`
                  contains an unknown name / exceeds the 16-entry cap.
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      status:
                        type: integer
        '402':
          description: >-
            Insufficient wallet balance — tenant wallet does not cover the
            per-lookup unit price. Top up the wallet to retry.
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Insufficient wallet balance — tenant wallet does not cover the
                  per-lookup unit price. Top up the wallet to retry.
        '429':
          description: >-
            Rate-limited — either Fastify's per-tenant write limit OR the
            per-tenant daily cost-cap (audit #F3, default $50/day on upstream
            HLR/Telnyx queries).
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Rate-limited — either Fastify's per-tenant write limit OR the
                  per-tenant daily cost-cap (audit #F3, default $50/day on
                  upstream HLR/Telnyx queries).
        '502':
          description: Upstream lookup provider failed (HLR or Telnyx 5xx).
          content:
            application/json:
              schema:
                type: object
                description: Upstream lookup provider failed (HLR or Telnyx 5xx).
components:
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Dashboard JWT token from Clerk
    ApiKey:
      type: apiKey
      name: X-API-Key
      in: header
      description: Server-to-server API key (dv_live_sk_*)

````