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

# Publish

> Make pages Agent Pages now, including pages your sitemap doesn't list. Each path is fetched from your live site, optimized and served once that finishes, usually within minutes. On a page-by-page setup each page is selected for Agent Pages and counts against your Agent Pages budget. On a page-by-page setup, the site serves only its Agent Pages set. With Site Optimization, a site with an empty set serves no Agent Pages; without it, a site serves every page until its first page is marked or published, so the first publish stops serving every page outside the set.

Returns one outcome per requested path. `queued` means the fetch was sent, not that the page is live: if your site doesn't serve the page (for example it answers 404), it stays selected but isn't served until a scheduled check finds it live (about every 30 days) or you send it again. If the send fails, the hourly scheduled check picks the page up, usually within an hour. `warnings` says when a queued page waits on your site: it was retired earlier, or recent checks saw it redirect.

A path the Agent Pages Unpublish API put on the Ignore List is published again; a dashboard Ignore List entry or path rule is never overridden (`excluded`). On a whole-site (legacy) setup the page is optimized without being added to any list. A path your CDN doesn't route to the Scrunch edge worker is stored but never served.

Limits: 100 paths per request; each path once every 5 minutes; per brand, 500 published paths per rolling hour and 5,000 per rolling 24 hours. These quotas are separate from Force Refresh's and Unpublish's.

Publish acts on the Agent Page only. Curated (Adaptive) content at the same path keeps being served, and the response doesn't report it.



## OpenAPI

````yaml /api-reference/openapi.json post /{brand_id}/sites/{site_id}/agent-pages/publish
openapi: 3.1.0
info:
  title: Scrunch Data API
  version: 0.1.0
servers:
  - url: https://api.scrunchai.com/v1
security: []
paths:
  /{brand_id}/sites/{site_id}/agent-pages/publish:
    post:
      tags:
        - agent-pages
      summary: Publish
      description: >-
        Make pages Agent Pages now, including pages your sitemap doesn't list.
        Each path is fetched from your live site, optimized and served once that
        finishes, usually within minutes. On a page-by-page setup each page is
        selected for Agent Pages and counts against your Agent Pages budget. On
        a page-by-page setup, the site serves only its Agent Pages set. With
        Site Optimization, a site with an empty set serves no Agent Pages;
        without it, a site serves every page until its first page is marked or
        published, so the first publish stops serving every page outside the
        set.


        Returns one outcome per requested path. `queued` means the fetch was
        sent, not that the page is live: if your site doesn't serve the page
        (for example it answers 404), it stays selected but isn't served until a
        scheduled check finds it live (about every 30 days) or you send it
        again. If the send fails, the hourly scheduled check picks the page up,
        usually within an hour. `warnings` says when a queued page waits on your
        site: it was retired earlier, or recent checks saw it redirect.


        A path the Agent Pages Unpublish API put on the Ignore List is published
        again; a dashboard Ignore List entry or path rule is never overridden
        (`excluded`). On a whole-site (legacy) setup the page is optimized
        without being added to any list. A path your CDN doesn't route to the
        Scrunch edge worker is stored but never served.


        Limits: 100 paths per request; each path once every 5 minutes; per
        brand, 500 published paths per rolling hour and 5,000 per rolling 24
        hours. These quotas are separate from Force Refresh's and Unpublish's.


        Publish acts on the Agent Page only. Curated (Adaptive) content at the
        same path keeps being served, and the response doesn't report it.
      operationId: publishAgentPages
      parameters:
        - name: brand_id
          in: path
          required: true
          schema:
            type: integer
            title: Brand Id
            description: The unique identifier for the brand that owns the site.
          description: The unique identifier for the brand that owns the site.
        - name: site_id
          in: path
          required: true
          schema:
            type: string
            title: Site Id
            description: >-
              The ULID of the registered site whose Agent Pages you are
              publishing.
          description: >-
            The ULID of the registered site whose Agent Pages you are
            publishing.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentPagesPublishRequest'
      responses:
        '200':
          description: >-
            One outcome per requested path, in request order, plus the brand's
            remaining publish quota.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentPagesPublishResponse'
              example:
                results:
                  - path: /pricing
                    outcome: queued
                    retry_after: null
                    in_sitemap: true
                    warnings: []
                  - path: /launch/fall-event
                    outcome: queued
                    retry_after: null
                    in_sitemap: false
                    warnings:
                      - >-
                        Retired (http_gone), last checked 2026-10-20: it serves
                        only once the origin answers 200.
                      - >-
                        Not in the site's sitemap. Published as a manual Agent
                        Page: it is not removed by the sitemap check, only by an
                        origin 404 or redirect, or the unpublish API.
                  - path: /about
                    outcome: already_published
                    retry_after: null
                    in_sitemap: true
                    warnings: []
                  - path: /brochure.pdf
                    outcome: invalid_path
                    retry_after: null
                    in_sitemap: null
                    warnings: []
                quota:
                  hourly:
                    limit: 500
                    remaining: 498
                    resets_at: '2026-10-28T15:02:41Z'
                  daily:
                    limit: 5000
                    remaining: 4987
                    resets_at: '2026-10-29T09:15:03Z'
        '404':
          description: >-
            The site doesn't belong to the brand, or Agent Pages aren't enabled
            for the brand.
        '409':
          description: >-
            Agent Pages aren't active on this site (or the site isn't serving
            through its CDN). Nothing was published and no quota was used.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: >-
            The brand's hourly or daily publish quota is used up and nothing
            could be published, or another publish request for the same brand is
            still being processed.
          headers:
            Retry-After:
              description: >-
                Seconds to wait: until every exhausted quota window has a free
                slot, or 1 when another request for the brand is in progress.
              schema:
                type: integer
      security:
        - HTTPBearer:
            - optimize
components:
  schemas:
    AgentPagesPublishRequest:
      properties:
        paths:
          items:
            type: string
          type: array
          maxItems: 100
          minItems: 1
          title: Paths
          description: >-
            Site-relative paths to publish, e.g. `/pricing`. 1 to 100 entries,
            each up to 2,048 characters. Full or protocol-relative URLs are
            rejected. Paths are trimmed and normalized (lowercased, trailing
            slash and query string dropped), and duplicates after normalization
            are merged. `/` is the homepage. The page is fetched with the first
            spelling sent, so a case-sensitive site gets the URL it expects.
      type: object
      required:
        - paths
      title: AgentPagesPublishRequest
    AgentPagesPublishResponse:
      properties:
        results:
          items:
            $ref: '#/components/schemas/AgentPagesPublishResult'
          type: array
          title: Results
          description: >-
            One entry per requested path, in request order (after duplicates are
            merged).
        quota:
          $ref: '#/components/schemas/AgentPagesPublishQuotas'
          description: The brand's remaining publish quota. Only `queued` paths use it.
      type: object
      required:
        - results
        - quota
      title: AgentPagesPublishResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentPagesPublishResult:
      properties:
        path:
          type: string
          title: Path
          description: The normalized path this outcome applies to. `/` is the homepage.
        outcome:
          type: string
          enum:
            - queued
            - already_published
            - excluded
            - over_budget
            - invalid_path
            - cooldown
            - rate_limited
          title: Outcome
          description: >-
            What happened to this path. `queued`: the page is an Agent Page now
            and its fetch was sent; it is served once the fetch and optimization
            finish, and a page your site doesn't serve (for example it answers
            404) isn't served until a scheduled check finds it live (about every
            30 days) or it is sent again. If the send fails, the hourly
            scheduled check picks the page up, usually within an hour.
            `already_published`: the page is already being served; nothing was
            fetched (use Force Refresh to pick up a change). `excluded`: a
            dashboard Ignore List entry or path rule blocks the path (on a
            whole-site setup with Priority List entries, so does being outside
            them); the API never overrides it. `over_budget`: the organization's
            Agent Pages budget is full (page-by-page setups only); in a batch,
            the first paths that fit are queued. `invalid_path`: not a web page
            (a file such as `.pdf`, `.json` or `.model.json`), or a path the
            page list can't store. `cooldown`: this path was published in the
            last 5 minutes; retry after `retry_after`. `rate_limited`: the
            brand's hourly or daily quota ran out partway through this batch.
        retry_after:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Retry After
          description: >-
            For `cooldown`, when this path can be published again. Null
            otherwise.
        in_sitemap:
          anyOf:
            - type: boolean
            - type: 'null'
          title: In Sitemap
          description: >-
            For `queued` and `already_published` paths, whether the site's
            sitemap lists the page. Null for other outcomes.
        warnings:
          items:
            type: string
          type: array
          title: Warnings
          description: >-
            Why the page may not be served soon, or may be removed later. Empty
            when there is nothing to report. Possible entries, in this order:
            `Retired (<reason>), last checked <date>: it serves only once the
            origin answers 200.` (a `queued` page retired earlier; `<reason>` is
            `http_gone`, `sitemap_absent`, `non_html` or `admin_retired`;
            `<date>` is the last scheduled check, not the retirement date;
            either part is left out when unknown); `Recent checks saw this path
            redirect to <target>: it serves once a check sees the page answer
            for itself.` (a `queued` page that recent checks saw redirect;
            `<target>` reads `another URL` when none was recorded); `Not in the
            site's sitemap. Published as a manual Agent Page: it is not removed
            by the sitemap check, only by an origin 404 or redirect, or the
            unpublish API.` (a `queued` page with `in_sitemap: false`). A
            `queued` page the sitemap lists is managed by the sitemap, which can
            retire it once the sitemap drops it; an `already_published` page
            keeps how it was managed.
      type: object
      required:
        - path
        - outcome
      title: AgentPagesPublishResult
    AgentPagesPublishQuotas:
      properties:
        hourly:
          $ref: '#/components/schemas/AgentPagesRefreshQuota'
          description: 500 published paths per brand per rolling hour.
        daily:
          $ref: '#/components/schemas/AgentPagesRefreshQuota'
          description: 5,000 published paths per brand per rolling 24 hours.
      type: object
      required:
        - hourly
        - daily
      title: AgentPagesPublishQuotas
      description: >-
        The brand's rolling publish windows, separate from the refresh and
        unpublish quotas. A path is queued only while both have room.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AgentPagesRefreshQuota:
      properties:
        limit:
          type: integer
          title: Limit
          description: This window's cap.
        remaining:
          type: integer
          title: Remaining
          description: Paths left in this window after this request.
        resets_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Resets At
          description: >-
            When the oldest path counted in the window expires and frees a slot.
            Null when nothing has been used.
      type: object
      required:
        - limit
        - remaining
      title: AgentPagesRefreshQuota
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

## Related topics

- [Agent Pages Publish: Add Pages on Demand](https://developers.scrunch.com/api-reference/agent-pages/publish-overview.md)
- [Agent Pages Unpublish: Stop Serving Pages on Demand](https://developers.scrunch.com/api-reference/agent-pages/unpublish-overview.md)
- [Content Brief Handoff to Design](https://developers.scrunch.com/mcp/workflows/content-brief-to-design.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.