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

# Generate Job

> Uses AI to generate a complete job posting from a title and optional description. Returns structured data ready to create via POST /v2/jobs.

Uses AI to generate a complete job posting from a title and optional context. Returns structured data shaped for [Create Job](/docs/api-reference/jobs/create-job.md). Nothing is saved.

`location` in the output is `null` unless you send a `location`; when you do, it comes back as `location_str` with `workplace_type: "onsite"`. Create Job requires a `location` with a `workplace_type`, so add or correct it before you pass the output on.

```bash cURL theme={null}
curl -X POST https://api.classet.ai/v2/jobs/generate \
  -H "X-API-KEY: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Licensed Plumber",
    "location": "Houston, TX",
    "brief_description": "Residential service plumber for new construction and repairs",
    "company_name": "Gulf Coast Plumbing"
  }'
```

```json 200 theme={null}
{
  "data": {
    "title": "Licensed Plumber",
    "description": "<h3>About the Role</h3><p>Gulf Coast Plumbing is looking for a licensed plumber to join our residential team...</p>",
    "location": {
      "location_str": "Houston, TX",
      "workplace_type": "onsite"
    },
    "benefits": "Health insurance, paid time off, company vehicle, tool allowance",
    "faqs": [
      {
        "question": "What types of plumbing work will I be doing?",
        "answer": "You'll handle new construction rough-ins, fixture installations, and service repairs for residential properties."
      },
      {
        "question": "Is a license required?",
        "answer": "Yes, a valid Texas journeyman or master plumber license is required."
      }
    ],
    "application_questions": [
      {
        "question": "Do you hold a valid Texas plumbing license?",
        "type": "yes_no",
        "disqualify_on": "no"
      },
      {
        "question": "How many years of residential plumbing experience do you have?",
        "type": "text"
      }
    ]
  }
}
```

> [!NOTE]
>
> AI generation calls count against your organization's ordinary request rate limit; there is no separate AI limit. The generated content is a starting point — review and customize before publishing.


## OpenAPI

````yaml POST /v2/jobs/generate
openapi: 3.1.0
info:
  title: Classet API
  version: 2.0.3
  description: >-
    AI-powered recruiting and phone screening API.


    **API key scopes.** `read` covers every GET; any other method needs `write`
    (403 `insufficient_scope`); starting or stopping an interview also needs
    `interviews:send`. A branch-limited key sees and writes only jobs in its
    branches (not jobs with no branch) and their candidates, applications and
    calls; anything outside is a 404. An organization-group key is read-only
    across every organization in its group. Branch-limited and group keys cannot
    use organization configuration (scripts, knowledge, webhooks, message
    automations, agent settings, AI generation, organization): 403
    `restricted_key_unsupported`. `GET /v2/me` reports what the calling key can
    do.
servers:
  - url: https://api.classet.ai
    description: Production
  - url: http://localhost:8081
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /v2/jobs/generate:
    post:
      tags:
        - AI
      summary: Generate a job posting with AI
      description: >-
        Uses AI to generate a complete job posting from a title and optional
        description. Returns structured data ready to create via POST /v2/jobs.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  minLength: 1
                  example: Senior Software Engineer
                  description: The job title to generate a posting for.
                location:
                  type: string
                  example: San Francisco, CA
                  description: Location for the role (e.g. `"San Francisco, CA"`).
                brief_description:
                  type: string
                  example: >-
                    Looking for a senior full-stack engineer to lead our
                    payments team
                  description: Additional context about the role to guide generation.
                company_name:
                  type: string
                  example: Acme Corp
                  description: Your company name, used to personalize the description.
              required:
                - title
      responses:
        '200':
          description: Generated job data
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      title:
                        type: string
                        description: The job title (echoed back).
                      description:
                        type: string
                        description: >-
                          Full HTML job description with sections for About the
                          Role, Responsibilities, Requirements, and What We
                          Offer.
                      location:
                        nullable: true
                        description: Parsed location object.
                      benefits:
                        type: string
                        nullable: true
                        description: Comma-separated list of key benefits.
                      faqs:
                        type: array
                        nullable: true
                        items:
                          type: object
                          properties:
                            question:
                              type: string
                            answer:
                              type: string
                          required:
                            - question
                            - answer
                        description: >-
                          3-5 AI-generated FAQs candidates might ask about this
                          role.
                      application_questions:
                        type: array
                        nullable: true
                        items:
                          type: object
                          properties:
                            question:
                              type: string
                            type:
                              type: string
                            disqualify_on:
                              type: string
                          required:
                            - question
                            - type
                        description: >-
                          Suggested screening questions with types and
                          disqualification criteria.
                    required:
                      - title
                      - description
                      - benefits
                      - faqs
                      - application_questions
                required:
                  - data
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Resource not found
                  code:
                    type: string
                    enum:
                      - not_found
                      - validation_error
                      - unauthorized
                      - forbidden
                      - insufficient_scope
                      - restricted_key_unsupported
                      - branch_out_of_scope
                      - key_misconfigured
                      - quota_exceeded
                      - rate_limited
                      - rate_limit_unavailable
                      - conflict
                      - idempotency_key_reuse
                      - candidate_opted_out
                      - recently_contacted
                      - request_in_progress
                      - unprocessable
                      - bad_request
                      - payload_too_large
                      - internal_error
                      - service_unavailable
                    example: not_found
                    description: Stable machine-readable error code.
                  request_id:
                    type: string
                    example: 9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f
                    description: >-
                      Request ID, also echoed in the X-Request-Id response
                      header. Include it when reporting issues.
                required:
                  - error
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Your Classet API key. Create and rotate keys in Settings → API.

````

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