Endpoint
Description
Initiates a new service job request. This endpoint:- Calls Grok LLM to infer the task type from the user’s query
- Generates up to 5 clarifying questions specific to the task
- Creates a Job object stored in-memory
- Returns a
job_id, inferredtask, andquestionsfor the user to answer
Request Body
User’s free text query describing the service needed.Example:
"fix my toilet"Full house address where the service is needed.Example:
"123 Main St, San Jose, CA 95126"ZIP code for the service location. Used for provider search.Example:
"95126"Maximum price the user is willing to pay. Can be a dollar amount or the string
"no_limit".Example: 250 or "no_limit"Date when the service is needed in ISO format.Example:
"2025-12-10"Response
Unique identifier for the created job. Use this ID in subsequent API calls.Example:
"550e8400-e29b-41d4-a716-446655440000"The inferred task type determined by Grok LLM from the user’s query.Example:
"plumber"Array of clarifying questions (up to 5) to gather more context about the job.
Example Request
Example Response
Error Responses
Next Steps
After receiving thejob_id and questions:
- Present the questions to the user
- Collect their answers
- Call POST /api/complete-job with the
job_idand answers to find service providers
Implementation Details
Job Storage: Jobs are stored in-memory and do not persist to the database. The job object contains:- Original query and inferred task
- User location (address, ZIP code)
- Constraints (price limit, date needed)
- Clarifying questions and answers (once provided)
- Job status (starts as
"collecting_info")