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

# Declares that an ad platform's lead form responses for one ad account are


> written into a lead dataset. Every fifteen minutes Erdo reads the account's responses and writes those submitted on the listed forms, each exactly once, with submitted\_at set to when Erdo wrote the row and ts to when the person submitted the form. The dataset must have lead identity turned on, and every form must belong to the account; the save is refused otherwise. Saving replaces the declaration for the same provider and account.

REST only, with no MCP tool, like scheduled actions: connecting an ad account's leads to a dataset is a commitment about whose prospects land where, made by somebody who holds the connection, not a step an agent takes mid-task.




## OpenAPI

````yaml /api/openapi.json put /v1/provider-lead-sources
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-10-23'
servers:
  - url: https://api.erdo.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/provider-lead-sources:
    put:
      summary: >
        Declares that an ad platform's lead form responses for one ad account
        are
      description: >
        written into a lead dataset. Every fifteen minutes Erdo reads the
        account's responses and writes those submitted on the listed forms, each
        exactly once, with submitted\_at set to when Erdo wrote the row and ts
        to when the person submitted the form. The dataset must have lead
        identity turned on, and every form must belong to the account; the save
        is refused otherwise. Saving replaces the declaration for the same
        provider and account.


        REST only, with no MCP tool, like scheduled actions: connecting an ad
        account's leads to a dataset is a commitment about whose prospects land
        where, made by somebody who holds the connection, not a step an agent
        takes mid-task.
      operationId: PUT:mcp.SetProviderLeadSourceAPI
      requestBody:
        content:
          application/json:
            schema:
              properties:
                account_id:
                  title: |
                    account_id is the provider's numeric ad account id.
                  type: string
                connection_id:
                  description: |
                    account for the provider.
                  title: >
                    connection_id is the id of this organization's connected
                    integration
                  type: string
                dataset:
                  title: >
                    dataset is the slug of a lead dataset with lead identity
                    turned on.
                  type: string
                enabled:
                  title: >
                    enabled defaults to true. False keeps the declaration but
                    stops reading it.
                  type: boolean
                forms:
                  description: |
                    account\_id.
                  items:
                    type: string
                  title: >
                    forms are the lead form ids to write responses from. Each
                    must belong to
                  type: array
                provider:
                  title: >
                    provider is the ad platform. "linkedin_ads" is the only one
                    supported.
                  type: string
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  account_id:
                    description: |
                      owns are ever written.
                    title: >
                      account_id is the provider's ad account id. Only responses
                      this account
                    type: string
                  connection_id:
                    description: |
                      responses are read through.
                    title: >
                      connection_id is the organization's connected integration
                      account the
                    type: string
                  created_at:
                    title: >
                      created_at is when the declaration was first saved (RFC
                      3339).
                    type: string
                  dataset:
                    title: >
                      dataset is the slug of the lead dataset responses are
                      written into.
                    type: string
                  enabled:
                    title: |
                      enabled is whether the platform is reading this source.
                    type: boolean
                  forms:
                    items:
                      type: string
                    title: |
                      forms are the lead form ids whose responses are written.
                    type: array
                  last_error:
                    title: >
                      last_error is why the last read did not finish, or empty
                      when it did.
                    type: string
                  last_run_at:
                    description: |
                      empty when it never has.
                    title: >
                      last_run_at is when the platform last read this source
                      (RFC 3339), or
                    type: string
                  provider:
                    title: |
                      provider is the ad platform: "linkedin_ads".
                    type: string
                  synced_through:
                    description: >
                      handled through (RFC 3339), or empty before the first
                      complete sync.
                    title: >
                      synced_through is the submission time every earlier
                      response has been
                    type: string
                  updated_at:
                    title: >
                      updated_at is when the declaration was last saved (RFC
                      3339).
                    type: string
                type: object
          description: Success response
        default:
          $ref: '#/components/responses/APIError'
components:
  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_...).

````

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