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

# EnsureDatasetAPI creates, reuses, or explicitly adopts the one dataset for a


> purpose, and refuses to return until its declared producer contract matches.




## OpenAPI

````yaml /api/openapi.json post /v1/datasets-ensure
openapi: 3.0.0
info:
  title: Erdo API
  description: >-
    Erdo's REST API: query and write datasets, run agents, manage threads,
    integrations, pages, evals, workstreams, experiments, and bounded outreach.
    Authenticate with a Bearer API key (erdo_api_...) or scoped token
    (erdo_token_...).
  version: '2026-09-22'
servers:
  - url: https://api.erdo.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/datasets-ensure:
    post:
      summary: >
        EnsureDatasetAPI creates, reuses, or explicitly adopts the one dataset
        for a
      description: >
        purpose, and refuses to return until its declared producer contract
        matches.
      operationId: POST:mcp.EnsureDatasetAPI
      requestBody:
        content:
          application/json:
            schema:
              properties:
                declared_schema:
                  $ref: '#/components/schemas/mcp.EnsureDeclaredSchema'
                description:
                  type: string
                email_column:
                  type: string
                instructions:
                  type: string
                name:
                  type: string
                phone_column:
                  type: string
                preferred_dataset:
                  type: string
                purpose:
                  type: string
                purpose_description:
                  type: string
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  created:
                    type: boolean
                  declared_schema:
                    $ref: '#/components/schemas/mcp.EnsureDeclaredSchema'
                  id:
                    type: string
                  name:
                    type: string
                  purpose:
                    type: string
                  slug:
                    type: string
                type: object
          description: Success response
        default:
          $ref: '#/components/responses/APIError'
components:
  schemas:
    mcp.EnsureDeclaredSchema:
      properties:
        columns:
          items:
            $ref: '#/components/schemas/mcp.DeclaredSchemaColumn'
          type: array
      type: object
    mcp.DeclaredSchemaColumn:
      properties:
        description:
          type: string
        name:
          type: string
        required:
          type: boolean
        semantic_role:
          type: string
        type:
          type: string
      title: |
        DeclaredSchemaColumn is one column in a declare_schema contract.
      type: object
  responses:
    APIError:
      content:
        application/json:
          schema:
            externalDocs:
              url: https://pkg.go.dev/encore.dev/beta/errs#Error
            properties:
              code:
                description: Error code
                example: not_found
                externalDocs:
                  url: https://pkg.go.dev/encore.dev/beta/errs#ErrCode
                type: string
              details:
                description: Error details
                type: object
              message:
                description: Error message
                type: string
            title: APIError
            type: object
      description: Error response
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An Erdo API key (erdo_api_...) or scoped token (erdo_token_...).

````