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

# Run a skill and wait

> Run a skill and get its rows in the same call.

Put the skill's inputs at the top level of the body (or in the query). The run settings (`max_results`, `max_pages`, `version`, `browser_type`, `profile_id`, `proxy_config`, `scrape_mode`) sit next to them. See [Run settings](/guides/run-a-skill#run-settings).

The rows are in `data`. The other fields are explained in [Runs](/concepts/runs#what-a-finished-run-holds).

If your account already has its maximum of runs in progress, this returns `429` with `Retry-After` instead of waiting. Use [Start a skill run](/api-reference/runs/start-skill-run) to queue instead.

The older `POST /v1/skills/run` with `skill_id` and `parameters` in the body still works. New code should use this route.

MCP tool: `skill_<slug>`.


## OpenAPI

````yaml POST /v1/skills/{slug}/run
openapi: 3.1.0
info:
  title: Valendata REST API
  version: 1.0.0
  description: >-
    Create, run, schedule, and improve skills and workflows over JSON and HTTPS.
    Every route is under `/v1`; changes inside v1 are additive only (new routes,
    new optional parameters, new response fields). A route that will go away is
    marked `deprecated` here and answers with `Deprecation`, `Sunset` and a
    `Link` to its replacement for at least six months before it is removed.
    Errors, limits, pagination and idempotency:
    https://docs.valendata.com/api-reference/errors.
  license:
    name: Proprietary
    url: https://www.valendata.com/terms-and-conditions
servers:
  - url: https://api.valendata.com
    description: Production
security:
  - ApiKeyAuth: []
  - ApiKeyHeader: []
tags:
  - name: Skills
    description: List, create, read, update, and delete skills.
  - name: Runs
    description: Run skills and workflows, read any run, and cancel one.
  - name: Skill versions
    description: List, compare, restore, and pin a skill's versions.
  - name: Improvements
    description: >-
      Fix a skill, add fields, or re-learn its detail steps, and read its change
      history.
  - name: Schedules
    description: Run a skill or workflow on a fixed cadence.
  - name: Workflows
    description: List, create, read, update, and delete workflows.
  - name: Logins
    description: Saved website logins a skill can sign in with.
  - name: Account and usage
    description: Your plan, credit balance, and usage.
  - name: Webhooks
    description: The secret that signs webhook deliveries.
paths:
  /v1/skills/{slug}/run:
    post:
      tags:
        - Runs
      summary: Run a skill and wait
      description: >-
        Run a published Skill and wait for the rows. Put the Skill's inputs at
        the top level of the JSON body (or in the query string). The body keys
        `browser_type`, `proxy_config`, `profile_id`, `scrape_mode`,
        `max_pages`, and `version` are run settings, not inputs. Inputs are
        checked against `input_schema` before anything runs. If too many of your
        runs are in progress, this returns 429 with `Retry-After` instead of
        waiting.
      operationId: run_skill
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
          example: austin-dentists
        - name: max_results
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 500
                minimum: 0
              - type: 'null'
            title: Max Results
            description: >-
              Max rows to return; 0 means the entire list. Omit to use the
              skill's saved default.
          description: >-
            Max rows to return; 0 means the entire list. Omit to use the skill's
            saved default.
        - name: max_pages
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
          description: Page limit for paginated skills; 0 means all pages.
        - name: version
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
          description: Recipe version to replay for this call.
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              description: >-
                The skill's inputs at the top level, plus optional run settings:
                max_pages, version, browser_type, proxy_config, profile_id,
                scrape_mode.
              additionalProperties: true
            example:
              city: Houston
              max_pages: 1
      responses:
        '200':
          description: Skill executed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecuteSkillResponse'
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            Idempotent-Replayed:
              $ref: '#/components/headers/Idempotent-Replayed'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/Unprocessable'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - ApiKeyAuth: []
        - ApiKeyHeader: []
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
      description: >-
        Any unique string (such as your order id). Resending the same request
        with the same key within 24 hours returns the first answer (with
        `Idempotent-Replayed: true`) and does nothing twice; the same key with a
        different request is a 422 `idempotency_key_reused`.
      example: order-1234
  schemas:
    ExecuteSkillResponse:
      properties:
        status:
          type: string
          title: Status
        data:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Data
        count:
          type: integer
          title: Count
        execution_time_ms:
          type: integer
          title: Execution Time Ms
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        credits_charged:
          type: number
          title: Credits Charged
          default: 0
        cost_usd:
          type: number
          title: Cost Usd
          default: 0
        cost_final:
          type: boolean
          title: Cost Final
          default: true
        cost_estimate_credits:
          type: number
          title: Cost Estimate Credits
          default: 0
        drifted_fields:
          additionalProperties:
            type: string
          type: object
          title: Drifted Fields
          default: {}
        unverified_fields:
          additionalProperties:
            type: string
          type: object
          title: Unverified Fields
          default: {}
        rejected_values:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Rejected Values
          default: []
        truncated_sections:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Truncated Sections
          default: []
        scrape_mode_used:
          anyOf:
            - type: string
            - type: 'null'
          title: Scrape Mode Used
        triage_kind:
          anyOf:
            - type: string
            - type: 'null'
          title: Triage Kind
        failure_class:
          anyOf:
            - type: string
            - type: 'null'
          title: Failure Class
        credits_refunded:
          type: number
          title: Credits Refunded
          default: 0
        needs_user:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Needs User
        recipe_version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Recipe Version
        heal_kind:
          anyOf:
            - type: string
            - type: 'null'
          title: Heal Kind
        tier_used:
          anyOf:
            - type: string
            - type: 'null'
          title: Tier Used
        tier_timings:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Tier Timings
          default: []
        draft_run:
          type: boolean
          title: Draft Run
          default: false
        diagnosis:
          anyOf:
            - $ref: '#/components/schemas/Diagnosis'
            - type: 'null'
      type: object
      required:
        - status
        - data
        - count
        - execution_time_ms
      title: ExecuteSkillResponse
      description: Response from skill execution.
    Diagnosis:
      properties:
        rows:
          type: integer
          title: Rows
          default: 0
        missing_fields:
          items:
            type: string
          type: array
          title: Missing Fields
          description: Contract fields fewer than half the rows came back with.
        partial_fields:
          items:
            type: string
          type: array
          title: Partial Fields
          description: >-
            Fields filled on at least half the rows but not all, whose blank
            rows the page capture explained (see per_field severity/note).
        per_field:
          additionalProperties:
            $ref: '#/components/schemas/FieldDiagnosis'
          type: object
          title: Per Field
          description: 'Every field some rows lacked: fill, where it was tried, evidence.'
        triage_kind:
          anyOf:
            - type: string
            - type: 'null'
          title: Triage Kind
          description: >-
            missing_fields | partial_fields | not_shown | suspect_rows |
            element_changed | extraction_drift | blocked | logged_out |
            login_failed | site_down | page_not_loaded | recording_failed |
            unknown
        what_we_tried:
          items:
            type: string
          type: array
          title: What We Tried
        suggested_hint_examples:
          items:
            type: string
          type: array
          title: Suggested Hint Examples
          description: Example plain-English hints for improve_skill.
        quality_flags:
          items:
            $ref: '#/components/schemas/QualityFlag'
          type: array
          title: Quality Flags
          description: >-
            Single-run row checks that fired: repeated rows, pages repeating
            earlier pages, placeholder values.
        no_real_rows:
          type: boolean
          title: No Real Rows
          description: >-
            Rows came back but every field was empty on every one — the run
            never reached the results.
          default: false
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        summary:
          type: string
          title: Summary
          description: >-
            One readable line, e.g. 'phone: found on 0/5 rows — tried the result
            cards'.
          default: ''
      type: object
      title: Diagnosis
      description: >-
        Why the run came back short, and what a hint could say to fix it (POST
        /v1/skills/{slug}/improve).
    Error:
      type: object
      required:
        - detail
        - code
        - type
        - request_id
      properties:
        detail:
          description: What went wrong. A string, or an object for errors with more to say.
          oneOf:
            - type: string
            - additionalProperties: true
              type: object
        code:
          type: string
          description: >-
            Stable machine-readable code. Known values: `bad_request`,
            `invalid_json`, `invalid_cursor`, `invalid_idempotency_key`,
            `unauthorized`, `payment_required`, `permission_denied`,
            `not_found`, `method_not_allowed`, `conflict`,
            `idempotency_key_in_use`, `idempotent_replay_unavailable`,
            `payload_too_large`, `unsupported_media_type`, `validation_error`,
            `idempotency_key_reused`, `rate_limited`, `internal_error`,
            `upstream_error`, `service_unavailable`.
          example: not_found
        type:
          type: string
          enum:
            - invalid_request_error
            - authentication_error
            - billing_error
            - permission_error
            - conflict_error
            - idempotency_error
            - rate_limit_error
            - api_error
          description: The broad category of the error.
        request_id:
          type: string
          description: Also in the `X-Request-ID` header.
          example: 3f9a1c2b7d4e
        param:
          type: string
          description: >-
            The field at fault, on validation errors (dotted path, e.g.
            `inputs.city`).
        errors:
          type: array
          items:
            additionalProperties: true
            type: object
          description: Every validation problem, on a 422 from request validation.
    FieldDiagnosis:
      properties:
        filled:
          type: string
          title: Filled
          description: Rows that got the field, e.g. '0/5'.
        filled_count:
          type: integer
          title: Filled Count
          default: 0
        total:
          type: integer
          title: Total
          default: 0
        where_tried:
          items:
            type: string
          type: array
          title: Where Tried
          description: >-
            Where the recipe looked, e.g. 'the result cards', "each row's
            details page".
        evidence:
          type: string
          title: Evidence
          default: ''
        not_shown:
          anyOf:
            - type: integer
            - type: 'null'
          title: Not Shown
          description: >-
            Blank rows whose result card shows no value for the field at all
            (e.g. a sponsored card) — not a read the skill missed. Null when it
            could not be told.
        shown_unread:
          anyOf:
            - type: integer
            - type: 'null'
          title: Shown Unread
          description: >-
            Blank rows whose result card DOES show a value — a read the skill
            missed. Set on partial fields (filled on at least half the rows) the
            page capture could speak for.
        severity:
          anyOf:
            - type: string
            - type: 'null'
          title: Severity
          description: >-
            Partial fields only: warn (on the card but not read on some rows — a
            hint can fix it) | info (the blank rows' cards show no value —
            nothing to fix).
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
          description: >-
            Partial fields only, e.g. 'filled on 3/5 — on the card but not read
            on 2' or 'filled on 3/5 — not shown on 2 rows' cards'.
      type: object
      required:
        - filled
      title: FieldDiagnosis
    QualityFlag:
      properties:
        kind:
          type: string
          title: Kind
          description: repeated_rows | pagination_overlap | placeholder_values
        severity:
          type: string
          title: Severity
          description: fail (the output is not data; a validation rejects it) | warn
          default: warn
        message:
          type: string
          title: Message
          default: ''
        field:
          anyOf:
            - type: string
            - type: 'null'
          title: Field
      type: object
      required:
        - kind
      title: QualityFlag
      description: A single-run row check that fired (row_checks.py).
  headers:
    X-Request-ID:
      description: >-
        This request's id (yours, if you sent a valid `X-Request-ID`). Quote it
        to support.
      schema:
        type: string
    X-RateLimit-Limit:
      description: Requests a minute this API key may make.
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests left in the current minute.
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Unix time (seconds) the current window ends.
      schema:
        type: integer
    Idempotent-Replayed:
      description: >-
        `true` when this is the stored answer to an earlier request with the
        same Idempotency-Key.
      schema:
        type: string
    Retry-After:
      description: Seconds to wait before retrying.
      schema:
        type: integer
  responses:
    BadRequest:
      description: >-
        The request is malformed: the body is not JSON, the cursor or
        Idempotency-Key is not valid.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: >-
              The request is malformed: the body is not JSON, the cursor or
              Idempotency-Key is not valid.
            code: invalid_json
            type: invalid_request_error
            request_id: 3f9a1c2b7d4e
    Unauthorized:
      description: The API key is missing, malformed, revoked, or expired.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: The API key is missing, malformed, revoked, or expired.
            code: unauthorized
            type: authentication_error
            request_id: 3f9a1c2b7d4e
    PaymentRequired:
      description: >-
        Not enough credits to start. `detail` includes `current_balance` and
        `required`.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: >-
              Not enough credits to start. `detail` includes `current_balance`
              and `required`.
            code: payment_required
            type: billing_error
            request_id: 3f9a1c2b7d4e
    Forbidden:
      description: >-
        The key lacks a scope, is limited to other skills or workflows, or you
        may not do this.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: >-
              The key lacks a scope, is limited to other skills or workflows, or
              you may not do this.
            code: permission_denied
            type: permission_error
            request_id: 3f9a1c2b7d4e
    NotFound:
      description: It does not exist, or it is not yours to see.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: It does not exist, or it is not yours to see.
            code: not_found
            type: invalid_request_error
            request_id: 3f9a1c2b7d4e
    Conflict:
      description: >-
        A conflict with the current state, or a request with this
        Idempotency-Key is still running.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: >-
              A conflict with the current state, or a request with this
              Idempotency-Key is still running.
            code: conflict
            type: conflict_error
            request_id: 3f9a1c2b7d4e
    Unprocessable:
      description: >-
        A field is invalid (`param` names it), or the Idempotency-Key was used
        with a different request.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: 'Invalid request — name: Field required'
            code: validation_error
            type: invalid_request_error
            request_id: 3f9a1c2b7d4e
            param: name
            errors:
              - type: missing
                loc:
                  - body
                  - name
                msg: Field required
    RateLimited:
      description: >-
        Too many requests for this key, or too many runs in progress. Wait
        `Retry-After` seconds.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: >-
              Too many requests for this key, or too many runs in progress. Wait
              `Retry-After` seconds.
            code: rate_limited
            type: rate_limit_error
            request_id: 3f9a1c2b7d4e
    InternalError:
      description: >-
        Something broke on our side. Retry; runs that fail on our side are
        refunded.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: >-
              Something broke on our side. Retry; runs that fail on our side are
              refunded.
            code: internal_error
            type: api_error
            request_id: 3f9a1c2b7d4e
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: vd_sk_...
      description: >-
        API key with the `vd_sk_` prefix, as `Authorization: Bearer vd_sk_...`.
        Create keys in Settings → API Keys.
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: The same API key in the `x-api-key` header.

````

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