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

# Test-fire event source

> Delivers a sample payload to every task subscribed to this source's `external.<event_name>` as a **test run**: real research and output, but every write-style tool refuses and every delivery is captured on the run instead of being sent. Called from an agent chat, the chat is signalled when each run ends, so it need not poll. Returns the started runs. 422 when no task listens to the event yet, or when every subscribed task is busy or the account is out of AI credits.



## OpenAPI

````yaml /developer/api-reference/openapi.json post /event_sources/{id}/test
openapi: 3.1.1
info:
  title: Crevio API V1
  version: 1.0.0
  description: >
    API for the Crevio creator platform — a multi-tenant SaaS for digital
    product sales.

    Uses snake_case keys following Stripe conventions. All resource IDs are
    string IDs (e.g., "prod_abc123").


    Authentication is a bearer token: `Authorization: Bearer $CREVIO_API_KEY`.

    List endpoints are cursor-paginated with `limit` and `starting_after`.

    Writes accept an `Idempotency-Key` header and are safe to retry.


    Every response carries IETF RateLimit headers (`RateLimit`,
    `RateLimit-Policy`) so a client can

    self-throttle, and `Retry-After` on a 429. The quota is 600 requests per
    minute per credential.


    The API is versioned in the URL path (`/v1`). Nothing is removed without
    in-band warning: a

    deprecated operation is marked `"deprecated": true` here and serves
    `Deprecation` (RFC 9745),

    `Sunset` (RFC 8594) and `Link; rel="deprecation"` headers for at least six
    months before it

    stops answering. See https://crevio.co/docs/developer/guides/versioning.
  contact:
    email: support@crevio.co
    name: Crevio Support
    url: https://crevio.co/docs
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: https://crevio.co/legal/terms-of-service
servers:
  - url: https://api.crevio.co/v1
    description: Production
security:
  - ApiKey: []
tags:
  - name: Account
    description: Current account information
  - name: Bots
    description: >-
      Named bot identities (persona, skills, toolsets) chats and tasks can run
      as
  - name: Analytics
    description: Account-wide business analytics
  - name: BlogCategories
    description: Blog post categories
  - name: BlogPosts
    description: Blog content management
  - name: Broadcasts
    description: One-to-many email sending
  - name: Sequences
    description: Timed email series people move through one step at a time
  - name: CheckoutLinks
    description: Shareable checkout links
  - name: CheckoutConfiguration
    description: Account-wide checkout settings
  - name: Checkouts
    description: Checkout session management
  - name: Customers
    description: Customer relationship management
  - name: Discounts
    description: Discount code management
  - name: Experiences
    description: Digital experiences (courses, communities, downloads)
  - name: Files
    description: File uploads and external media management
  - name: FormSubmissions
    description: Form submission management
  - name: FormationDocuments
    description: Documents generated for a formation
  - name: Formations
    description: Whitelabel business formation via doola Partner API
  - name: Forms
    description: Hosted forms that capture leads and submissions
  - name: Invoices
    description: Invoice creation, payment, and lifecycle management
  - name: LegalPages
    description: Terms, privacy and refund pages for the storefront
  - name: Me
    description: Current user profile
  - name: OrderItems
    description: Order line items
  - name: Orders
    description: Order history and details
  - name: PriceVariants
    description: Product pricing tiers
  - name: Products
    description: Digital product catalog
  - name: Refunds
    description: Refund management
  - name: Reviews
    description: Product reviews
  - name: Socials
    description: Social media management (accounts, posts, media).
  - name: Subscriptions
    description: Subscription lifecycle management (cancel, pause, resume)
  - name: Tags
    description: Customer tags
  - name: TaskRuns
    description: Individual execution records for AI tasks.
  - name: Tasks
    description: >-
      AI tasks — scheduled or event-triggered agentic work (cron, interval,
      once, immediate, event).
  - name: WebhookEndpoints
    description: Webhook endpoint management
  - name: WebhookEvents
    description: Webhook event delivery history
  - name: Leads
    description: Find, verify and enrich business leads (Hunter.io-backed).
  - name: Ads
    description: >-
      Paid advertising — campaigns, ad groups, ads, audiences, targeting, leads,
      conversions, and reports across Meta, Google, TikTok, LinkedIn, Pinterest,
      and X.
  - name: Domains
    description: Custom web domains for your sites.
  - name: Web
    description: >-
      Web search & scraping (search, read, map, crawl, extract, research),
      backed by Firecrawl.
  - name: Skills
    description: >-
      AI skills marketplace — search the catalog and install or uninstall skills
      for your account's agent.
  - name: Schedules
    description: Reusable availability schedules that back event types.
  - name: EventTypes
    x-displayName: Event Types
    description: Bookable services customers can schedule time on.
  - name: Bookings
    description: Reservations made against event types.
  - name: Waitlist Entries
    description: Buyers waiting for approval on price variants that require it.
  - name: Connections
    description: Third-party app connections (connect, list, execute)
  - name: Approvals
    description: Human-in-the-loop approvals for gated actions
  - name: Logs
    description: Account activity log
  - name: Access
    description: Per-user access checks for gated resources
  - name: ApiKeys
    description: API key management
  - name: Audio
    description: AI audio generation
  - name: Calls
    description: Outbound phone calls placed by the account's agent
  - name: Chapters
    description: Course chapters
  - name: Deployments
    description: Site deployments and build logs
  - name: Email
    description: Inboxes, threads, messages, drafts and delivery events
  - name: Email Suppressions
    description: Addresses no send path will deliver to
  - name: EventSessions
    description: Scheduled sessions of an event experience
  - name: EventSources
    description: Third-party event sources that trigger tasks
  - name: Events
    description: Events an account can subscribe to
  - name: ForumPosts
    description: Posts inside a forum experience
  - name: Images
    description: AI image generation, editing and stock search
  - name: Jobs
    description: Long-running asynchronous jobs
  - name: Lessons
    description: Lessons inside a course chapter
  - name: LinkItems
    description: Links inside a link-in-bio experience
  - name: Phone Consents
    description: Recorded consent to place calls to a number
  - name: Phone Numbers
    description: Phone numbers provisioned for the account
  - name: Phone Suppressions
    description: Do-not-call entries
  - name: Sites
    description: AI-built sites — storefronts and web apps
  - name: Status
    description: API and account status
  - name: Topics
    description: Discussion topics inside a forum experience
  - name: Plans
    description: The plans Crevio sells, their credit tiers, prices and limits.
  - name: Usage
    description: Credit usage and transaction history
  - name: Users
    description: Users of the account
  - name: Video
    description: AI video generation
  - name: Secrets
    description: Account-level environment variables shared across the account's sites
  - name: Billing Portal
    description: Hosted billing pages for your customers
  - name: Data
    description: >-
      Included business data: search the tool catalog, then run a tool
      (website/SEO, people, companies, local businesses, social, e-commerce,
      finance, jobs, reviews, ads, real estate, news, apps, travel, weather,
      legal).
  - name: Chats
    description: Delegate work to the Crevio agent and read its replies
  - name: ScriptRuns
    description: Run JavaScript on the account's computer, without an agent turn
  - name: Artifacts
    description: Download files that runs and scripts produced
  - name: Pages
    description: Self-contained HTML pages hosted at a stable link
  - name: Team
    description: Members, roles, credit limits and invitations
  - name: Allowed Senders
    description: Who the agent's inbox answers
  - name: SMS messages
    description: Texts on business phone lines.
  - name: SMS follow-ups
    description: >-
      Texting new leads and past customers until they answer. The email
      counterpart is Sequences.
externalDocs:
  description: Crevio developer documentation
  url: https://crevio.co/docs/developer
paths:
  /event_sources/{id}/test:
    post:
      tags:
        - EventSources
      summary: Test-fire event source
      description: >-
        Delivers a sample payload to every task subscribed to this source's
        `external.<event_name>` as a **test run**: real research and output, but
        every write-style tool refuses and every delivery is captured on the run
        instead of being sent. Called from an agent chat, the chat is signalled
        when each run ends, so it need not poll. Returns the started runs. 422
        when no task listens to the event yet, or when every subscribed task is
        busy or the account is out of AI credits.
      operationId: testEventSource
      parameters:
        - $ref: '#/components/parameters/Id'
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                payload:
                  type: object
                  additionalProperties: true
                  description: >-
                    The body a real delivery would carry; the run receives it as
                    `event.data`. Defaults to `{}`.
      responses:
        '202':
          description: Accepted — the test runs execute in the background.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResponse_AiTaskRun'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - ApiKey: []
      x-codeSamples:
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Crevio } from "@crevio/sdk";

            const crevio = new Crevio({
              apiKey: process.env["CREVIO_API_KEY"] ?? "",
            });

            async function run() {
              const result = await crevio.eventSources.test({
                id: "<id>",
              });

              console.log(result);
            }

            run();
components:
  parameters:
    Id:
      name: id
      in: path
      required: true
      description: The resource ID (e.g., "prod_abc123") or slug (e.g., "my-product")
      schema:
        type: string
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Makes this write safe to retry: a repeat with the same key replays the
        first response instead of creating a second resource. Scoped to the
        account, remembered for 24 hours; reusing a key with a different payload
        is an error.
      schema:
        type: string
        maxLength: 255
      example: 1f7a4c2e-3b19-4a6d-9f0c-2ac81b5d7e33
  schemas:
    ListResponse_AiTaskRun:
      type: object
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/AiTaskRun'
        has_more:
          type: boolean
        url:
          type: string
      required:
        - object
        - data
        - has_more
        - url
    AiTaskRun:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
        task_id:
          type: string
        task_name:
          type: string
        chat_id:
          type:
            - string
            - 'null'
          description: >-
            The run's own conversation (`aichat_...`): what it read, called and
            said. Read it with `search_chats`.
        status:
          type: string
          enum:
            - pending
            - running
            - completed
            - failed
            - needs_input
            - timed_out
            - unknown
            - skipped
            - cancelled
        summary:
          type:
            - string
            - 'null'
        error_message:
          type:
            - string
            - 'null'
        test_run:
          type: boolean
        input_tokens:
          type: integer
        output_tokens:
          type: integer
        credits_consumed:
          type: integer
        cancel_requested_at:
          type:
            - string
            - 'null'
          description: >-
            When a stop was requested. The run stays `running` until it reaches
            its next step, then settles as `cancelled`.
        tool_calls_count:
          type: integer
        duration_ms:
          type:
            - integer
            - 'null'
        started_at:
          type:
            - string
            - 'null'
          format: date-time
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        skip_reason:
          type:
            - string
            - 'null'
          enum:
            - condition
            - no_paid_plan_or_credits
            - no_recent_activity
            - no_task_activity
            - no_personal_sources
            - wake_gate
            - wake_limit
            - rate_limited
            - misfire
            - task_busy
            - account_at_capacity
            - member_credit_cap
            - agent_archived
            - null
        skip_count:
          type: integer
        delivery_status:
          type: string
          enum:
            - delivered
            - not_delivered
            - not_requested
            - unknown
        completion:
          type:
            - string
            - 'null'
          description: >-
            How the agent closed a completed run: `verified` (it re-checked the
            result), `recorded` (it reported without re-checking), or
            `recovered` (it never reported; `summary` is its last message). Null
            unless an agent turn completed the run.
          enum:
            - verified
            - recorded
            - recovered
            - null
        trigger_source:
          type: string
          enum:
            - scheduled
            - event
            - manual
        trigger_event:
          type:
            - object
            - 'null'
          description: >-
            The event that started this run, `{type, data}`, exactly as the run
            received it; `data` matches the event's webhook payload. Null for a
            run no event started. POST /task_runs/{id}/replay runs the task
            again on it.
        replay_of:
          type:
            - string
            - 'null'
          description: >-
            The run (`trun_...`) whose event this run replays. Null unless
            started by POST /task_runs/{id}/replay.
        captured_deliveries:
          type: array
        result:
          type:
            - string
            - 'null'
          description: >-
            The agent's final reply, once the run settled. Present on single-run
            responses, not in lists.
        json:
          description: >-
            The reply parsed and validated against the `response_format` the run
            was started with. Null when none was given or it did not validate.
        json_error:
          type:
            - string
            - 'null'
          description: Why the reply did not parse or validate against `response_format`.
        artifacts:
          type: array
          items:
            $ref: '#/components/schemas/Artifact'
        pending_approval_ids:
          type: array
      required:
        - id
        - object
        - task_id
        - task_name
        - chat_id
        - status
        - summary
        - error_message
        - test_run
        - input_tokens
        - output_tokens
        - credits_consumed
        - cancel_requested_at
        - tool_calls_count
        - duration_ms
        - started_at
        - completed_at
        - created_at
        - updated_at
        - skip_reason
        - skip_count
        - delivery_status
        - completion
        - trigger_source
        - trigger_event
        - replay_of
        - captured_deliveries
        - pending_approval_ids
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - api_error
                - invalid_request_error
                - validation_error
            code:
              type: string
            message:
              type: string
            param:
              type: string
            errors:
              type: object
            doc_url:
              type: string
          required:
            - type
            - message
      required:
        - error
    Artifact:
      type: object
      properties:
        object:
          type: string
        id:
          type: string
        filename:
          type: string
        content_type:
          type:
            - string
            - 'null'
        size:
          type: integer
      required:
        - object
        - id
        - filename
        - content_type
        - size
  responses:
    Unauthorized:
      description: Authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: invalid_request_error
              code: authentication_required
              message: You did not provide an API key.
      headers:
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimitPolicy'
        Request-Id:
          $ref: '#/components/headers/RequestId'
        Deprecation:
          $ref: '#/components/headers/Deprecation'
        Sunset:
          $ref: '#/components/headers/Sunset'
        Link:
          $ref: '#/components/headers/DeprecationLink'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: invalid_request_error
              code: forbidden
              message: You do not have permission to perform this action
      headers:
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimitPolicy'
        Request-Id:
          $ref: '#/components/headers/RequestId'
        Deprecation:
          $ref: '#/components/headers/Deprecation'
        Sunset:
          $ref: '#/components/headers/Sunset'
        Link:
          $ref: '#/components/headers/DeprecationLink'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: invalid_request_error
              code: resource_missing
              message: The requested resource was not found
      headers:
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimitPolicy'
        Request-Id:
          $ref: '#/components/headers/RequestId'
        Deprecation:
          $ref: '#/components/headers/Deprecation'
        Sunset:
          $ref: '#/components/headers/Sunset'
        Link:
          $ref: '#/components/headers/DeprecationLink'
    UnprocessableEntity:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: validation_error
              code: validation_failed
              message: Email is required
              errors:
                email:
                  - can't be blank
      headers:
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimitPolicy'
        Request-Id:
          $ref: '#/components/headers/RequestId'
        Deprecation:
          $ref: '#/components/headers/Deprecation'
        Sunset:
          $ref: '#/components/headers/Sunset'
        Link:
          $ref: '#/components/headers/DeprecationLink'
    TooManyRequests:
      description: >-
        Rate limit exceeded — 600 requests per minute per owner on the free
        tier: every API key and OAuth token one person holds on an account
        shares one budget, and the account's team keys share another. Retry
        after the number of seconds in `Retry-After`.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimitPolicy'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: invalid_request_error
              code: rate_limit_exceeded
              message: Too many requests. Please retry later.
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: api_error
              code: internal_error
              message: An unexpected error occurred
      headers:
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimitPolicy'
        Request-Id:
          $ref: '#/components/headers/RequestId'
        Deprecation:
          $ref: '#/components/headers/Deprecation'
        Sunset:
          $ref: '#/components/headers/Sunset'
        Link:
          $ref: '#/components/headers/DeprecationLink'
  headers:
    RateLimit:
      description: >-
        Remaining quota for the current window, as an IETF structured field:
        `"default";r=<remaining>;t=<seconds until reset>`.
      schema:
        type: string
        examples:
          - '"default";r=596;t=11'
    RateLimitPolicy:
      description: >-
        The quota this credential is subject to:
        `"default";q=<requests>;w=<window seconds>`.
      schema:
        type: string
        examples:
          - '"default";q=600;w=60'
    RequestId:
      description: Unique id for this request. Quote it when reporting a problem.
      schema:
        type: string
        examples:
          - 8fe045fe-cb8a-4407-a44d-5df60385e522
    Deprecation:
      description: >-
        Present only on a deprecated operation. Structured-field date (RFC 9745)
        — `@` followed by the Unix timestamp at which the operation became
        deprecated.
      schema:
        type: string
        examples:
          - '@1775001600'
    Sunset:
      description: >-
        Present only on a deprecated operation. HTTP-date (RFC 8594) after which
        the operation stops responding. Always at least six months after
        `Deprecation`.
      schema:
        type: string
        examples:
          - Thu, 01 Oct 2026 00:00:00 GMT
    DeprecationLink:
      description: >-
        Present only on a deprecated operation. `<url>; rel="deprecation"`
        pointing at the migration notes.
      schema:
        type: string
        examples:
          - >-
            <https://crevio.co/docs/developer/guides/versioning>;
            rel="deprecation"
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: integer
        examples:
          - 11
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: 'API key in the format: Bearer {api_token}'

````

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