> ## 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.

# Get pending enrichment drafts

> The live set with every draft applied. The body is `null` when there is nothing to publish. `errors` is empty when the pending set compiles. Org admin only.



## OpenAPI

````yaml https://app-api.costory.io/docs/openapi.json get /enrichments/draft
openapi: 3.0.0
info:
  title: Costory
  version: '1.0'
  description: API Documentation
servers:
  - url: ''
    description: Production server
security: []
paths:
  /enrichments/draft:
    get:
      tags:
        - Enrichments
      summary: Get pending enrichment drafts
      description: >-
        The live set with every draft applied. The body is `null` when there is
        nothing to publish. `errors` is empty when the pending set compiles. Org
        admin only.
      operationId: getEnrichmentDraft
      responses:
        '200':
          description: Pending drafts, or null
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/EnrichmentDraftSummary'
                  - nullable: true
                    type: string
                    enum:
                      - null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '403':
          description: Org admin required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DimensionsAdminRequired'
      security:
        - bearerAuth: []
components:
  schemas:
    EnrichmentDraftSummary:
      type: object
      properties:
        updatedAt:
          type: string
          description: ISO-8601 time of the latest draft write.
        changes:
          $ref: '#/components/schemas/EnrichmentChanges'
        errors:
          type: array
          items:
            type: string
          description: Why the pending set would not publish. Empty when it compiles.
        documents:
          type: array
          items:
            $ref: '#/components/schemas/EnrichmentSummary'
          description: Added and changed documents as drafted.
      required:
        - updatedAt
        - changes
        - errors
        - documents
    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
    EnrichmentSummary:
      type: object
      properties:
        id:
          type: string
          description: '`draft:<name>` on a drafted document.'
        name:
          type: string
        description:
          type: string
        ruleCount:
          type: integer
        keyField:
          type: string
        targetColumns:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
            required:
              - name
      required:
        - id
        - name
        - description
        - ruleCount
        - keyField
        - targetColumns
  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.