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

# Create page

> Creates a Knowledge Hub page. New pages go through the draft → publish
version flow: set `status` to `published` to publish immediately, or
`draft` (the default) to save without publishing.

Returns the created page with its body (`201`).




## OpenAPI

````yaml /api-reference/openapi.yaml post /knowledge-hub/pages
openapi: 3.0.3
info:
  title: Exec API
  version: '1.0'
  description: >
    REST API for programmatic access to your Exec workspace.


    Use the Exec API to read workspace data, list members, retrieve group
    information,

    and create interactive scenario creation sessions.


    ## Authentication

    All requests require a valid API key passed in the Authorization header:

    ```

    Authorization: Bearer exec_live_...

    ```


    Create API keys in your workspace settings under **Settings > API**.
servers:
  - url: https://api.exec.com/rest/v1
    description: Production
security:
  - bearerAuth: []
paths:
  /knowledge-hub/pages:
    post:
      tags:
        - Knowledge Hub - Pages
      summary: Create page
      description: |
        Creates a Knowledge Hub page. New pages go through the draft → publish
        version flow: set `status` to `published` to publish immediately, or
        `draft` (the default) to save without publishing.

        Returns the created page with its body (`201`).
      operationId: createKnowledgeHubPage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - title
              properties:
                title:
                  type: string
                  description: Page title
                content:
                  type: string
                  description: Markdown body of the page
                status:
                  type: string
                  enum:
                    - draft
                    - published
                  default: draft
                  description: Whether to save as a draft or publish immediately
                visibility:
                  type: string
                  enum:
                    - private
                    - workspace
                  default: workspace
                  description: Visibility scope for the new page
                folder_ids:
                  type: array
                  items:
                    type: string
                  description: UUIDs of folders to place the page in
                source_ids:
                  type: array
                  items:
                    type: string
                  description: UUIDs of sources to attach to the page
                skill_ids:
                  type: array
                  items:
                    type: string
                  description: UUIDs of skills to associate with the page
            example:
              title: Pricing objection guide
              content: |-
                ## Handling pricing objections

                Lead with value before discussing discounts…
              status: published
              visibility: workspace
              folder_ids:
                - f1a2b3c4d5e6
              source_ids:
                - s1a2b3c4d5e6
              skill_ids:
                - sk1a2b3c4d5e
      responses:
        '201':
          description: Page created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeHubPageDetail'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    KnowledgeHubPageDetail:
      description: >-
        A single page with its published body, attached sources, and
        (optionally) its draft.
      allOf:
        - $ref: '#/components/schemas/KnowledgeHubPage'
        - type: object
          properties:
            content:
              type: string
              nullable: true
              description: Markdown body of the published version (null if unpublished)
            sources:
              type: array
              description: Sources attached to the page
              items:
                $ref: '#/components/schemas/KnowledgeHubSource'
            draft:
              $ref: '#/components/schemas/KnowledgeHubPageDraft'
              nullable: true
              description: >-
                Current draft (only included when requested via
                `?include=draft`)
    KnowledgeHubPage:
      type: object
      description: >-
        A Knowledge Hub page. List responses return this metadata-only shape (no
        body).
      properties:
        id:
          type: string
          description: Unique page identifier (UUID)
        title:
          type: string
          description: Page title
        status:
          type: string
          enum:
            - draft
            - published
            - archived
          description: Current page status
        visibility:
          type: string
          enum:
            - private
            - workspace
            - global
          description: Visibility scope of the page
        owner:
          $ref: '#/components/schemas/User'
          nullable: true
          description: User who owns the page
        folders:
          type: array
          description: Folders the page belongs to
          items:
            $ref: '#/components/schemas/KnowledgeHubFolderRef'
        skills:
          type: array
          description: Skills associated with the page
          items:
            $ref: '#/components/schemas/KnowledgeHubSkillRef'
        source_count:
          type: integer
          description: Number of sources attached to the page
        version:
          type: integer
          nullable: true
          description: Version number of the published version, or null if never published
        cover:
          type: string
          description: Cover image reference (empty string if none)
        published_at:
          type: string
          format: date-time
          nullable: true
          description: When the page was last published
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    KnowledgeHubSource:
      type: object
      description: >-
        A Knowledge Hub source — an uploaded file or ingested URL whose text is
        extracted and indexed.
      properties:
        id:
          type: string
          description: Unique source identifier (UUID)
        title:
          type: string
          description: Source title
        source_type:
          type: string
          enum:
            - upload
            - url
            - notion
            - google_drive
            - guru
            - page
            - integration
          description: Where the source came from
        status:
          type: string
          enum:
            - pending
            - processing
            - ready
            - failed
          description: Text-extraction status
        content_format:
          type: string
          nullable: true
          enum:
            - markdown
            - plain_text
            - image
            - video
          description: Format of the extracted content
        token_count:
          type: integer
          nullable: true
          description: Number of tokens in the extracted text
        has_images:
          type: boolean
          description: Whether the source contains images
        external_url:
          type: string
          nullable: true
          description: >-
            Original URL for url/notion/guru/google_drive sources (null
            otherwise)
        summary:
          type: string
          nullable: true
          description: AI-generated summary of the source
        cover:
          type: string
          description: Cover image reference (empty string if none)
        folders:
          type: array
          description: Folders the source belongs to
          items:
            $ref: '#/components/schemas/KnowledgeHubFolderRef'
        created_by:
          $ref: '#/components/schemas/User'
          nullable: true
          description: User who added the source
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        processed_at:
          type: string
          format: date-time
          nullable: true
          description: When extraction finished
        content:
          type: string
          nullable: true
          description: Extracted text (only included when requested via `?include=content`)
    KnowledgeHubPageDraft:
      type: object
      description: The unpublished draft of a page.
      properties:
        title:
          type: string
          description: Draft title
        content:
          type: string
          nullable: true
          description: Markdown body of the draft
    ValidationErrorDetail:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              description: Error category (e.g., "invalid_request")
            code:
              type: string
              description: Specific error code (e.g., "user_not_found")
            message:
              type: string
              description: Human-readable error message
    User:
      type: object
      properties:
        id:
          type: string
          description: Unique user identifier
        email:
          type: string
          format: email
          description: User's email address
        first_name:
          type: string
          description: User's first name
        last_name:
          type: string
          description: User's last name
    KnowledgeHubFolderRef:
      type: object
      description: A compact folder reference embedded in pages and sources.
      properties:
        id:
          type: string
          description: Unique folder identifier (UUID)
        name:
          type: string
          description: Folder name
        emoji:
          type: string
          nullable: true
          description: Emoji icon shown next to the folder
    KnowledgeHubSkillRef:
      type: object
      description: A compact skill reference embedded in pages.
      properties:
        id:
          type: string
          description: Unique skill identifier (UUID)
        name:
          type: string
          description: Skill name
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorDetail'
          example:
            error:
              type: invalid_request
              code: invalid_pagination
              message: Invalid pagination parameters
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorDetail'
          example:
            error:
              type: authentication_error
              code: invalid_api_key
              message: Invalid or inactive API key
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        API key created in Settings > API.

        Format: `exec_live_` followed by 40 alphanumeric characters.

````