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

# Create a new organization and issue its API key.



## OpenAPI

````yaml /openapi/v1.yaml post /v1/createOrganization
openapi: 3.1.0
info:
  title: ConchAI B2B API (v1)
  version: 1.0.0
  description: |
    OpenAPI contract for the latest business-facing endpoints under /v1.
servers:
  - url: https://api.getconch.ai
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Organization
  - name: Sources
  - name: Flashcards
  - name: Mindmaps
  - name: Quizzes
paths:
  /v1/createOrganization:
    post:
      tags:
        - Organization
      summary: Create a new organization and issue its API key.
      operationId: createOrganization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrganizationRequest'
      responses:
        '201':
          description: Organization and API key created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrganizationResponse'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
      security:
        - AdminKeyAuth: []
components:
  schemas:
    CreateOrganizationRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        url:
          type: string
          format: uri
      required:
        - name
        - url
    CreateOrganizationResponse:
      type: object
      properties:
        organization:
          $ref: '#/components/schemas/Organization'
        apiKey:
          $ref: '#/components/schemas/ApiKeyRecord'
      required:
        - organization
        - apiKey
    Organization:
      type: object
      properties:
        _id:
          type: string
        name:
          type: string
        url:
          type: string
          format: uri
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - _id
        - name
        - url
    ApiKeyRecord:
      type: object
      properties:
        _id:
          type: string
        apiKey:
          type: string
        organizationId:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - _id
        - apiKey
        - organizationId
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  responses:
    BadRequestResponse:
      description: Invalid request payload.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnauthorizedResponse:
      description: Missing or invalid authentication credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerErrorResponse:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Business API key issued per organization.
    AdminKeyAuth:
      type: apiKey
      in: header
      name: admin-key
      description: Admin key used only for organization bootstrap.

````