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

# Create Website

> Creates a new website in your organization. The website will be created with onboarding step 1, ready for further configuration. **Partner integrations** may include an `external_id` to map their own identifier onto the new Athena website.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/websites
openapi: 3.1.0
info:
  title: AthenaHQ API
  description: >-
    AthenaHQ API provides programmatic access to manage your websites and
    prompts for AI-powered content optimization.
  version: 1.0.0
  contact:
    email: support@athenahq.ai
servers:
  - url: https://api.athenahq.ai
    description: Production server
security:
  - apiKey: []
tags:
  - name: Basics
    description: Core API operations for managing websites and prompts
  - name: Metrics
    description: Metrics and analytics endpoints for tracking AI visibility
  - name: Billing
    description: Billing and credits endpoints for managing usage
  - name: Team Management
    description: Endpoints for managing team members and invitations
  - name: Groups
    description: Endpoints for managing groups of websites
  - name: Content
    description: >-
      Endpoints for accessing Content Hub data — tabs, tracked URLs, and per-URL
      prompt breakdowns.
  - name: Pitch Workspace
    description: >-
      Endpoints for accessing pitch workspace reports — org-scoped pitch runs
      with competitors, prompts, attributes, and aggregate metrics.
  - name: Knowledge Base
    description: >-
      Endpoints for reading the brand Knowledge Base — approved brand facts and
      the pillars that organize them.
paths:
  /api/v1/websites:
    post:
      tags:
        - Basics
      summary: Create Website
      description: >-
        Creates a new website in your organization. The website will be created
        with onboarding step 1, ready for further configuration. **Partner
        integrations** may include an `external_id` to map their own identifier
        onto the new Athena website.
      operationId: createWebsite
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebsiteRequest'
      responses:
        '201':
          description: >-
            Website created successfully. Partner responses include an
            `externalId` field (string or `null`); direct-customer responses
            omit the field entirely.
          content:
            application/json:
              schema:
                type: object
                properties:
                  website:
                    $ref: '#/components/schemas/CreatedWebsite'
                  billingEntityCreated:
                    type: boolean
                    description: >-
                      Whether the billing entity exists after provisioning. When
                      false, entity creation failed even after a retry: the
                      website exists but has no credits, and setting credits
                      fails with a 400 until it is repaired. Contact AthenaHQ
                      support in that case.
                required:
                  - website
                  - billingEntityCreated
              example:
                website:
                  id: 123e4567-e89b-12d3-a456-426614174000
                  websiteUrl: example.com
                  orgId: 987e6543-e21b-12d3-a456-426614174000
                  onboardingStep: 1
                billingEntityCreated: true
        '400':
          description: Bad request - Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_json:
                  value:
                    error: Invalid JSON in request body
                missing_url:
                  value:
                    error: 'url: Required'
                invalid_url:
                  value:
                    error: 'url: Invalid url'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Forbidden - `external_id` is partner-only; non-partner API keys
            cannot set it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: 'Forbidden: partner API key required'
        '409':
          description: >-
            Conflict - (partners only) the supplied `external_id` is already
            mapped to another website.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalIdConflictError'
              examples:
                external_id_conflict:
                  summary: Partner external_id already mapped
                  value:
                    error: external_id_conflict
                    message: external_id ws_a7f3b2c9 is already mapped to a website
                    existing:
                      id: 123e4567-e89b-12d3-a456-426614174000
                      externalId: ws_a7f3b2c9
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    CreateWebsiteRequest:
      type: object
      description: Request body for creating a new website
      required:
        - url
      properties:
        url:
          type: string
          format: uri
          description: >-
            The URL of the website to create. Protocol (http/https) and trailing
            slashes will be automatically removed.
          example: https://example.com
        external_id:
          type: string
          minLength: 1
          description: >-
            **Partner-only.** An identifier from your own system to map to this
            Athena website. Accepted only when authenticating with an API key
            for an organization flagged as a partner. Sending this field as a
            direct customer returns `403 Forbidden`. Must be unique per resource
            type within your organization — duplicates return `409` with the
            existing resource in the payload.
          example: ws_a7f3b2c9
    CreatedWebsite:
      type: object
      description: A newly created website resource
      required:
        - id
        - websiteUrl
        - orgId
        - onboardingStep
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the website
          example: 123e4567-e89b-12d3-a456-426614174000
        websiteUrl:
          type: string
          description: The cleaned URL of the website (without protocol or trailing slash)
          example: example.com
        orgId:
          type: string
          format: uuid
          description: The organization ID the website belongs to
          example: 987e6543-e21b-12d3-a456-426614174000
        onboardingStep:
          type: integer
          description: The current onboarding step (starts at 1)
          example: 1
        externalId:
          type: string
          nullable: true
          description: >-
            **Partner-only.** Echoes the `external_id` from the create request
            if provided, or `null` if the partner did not supply one. Only
            present on responses to partner API keys — direct-customer responses
            omit the field.
          example: ws_a7f3b2c9
    Error:
      type: object
      description: Error response object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
          example: Unauthorized
    ExternalIdConflictError:
      type: object
      description: >-
        Returned when a partner tries to set an `external_id` that is already
        mapped to another resource of the same type within the organization. The
        `existing` field identifies the resource that currently holds the ID,
        letting the partner recover from a retry or reconcile their mapping.
      required:
        - error
        - message
        - existing
      properties:
        error:
          type: string
          enum:
            - external_id_conflict
          description: Machine-readable error code. Always `external_id_conflict`.
          example: external_id_conflict
        message:
          type: string
          description: Human-readable explanation of the conflict.
          example: external_id ws_a7f3b2c9 is already mapped to a website
        existing:
          type: object
          required:
            - id
            - externalId
          description: The resource that currently holds the conflicting `external_id`.
          properties:
            id:
              type: string
              format: uuid
              description: Athena ID of the existing resource.
              example: 123e4567-e89b-12d3-a456-426614174000
            externalId:
              type: string
              description: The external_id that is already mapped.
              example: ws_a7f3b2c9
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. You can create one
        [here](https://app.athenahq.ai/organization?tab=api).

````