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

# List user's organizations

> Lists all organizations the user is a member of, optionally filtered to show only owned organizations when `owned=true`.

**Sorting:**
Results are sorted alphabetically by organization name.

**Information included:**
Each organization includes:
- Basic metadata
- A flag indicating if it's in a warning group (quota breach or payment issue)

**Returns:**
An empty list if the user is not a member of any organizations.




## OpenAPI

````yaml get /organizations
openapi: 3.0.3
info:
  title: Diversion Core API
  description: >-
    Definition of the Core API used to access low-level functionality of
    Diversion
  version: 0.2.0
servers:
  - url: https://api.diversion.dev/v0
    description: Base endpoint
security: []
paths:
  /organizations:
    get:
      tags:
        - Organization Management
      summary: List user's organizations
      description: >
        Lists all organizations the user is a member of, optionally filtered to
        show only owned organizations when `owned=true`.


        **Sorting:**

        Results are sorted alphabetically by organization name.


        **Information included:**

        Each organization includes:

        - Basic metadata

        - A flag indicating if it's in a warning group (quota breach or payment
        issue)


        **Returns:**

        An empty list if the user is not a member of any organizations.
      operationId: src.handlersv2.organization.list_all
      parameters:
        - in: query
          name: owned
          description: Filter by organizations owned by the user or not.
          schema:
            type: boolean
      responses:
        '200':
          $ref: '#/components/responses/OrganizationList'
        default:
          $ref: '#/components/responses/Error'
      security:
        - OAuth2:
            - coreapi/read
        - OAuth2:
            - coreapi/write
components:
  responses:
    OrganizationList:
      description: Success
      content:
        application/json:
          schema:
            type: object
            properties:
              object:
                type: string
                enum:
                  - Organization
              items:
                type: array
                items:
                  $ref: '#/components/schemas/Organization'
            required:
              - object
              - items
    Error:
      description: An error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Organization:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the organization
          example: org_123456
        name:
          type: string
          description: Name of the organization
          example: Example Organization
        description:
          type: string
          description: Description of the organization
          example: This is an example organization.
        owner_id:
          type: string
          description: ID of the user who owns the organization
          example: user_123456
        total_storage:
          type: integer
          description: Total storage allocated to the organization
          example: 1000000
        members:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationMember'
          description: List of members in the organization
        invites:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationInvite'
          description: List of invites sent by the organization
        in_warning_group:
          type: boolean
          description: Whether the organization is in the warning group
          example: true
      required:
        - id
        - name
        - owner_id
        - total_storage
    Error:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
        detail:
          type: string
        title:
          type: string
        type:
          type: string
      required:
        - status
        - detail
    OrganizationMember:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the organization member
          example: member_123456
        user_id:
          type: string
          description: ID of the user who is a member of the organization
          example: user_123456
        organization_id:
          type: string
          description: ID of the organization
          example: org_123456
        role:
          $ref: '#/components/schemas/AccessMode'
      required:
        - id
        - user_id
        - organization_id
        - role
    OrganizationInvite:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier for the organization invite
          example: 123456
        organization_id:
          type: string
          description: ID of the organization
          example: org_123456
        organization_name:
          type: string
          description: Name of the organization
          example: Great Organization
        inviting_user_id:
          type: string
          description: ID of the user who is inviting to the organization
          example: user_123456
        inviting_user_name:
          type: string
          description: Name of the user who is inviting to the organization
          example: John Doe
        invited_email:
          type: string
          format: email
          description: Email of the user who is invited to the organization
          example: john.doe@example.com
        role:
          $ref: '#/components/schemas/AccessMode'
        status:
          $ref: '#/components/schemas/InviteStatus'
        created:
          type: string
          format: date-time
          description: Date and time when the invite was created
          example: '2023-01-01T00:00:00Z'
        expires:
          type: string
          format: date-time
          description: Date and time when the invite expires
          example: '2023-01-31T00:00:00Z'
    AccessMode:
      type: string
      enum:
        - READ
        - WRITE
        - ADMIN
        - OWNER
    InviteStatus:
      type: string
      enum:
        - PENDING
        - ACCEPTED
        - REJECTED
        - CANCELED
  securitySchemes:
    OAuth2:
      type: oauth2
      x-tokenInfoFunc: src.token_info.token_auth
      description: This API uses OAuth 2 with the implicit grant flow
      flows:
        implicit:
          authorizationUrl: https://auth.diversion.dev/oauth2/authorize
          scopes:
            coreapi/read: Operations with no possible side-effects
            coreapi/write: Modifying operations
            coreapi/admin: >-
              Organizational operations like adding a repo or changing repo
              properties

````