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

# Get AI Traffic sensors

> Returns the status of six AI Traffic sensors (edge middleware, snippet, Cloudflare, Vercel drain, Search Console and GA4): whether each is connected, the measurement verdict for a set-up sensor, when DevTune last accepted a measurement from it, and why its connection is broken. Lists Cloudflare, Search Console and GA4 connections by id, with Search Console and GA4 connect links for a person to open. Without AI Traffic Events, returns only the Search Console, GA4 and Vercel drain sensors that still have a connection, and 403 when none do. Never returns keys or tokens. Requires the `traffic.read` scope.



## OpenAPI

````yaml /openapi.json get /projects/{projectId}/traffic/sensors
openapi: 3.1.0
info:
  title: DevTune API
  version: 2.0.0
  description: >-
    API for programmatic access to your AI visibility data, webhook
    subscriptions, and automation workflows. Use this API to integrate DevTune
    data into CI/CD pipelines, BI tools, AI agents, and operational systems.
servers:
  - url: https://devtune.ai/api/v2
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Connection and usage
    description: >-
      The project a credential is bound to, its scopes and features, usage, and
      code-mode receipts.
  - name: Setup
    description: >-
      Brands, domains, brand terms, platforms, content sources and pausing a
      project.
  - name: Prompts and topics
    description: Tracked prompts, their topics, and prompt-set analysis.
  - name: Visibility
    description: >-
      Visibility metrics, AI answers, sentiment, competitive position and the
      project timeline.
  - name: Citations
    description: >-
      Citation statistics, the most-cited domains and pages, and cited lookalike
      sites.
  - name: Positioning
    description: How well AI answers match your positioning statements.
  - name: Accuracy
    description: Claims AI answers make about your brand, and contradictions.
  - name: Content gaps
    description: Topics, sources and brands where competitors are cited.
  - name: AI Traffic
    description: >-
      AI referrals, answer fetches, crawls, 404 Demand, Direct lift and Search
      Console totals.
  - name: Adoption
    description: npm downloads and GitHub stars for project domains.
  - name: Audit and pages
    description: Audit findings, Google eligibility, page metrics, and locked pages.
  - name: Actions
    description: Suggested and accepted work, briefs, drafts and pull requests.
  - name: Results
    description: Content changes, measured results and what works.
  - name: Agents
    description: Managed agents, their schedules and runs.
  - name: Dex
    description: Private Dex conversations, specialist handoffs and memory.
  - name: Agent Picks
    description: Agent Picks setup, tests, schedules and results.
  - name: Library and Knowledge
    description: Library items and the Knowledge Profile.
  - name: Webhooks
    description: Webhook subscriptions and signing secrets.
  - name: Agent registration
    description: Setup drafts for an unclaimed agent registration.
paths:
  /projects/{projectId}/traffic/sensors:
    get:
      tags:
        - AI Traffic
      summary: Get AI Traffic sensors
      description: >-
        Returns the status of six AI Traffic sensors (edge middleware, snippet,
        Cloudflare, Vercel drain, Search Console and GA4): whether each is
        connected, the measurement verdict for a set-up sensor, when DevTune
        last accepted a measurement from it, and why its connection is broken.
        Lists Cloudflare, Search Console and GA4 connections by id, with Search
        Console and GA4 connect links for a person to open. Without AI Traffic
        Events, returns only the Search Console, GA4 and Vercel drain sensors
        that still have a connection, and 403 when none do. Never returns keys
        or tokens. Requires the `traffic.read` scope.
      operationId: getTrafficSensors
      parameters:
        - name: projectId
          in: path
          required: true
          description: >-
            The project the credential is bound to. Read it from GET
            /connection.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: AI Traffic sensors
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/TrafficSensorsData'
                  meta:
                    $ref: '#/components/schemas/Meta'
                required:
                  - data
                  - meta
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '429':
          $ref: '#/components/responses/RateLimitExceededError'
components:
  schemas:
    TrafficSensorsData:
      type: object
      additionalProperties: false
      required:
        - asOf
        - sensors
      properties:
        asOf:
          type: string
          format: date-time
          description: The instant each status was judged at.
        sensors:
          type: array
          description: >-
            These six sensors, in this order: edge_middleware, snippet,
            cloudflare, vercel_drain, search_console, ga4. PostHog and GitBook
            are not included. Without AI Traffic Events, only the
            search_console, ga4 and vercel_drain sensors that still have a
            connection, so a person can disconnect them.
          items:
            $ref: '#/components/schemas/TrafficSensor'
    Meta:
      type: object
      description: Sent beside data on every successful response that returns data.
      properties:
        timestamp:
          type: string
          format: date-time
          description: When the response was produced.
        projectId:
          type: string
          format: uuid
    TrafficSensor:
      type: object
      additionalProperties: false
      required:
        - sensor
        - connected
        - status
        - lastSeenAt
        - brokenReason
      properties:
        sensor:
          type: string
          enum:
            - edge_middleware
            - snippet
            - cloudflare
            - vercel_drain
            - search_console
            - ga4
        connected:
          type: boolean
          description: >-
            Whether the sensor is set up and switched on. The snippet and edge
            middleware count as connected only while measuring. A Vercel drain
            whose hosts another sensor counts is connected with status
            not_counting, and counts only visits tagged with an AI utm_source on
            them.
        status:
          type: string
          enum:
            - not_connected
            - inactive
            - active
            - stale
            - configured
            - paused
            - needs_reconnect
            - error
            - unknown
            - pending
            - not_counting
          description: >-
            For a set-up sensor, the measurement verdict Project Home and the
            traffic summary report: active is measuring, or healthy with no
            recent AI traffic; stale has no measurement confirmed recently;
            configured is set up with no measurement confirmed yet. inactive is
            the snippet or middleware switched off; pending is a Vercel drain
            waiting for projects to be chosen; not_counting is a connected drain
            whose hosts another sensor counts, so on them it counts only visits
            tagged with an AI utm_source. The edge middleware is not_connected
            until it has sent a measurement; the Vercel drain is unknown when
            its state could not be read.
        lastSeenAt:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When DevTune last accepted a measurement from this sensor, counting
            only connections and sources measuring now: null when none is
            (paused, broken or switched off, or a Cloudflare connection whose
            source is no longer active), while each connection keeps its
            lastSyncedAt. A sensor with one connection measuring and another
            broken reports the broken status with a date. For the Vercel drain,
            when it last received crawler data.
        brokenReason:
          type:
            - string
            - 'null'
          enum:
            - reconnect_required
            - sync_failed
            - null
          description: >-
            From the connection status: reconnect_required when credentials need
            reconnecting, sync_failed when a connection is in error, otherwise
            null. An active connection whose last sync failed shows it only as
            that connection's syncFailed.
        connections:
          type: array
          description: Cloudflare, Search Console and GA4 connections.
          items:
            $ref: '#/components/schemas/TrafficSensorConnection'
        connectUrl:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            Search Console and GA4: starts Google consent through
            /api/gsc/oauth/start or /api/ga4/oauth/start, then returns to AI
            Traffic settings. Hand it to a person who can manage DevTune on the
            account: a member without that permission is refused. Null when the
            plan cannot connect it, the account has no slug, or the app's site
            URL is not set.
    Error:
      type: object
      properties:
        error:
          type: string
          description: >-
            Machine-readable error code, such as bad_request, unauthorized,
            forbidden, not_found, conflict, payment_required,
            rate_limit_exceeded or internal_error. Some endpoints return their
            own codes, listed in their descriptions.
        message:
          type: string
          description: >-
            What went wrong, for a person to read. Do not parse it; use error
            and reason.
        reason:
          type: string
          description: >-
            Why the request was refused, for an error with more than one cause,
            such as a refused content-draft start.
        details:
          type: object
          additionalProperties: true
          description: >-
            Machine-readable facts about the failure or refusal, such as
            retryable or shortfall_credits.
          properties:
            retryable:
              type: boolean
              description: >-
                Read this field before retrying. Present on every 5xx and 429
                response: true when another attempt may succeed, false for a
                permanent refusal even on a 5xx. Other refusals may also provide
                this field.
            retryAfterSeconds:
              type: integer
              minimum: 1
              description: >-
                Seconds to wait when retryable is true on a 429 or 503 response,
                also sent in Retry-After. Uses the provider retry time or
                limiter reset when available; otherwise 60 seconds for 429 and
                GitHub throttles or 30 seconds for other 503 responses. GitHub
                secondary limits wait at least 60 seconds.
        status:
          type: integer
          description: The HTTP status code, repeated in the body.
      required:
        - error
        - message
        - status
    TrafficSensorConnection:
      type: object
      additionalProperties: false
      required:
        - id
        - domain
        - status
        - lastSyncedAt
        - syncFailed
      properties:
        id:
          type: string
          format: uuid
        domain:
          type:
            - string
            - 'null'
        status:
          type: string
          description: >-
            The connection row status, such as active, paused, needs_reauth or
            error.
        lastSyncedAt:
          type:
            - string
            - 'null'
          format: date-time
        syncFailed:
          type: boolean
          description: Whether the last sync failed, including on an active connection.
        sourceId:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            Cloudflare only: the source (zone) the hostname is pulled through.
            Pass it to saveCloudflareHostname to add another hostname on the
            same zone without saving the token again. Null when the hostname has
            no source.
  responses:
    UnauthorizedError:
      description: >-
        The request has no valid credential: the Authorization header is missing
        or malformed, or the API key or OAuth token is invalid, expired or
        revoked. Send `Authorization: Bearer <API key>` with an active key, or
        sign in again to get a new OAuth token. See
        [Errors](/api-reference/errors).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ForbiddenError:
      description: >-
        The credential is valid but can't make this request. The message says
        which cause applies: the key or sign-in lacks the scope this endpoint
        requires (named in the message), it belongs to another project, the plan
        doesn't include API access or this feature, the project is paused (a
        paused project keeps only read scopes and setup.write), or the member a
        write acts as no longer has the role it needs. Read `GET
        /projects/{projectId}/connection` for the credential's current scopes
        and features, then use a key that has the scope, sign in again and
        approve it, or upgrade the plan. See [Errors](/api-reference/errors).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimitExceededError:
      description: >-
        Too many requests from this credential in the current window. The
        request was refused before it took effect, so it is safe to retry: wait
        the seconds in Retry-After, then send it again. Endpoints that start
        agent runs have a stricter limit. See [Rate
        limits](/api-reference/rate-limits).
      headers:
        Retry-After:
          description: Seconds to wait before retrying a 429 or retryable 503 response.
          schema:
            type: integer
            minimum: 1
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  headers:
    X-RateLimit-Limit:
      description: Maximum requests per window
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests remaining in current window
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Unix timestamp when the window resets
      schema:
        type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key with dtk_live_ prefix. Obtain it from API Keys in the account
        sidebar. New keys start with all supported scopes selected for the
        chosen project, and you can narrow them to specific read/write scopes as
        needed.

````

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