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

# Organizations

> Get a paginated list of organizations for the authenticated user

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://app.codethreat.com/api/v1/organizations' \
    --header 'X-API-Key: YOUR_API_KEY'
  ```
</RequestExample>


## OpenAPI

````yaml GET /organizations
openapi: 3.0.3
info:
  title: CodeThreat API
  version: 1.0.0
  description: >-
    Autonomous AppSec Engineering Platform - Comprehensive REST API for security
    scanning, vulnerability management, and DevSecOps automation. Integrate
    CodeThreat's powerful security analysis into your CI/CD pipeline, CLI tools,
    and third-party applications.
  contact:
    name: CodeThreat Support
    url: https://codethreat.com/support
    email: support@codethreat.com
  license:
    name: Proprietary
    url: https://codethreat.com/terms
  termsOfService: https://codethreat.com/terms
servers:
  - url: https://app.codethreat.com/api/v1
    description: Production Server
  - url: http://localhost:3000/api/v1
    description: Development Server
security:
  - ApiKeyAuth: []
tags:
  - name: Organizations
    description: Organization management and configuration
  - name: Repositories
    description: Repository management and status tracking
  - name: Scans
    description: Security scan execution, monitoring, and results
  - name: Violations
    description: Security violation tracking and management
  - name: CLI
    description: CLI-specific endpoints for authentication and configuration
  - name: System
    description: Health checks and system status
paths:
  /organizations:
    get:
      tags:
        - Organizations
      summary: List organizations
      description: Get a paginated list of organizations for the authenticated user
      operationId: listOrganizations
      parameters:
        - name: page
          in: query
          description: Page number
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: limit
          in: query
          description: Items per page
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: search
          in: query
          description: Search query
          schema:
            type: string
        - name: status
          in: query
          description: Filter by status
          schema:
            type: string
            enum:
              - active
              - inactive
        - name: sortBy
          in: query
          description: Sort field
          schema:
            type: string
            enum:
              - name
              - createdAt
              - updatedAt
            default: updatedAt
        - name: sortOrder
          in: query
          description: Sort order
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationListResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '429':
          $ref: '#/components/responses/RateLimitError'
components:
  schemas:
    OrganizationListResponse:
      allOf:
        - $ref: '#/components/schemas/ApiResponse'
        - type: object
          properties:
            data:
              type: array
              items:
                $ref: '#/components/schemas/Organization'
    ApiResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
        pagination:
          $ref: '#/components/schemas/Pagination'
        meta:
          $ref: '#/components/schemas/ResponseMeta'
    Organization:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        planType:
          type: string
          enum:
            - FREE
            - PRO
        isPersonal:
          type: boolean
        usageBalance:
          type: number
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - UNAUTHORIZED
                - FORBIDDEN
                - INVALID_API_KEY
                - EXPIRED_API_KEY
                - INSUFFICIENT_SCOPE
                - VALIDATION_ERROR
                - INVALID_INPUT
                - NOT_FOUND
                - ALREADY_EXISTS
                - CONFLICT
                - RATE_LIMIT_EXCEEDED
                - INTERNAL_ERROR
                - SERVICE_UNAVAILABLE
                - TIMEOUT
            message:
              type: string
            details:
              type: object
        meta:
          $ref: '#/components/schemas/ResponseMeta'
    Pagination:
      type: object
      properties:
        page:
          type: integer
          minimum: 1
        limit:
          type: integer
          minimum: 1
          maximum: 100
        total:
          type: integer
          minimum: 0
        totalPages:
          type: integer
          minimum: 0
        hasNext:
          type: boolean
        hasPrev:
          type: boolean
    ResponseMeta:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
        version:
          type: string
        requestId:
          type: string
        organizationId:
          type: string
  responses:
    UnauthorizedError:
      description: Authentication required or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: UNAUTHORIZED
              message: Authentication required. Please provide a valid API key.
            meta:
              timestamp: '2025-01-15T10:30:00Z'
              version: v1
              requestId: req_123456
    RateLimitError:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: RATE_LIMIT_EXCEEDED
              message: Rate limit exceeded. Please try again later.
              details:
                retryAfter: 60
            meta:
              timestamp: '2025-01-15T10:30:00Z'
              version: v1
              requestId: req_123456
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication. Generate from your organization settings.

````