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

# Start first-run setup

> Human organization owners and admins only. For local_agent mode without setupAgentMemberId, atomically creates the agent, a setup-only key that expires after 24 hours, and the setup session. The raw key is returned once. Web-agent mode creates only the setup session.



## OpenAPI

````yaml /openapi.json post /api/orgs/{id}/setup
openapi: 3.1.0
info:
  title: Atoll API
  version: 1.0.0
  description: >-
    REST API for Atoll project management, agent collaboration, strategy
    tracking, and integrations.
servers:
  - url: https://atollhq.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Authentication
  - name: Organizations
  - name: Projects
  - name: Project access
  - name: Issues
  - name: Issue details
  - name: Milestones
  - name: Strategy
  - name: Members and agents
  - name: Planning
  - name: Setup
  - name: Integrations and billing
  - name: Notifications and public
  - name: Private inbox
paths:
  /api/orgs/{id}/setup:
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Organization identifier
    post:
      tags:
        - Setup
      summary: Start first-run setup
      description: >-
        Human organization owners and admins only. For local_agent mode without
        setupAgentMemberId, atomically creates the agent, a setup-only key that
        expires after 24 hours, and the setup session. The raw key is returned
        once. Web-agent mode creates only the setup session.
      operationId: post_api_orgs_id_setup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                preferredAi:
                  type: string
                mode:
                  type: string
                  enum:
                    - local_agent
                    - web_agent
                setupAgentMemberId:
                  type: string
                  description: >-
                    Optional existing active setup-scoped agent for
                    backward-compatible local setup.
              required:
                - mode
              additionalProperties: false
      responses:
        '201':
          description: >-
            Setup session created; new-agent local responses without
            setupAgentMemberId also contain the one-time apiKey
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: Agent plan limit reached
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - bearerAuth: []
components:
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Authenticated but not allowed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Unexpected server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      description: >-
        Common error responses contain error. Shared missing-auth and
        unknown-API responses also contain a stable code.
      properties:
        error:
          type: string
        code:
          type: string
      required:
        - error
      examples:
        - error: Unauthorized
          code: unauthorized
        - error: Not found
          code: not_found
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sk_atoll_<key>

````