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

# Get Agent Scan Limit

> Retrieves the scan limit and current usage for an organization. Each organization has a configurable limit on the number of repositories that can be scanned using agent analysis. If no limit record exists, a default limit is created automatically.



## OpenAPI

````yaml /openapi.json post /api/analysis/agents/scan/limit
openapi: 3.0.3
info:
  title: CodeAnt AI API
  description: >-
    API for code analysis (SAST, SCA, secrets, IaC) and developer productivity
    metrics. Supports GitHub, GitLab, Bitbucket, and Azure DevOps.
  version: 1.0.0
servers:
  - url: https://api.codeant.ai
    description: Production server
security: []
tags:
  - name: Analysis
    description: Code analysis operations
  - name: Agent Analysis
    description: >-
      AI-powered agent analysis operations. Uses LLM-based code exploration
      agents to perform deep security threat hunting, bug finding, and custom
      analysis with reflection-based false positive filtering.
  - name: Developer Metrics — Teams
    description: >-
      Manage developer teams: create, update, delete teams and manage team
      membership. Teams are used to organize developers and scope metrics.
  - name: Developer Metrics
    description: >-
      Developer productivity and activity metrics: active developers, PR
      throughput, individual comparisons, and AI-generated summaries. All
      endpoints support GitHub, GitLab, Bitbucket, and Azure DevOps.
paths:
  /api/analysis/agents/scan/limit:
    post:
      tags:
        - Agent Analysis
      summary: Get Agent Scan Limit
      description: >-
        Retrieves the scan limit and current usage for an organization. Each
        organization has a configurable limit on the number of repositories that
        can be scanned using agent analysis. If no limit record exists, a
        default limit is created automatically.
      operationId: getAgentScanLimit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentScanLimitRequest'
            example:
              organization_id: my-org
              service: github
      responses:
        '200':
          description: Scan limit retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentScanLimitResponse'
              examples:
                existing:
                  summary: Existing organization with usage
                  value:
                    limit: 5
                    scans_used: 2
                new:
                  summary: Newly created limit record
                  value:
                    limit: 1
                    scans_used: 0
                    status: pending
        '400':
          description: Missing or invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Missing or invalid organization_id parameter
        '500':
          description: Failed to retrieve scan limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Failed to retrieve scan limit
components:
  schemas:
    AgentScanLimitRequest:
      type: object
      required:
        - organization_id
        - service
      properties:
        organization_id:
          type: string
          description: Organization identifier on the VCS platform
          example: my-org
        service:
          type: string
          description: Version control service provider
          enum:
            - github
            - gitlab
            - azuredevops
            - bitbucket
          example: github
        github_base_url:
          type: string
          description: Base URL for GitHub (for GitHub Enterprise Server)
          default: https://github.com
        gitlab_base_url:
          type: string
          description: Base URL for GitLab (for self-hosted instances)
          default: https://gitlab.com
        azureDevopsBaseUrl:
          type: string
          description: Base URL for Azure DevOps (for self-hosted instances)
          default: https://dev.azure.com
        bitbucket_base_url:
          type: string
          description: Base URL for Bitbucket (for Bitbucket Data Center)
          default: https://api.bitbucket.org/2.0
    AgentScanLimitResponse:
      type: object
      properties:
        limit:
          type: integer
          description: Maximum number of repositories that can be scanned
          example: 5
        scans_used:
          type: integer
          description: Number of unique repositories currently scanned
          example: 2
        status:
          type: string
          description: Only present when a new limit record was just created
          enum:
            - pending
          example: pending
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message

````