Skip to content

fix(openapi): add prompt parameter and response fields to interact endpoint#754

Open
firecrawl-spring[bot] wants to merge 1 commit intomainfrom
fix/openapi-interact-prompt-parameter
Open

fix(openapi): add prompt parameter and response fields to interact endpoint#754
firecrawl-spring[bot] wants to merge 1 commit intomainfrom
fix/openapi-interact-prompt-parameter

Conversation

@firecrawl-spring
Copy link
Copy Markdown
Contributor

@firecrawl-spring firecrawl-spring Bot commented Apr 8, 2026

Summary

  • The OpenAPI spec for POST /v2/scrape/{scrapeId}/interact was missing the prompt request parameter and marked code as required, making it appear that only code execution mode was supported
  • Added the prompt parameter, removed the required: ["code"] constraint, and added output, liveViewUrl, interactiveLiveViewUrl to the response schema
  • This aligns the OpenAPI spec with the feature guide documentation in features/interact.mdx which already correctly documents both modes

What changed

api-reference/v2-openapi.json — interact endpoint (POST /scrape/{jobId}/interact):

Request body:

  • Removed "required": ["code"] (either prompt or code is needed, not just code)
  • Added prompt string parameter (max 10,000 chars) for natural language AI agent tasks

Response (200):

  • Added output — the agent's natural language answer (prompt mode only)
  • Added liveViewUrl — read-only live view URL for the browser session
  • Added interactiveLiveViewUrl — interactive live view URL
  • Updated result description to cover both prompt and code modes

Related Pylon Ticket

https://app.usepylon.com/issues?issueNumber=23922

Test plan

  • Verify the generated API reference page now shows the prompt parameter
  • Verify SDK codegen picks up the new parameter (no longer requires code)
  • Confirm the response schema includes output, liveViewUrl, interactiveLiveViewUrl

Open with Devin

…dpoint

The OpenAPI spec for POST /v2/scrape/{scrapeId}/interact was missing the
prompt parameter and marked code as required, making it appear that only
code execution was supported. This caused SDK-generated clients and
auto-generated API reference pages to hide the prompt-based AI agent
capability.

Changes:
- Remove required: ["code"] constraint (either prompt or code is needed)
- Add prompt request parameter with description and max length
- Add output, liveViewUrl, interactiveLiveViewUrl response fields
- Update result field description to cover both prompt and code modes

Co-Authored-By: micahstairs <micah@sideguide.dev>
@firecrawl-spring firecrawl-spring Bot requested a review from micahstairs April 8, 2026 13:22
@mintlify
Copy link
Copy Markdown

mintlify Bot commented Apr 8, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
firecrawl 🟢 Ready View Preview Apr 8, 2026, 1:25 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment on lines 162 to 176
"properties": {
"prompt": {
"type": "string",
"minLength": 1,
"maxLength": 10000,
"description": "Natural language task for the AI agent. Required if `code` is not set."
},
"code": {
"type": "string",
"minLength": 1,
"maxLength": 100000,
"description": "Code to execute in the scrape-bound browser sandbox"
"description": "Code to execute in the scrape-bound browser sandbox. Required if `prompt` is not set."
},
"language": {
"type": "string",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 OpenAPI schema allows requests with neither prompt nor code

The old schema had "required": ["code"], enforcing that code must be provided. The new schema removes this required constraint without adding an equivalent oneOf/anyOf to enforce that at least one of prompt or code is present. The field descriptions state "Required if code is not set" and "Required if prompt is not set", but the schema itself permits a request body with neither field, which would be invalid per the documented intent. Tools and clients that generate code or validation from this OpenAPI spec will not enforce the mutual-requirement constraint.

(Refers to lines 162-192)

Prompt for agents
In api-reference/v2-openapi.json, around line 161-192 in the request body schema for the /scrape/{jobId}/interact endpoint, the old `required: ["code"]` was removed but no replacement constraint was added. The descriptions on `prompt` and `code` say one is required if the other is not set, but the schema doesn't enforce this.

To fix this in OpenAPI 3.0, add a `oneOf` (or `anyOf`) at the schema level that requires at least one of the two fields. For example:

"schema": {
  "type": "object",
  "anyOf": [
    { "required": ["prompt"] },
    { "required": ["code"] }
  ],
  "properties": { ... }
}

This ensures code-generated clients and validators correctly reject requests missing both fields.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@micahstairs
Copy link
Copy Markdown
Member

@devhims review comment looks actionable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants