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

# Publish pending enrichment drafts

> Compiles the live set with every draft applied and, when it compiles, stores that set in one transaction and starts the update workflow.

A `400` means the set does not compile and nothing was stored. A `404` means there is no draft. A `409` means the drafts changed since they were read.

Org admin only.



## OpenAPI

````yaml POST /enrichments/draft/publish
openapi: 3.0.0
info:
  title: Costory
  version: '1.0'
  description: API Documentation
servers:
  - url: ''
    description: Production server
security: []
paths:
  /enrichments/draft/publish:
    post:
      tags:
        - Enrichments
      summary: Publish pending enrichment drafts
      description: >-
        Compiles the live set with every draft applied and, when it compiles,
        stores that set in one transaction and starts the update workflow.


        A `400` means the set does not compile and nothing was stored. A `404`
        means there is no draft. A `409` means the drafts changed since they
        were read.


        Org admin only.
      operationId: publishEnrichmentDrafts
      responses:
        '200':
          description: Drafts published
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrichmentPublishResponse'
        '400':
          description: The pending set does not compile
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrichmentErrors'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '403':
          description: Org admin required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DimensionsAdminRequired'
        '404':
          description: No draft
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrichmentErrors'
        '409':
          description: Drafts changed since they were read
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrichmentErrors'
      security:
        - bearerAuth: []
components:
  schemas:
    EnrichmentPublishResponse:
      type: object
      properties:
        changes:
          $ref: '#/components/schemas/EnrichmentChanges'
        workflowStarted:
          anyOf:
            - type: boolean
            - type: string
              enum:
                - unknown
          description: >-
            `false`: the update did not start and a retry is safe. `true`: it
            started. `unknown`: the start call threw after the run may have been
            accepted.
        workflowError:
          type: string
      required:
        - changes
        - workflowStarted
    EnrichmentErrors:
      type: object
      properties:
        errors:
          type: array
          items:
            type: string
      required:
        - errors
    Unauthorized:
      type: object
      properties:
        error:
          type: string
          description: Unauthorized error message
      required:
        - error
    DimensionsAdminRequired:
      type: object
      properties:
        error:
          type: string
          enum:
            - ADMIN_REQUIRED
      required:
        - error
    EnrichmentChanges:
      type: object
      properties:
        added:
          type: array
          items:
            type: string
        changed:
          type: array
          items:
            type: string
        removed:
          type: array
          items:
            type: string
      required:
        - added
        - changed
        - removed
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or Clerk ak_* API key
      description: >-
        Send `Authorization: Bearer <credential>` using either a Clerk session
        JWT or a Clerk API key (`ak_*`). API keys may identify a user (`user_*`)
        or organization (`org_*`) principal and are generated in the Clerk
        Dashboard under API keys.

````

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