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

# Discover the authorized project

> Returns the same connection context as the project-bound route, using the project already selected during OAuth consent or bound to the API key. Never lists other projects. Never cached.



## OpenAPI

````yaml /openapi.json get /connection
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: []
paths:
  /connection:
    get:
      summary: Discover the authorized project
      description: >-
        Returns the same connection context as the project-bound route, using
        the project already selected during OAuth consent or bound to the API
        key. Never lists other projects. Never cached.
      operationId: getAuthorizedConnection
      responses:
        '200':
          description: Connection context
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ConnectionContextData'
                  meta:
                    $ref: '#/components/schemas/Meta'
                required:
                  - data
                  - meta
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '429':
          $ref: '#/components/responses/RateLimitExceededError'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - bearerAuth: []
        - oauthBearer: []
components:
  schemas:
    ConnectionContextData:
      type: object
      required:
        - project
        - credential
        - scopes
        - features
        - checkedAt
      properties:
        project:
          type: object
          required:
            - id
            - name
            - paused
            - domains
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
            paused:
              type: boolean
              description: >-
                A paused project gives credentials read access only until it is
                resumed in the app.
            domains:
              type: array
              maxItems: 500
              description: >-
                The project's own domains, ordered by domain. Competitor domains
                are not included.
              items:
                type: object
                required:
                  - domain
                  - type
                properties:
                  domain:
                    type: string
                    description: >-
                      Canonical host, with a path when the property lives under
                      one.
                  type:
                    type: string
                    enum:
                      - docs
                      - api-ref
                      - blog
                      - github
                      - package
                      - tutorial
                      - changelog
                      - community
                      - forum
                      - qna
                      - social
                      - review
                      - examples
                      - media
                      - home
                      - other
        credential:
          type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - api_key
                - oauth
        scopes:
          type: array
          items:
            type: string
          description: >-
            Scopes the credential may call now, sorted. A paused project keeps
            only read scopes; an OAuth connection keeps only what both its
            approved grant and the user's current team permissions allow.
        features:
          type: object
          description: >-
            Account features that gate operations independently of scopes. A
            scope whose feature is off still refuses.
          required:
            - attributeMatch
            - agentPicks
            - contentDrafts
            - mcpCodeMode
            - mcpCodeModeWrites
          properties:
            attributeMatch:
              type: boolean
              description: Positioning and Accuracy reads.
            agentPicks:
              type: boolean
              description: Agent Picks reads and settings.
            contentDrafts:
              type: boolean
              description: >-
                Action draft reads and starts. Some Agent Picks actions can be
                drafted without it.
            mcpCodeMode:
              type: boolean
              description: MCP code mode and its execution receipts.
            mcpCodeModeWrites:
              type: boolean
              description: >-
                Approved project writes in MCP code mode. False when mcpCodeMode
                is off.
        checkedAt:
          type: string
          format: date-time
          description: When access was read.
    Meta:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
        projectId:
          type: string
          format: uuid
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        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 refusal, such as shortfall_credits
            when an Agent Picks start is refused for insufficient_credits.
        status:
          type: integer
      required:
        - error
        - message
        - status
  responses:
    UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ForbiddenError:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimitExceededError:
      description: Rate limit exceeded
      headers:
        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'
    ServerError:
      description: Internal server error
      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.
    oauthBearer:
      type: http
      scheme: bearer
      description: >-
        Project-granted OAuth access token from the authorization server
        advertised at /.well-known/oauth-protected-resource/api/v2. Uses the
        same browser consent and current project permissions as MCP. Only
        operations explicitly listing oauthBearer accept these tokens.

````

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