# Generate Targets for a resume and start a Discovery run

Creates a drafting Discovery run and returns it at once, while Hiresweep AI reads the resume and writes its Targets in the background: the job titles the resume qualifies for, each with the exact keywords an applicant tracking system scans for. Targets land on the run one by one; read the run until targetsGeneratingSince is null. Uses one AI action. A generation that fails is recorded on the run with a reason to retry rather than returned as an error. Pass clientId to run for one client. Requires authentication.

```http
POST https://hiresweep.com/api/openapi/discovery/runs
x-api-key: YOUR_API_KEY
```

## Request body

```json
{
  "type": "object",
  "properties": {
    "resumeId": {
      "type": "string",
      "minLength": 1,
      "description": "The ID of the resume to search from."
    },
    "targetCount": {
      "type": "integer",
      "minimum": 3,
      "maximum": 10,
      "description": "How many Targets to generate, between 3 and 10."
    },
    "clientId": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "description": "The client whose data this is, for an operator applying on behalf of clients. Omit for your own."
    }
  },
  "required": [
    "resumeId",
    "targetCount"
  ]
}
```

## Responses

- `200`: The drafting run, with its Targets being generated.
