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

# Onboard Company

> Set up an organization from a company description. Creates jobs, scripts, and knowledge base entries using AI.

AI-powered company setup. Provide your company name and a description, and Classet creates up to five published jobs and a set of knowledge base entries (company FAQs and a company overview).

Onboarding generates no interview scripts. Every job it creates uses your organization's **default script**, so the organization must have one — without it the call returns `400`. `jobs_created[].script_id` is that default script's id. To give a job its own script, use [Generate Script](/docs/api-reference/ai/generate-script.md), save it as described there, and attach it with [Update Job](/docs/api-reference/jobs/update-job.md).

```bash cURL theme={null}
curl -X POST https://api.classet.ai/v2/onboard \
  -H "X-API-KEY: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "company_name": "Sunrise Home Health",
    "company_description": "Home health agency providing skilled nursing, therapy, and personal care services across Texas.",
    "roles_to_hire": ["Registered Nurse", "Certified Nursing Assistant"],
    "industry": "Healthcare"
  }'
```

```json 201 theme={null}
{
  "data": {
    "jobs_created": [
      {
        "job_id": "abc123def",
        "title": "Registered Nurse",
        "script_id": 15
      },
      {
        "job_id": "ghi456jkl",
        "title": "Certified Nursing Assistant",
        "script_id": 15
      }
    ],
    "knowledge_entries_created": 8
  }
}
```

> [!NOTE]
>
> This endpoint creates real resources in your account. The jobs are published at once with no location, and each job's candidate-facing title is the role followed by ` - Remote`. Review the generated jobs and knowledge entries in the dashboard before candidates reach them. Cleanup after a failure is best-effort: when the AI provider errors or times out partway, the jobs and knowledge entries already created stay. Before you retry a failed call, check `GET /v2/jobs` and `GET /v2/knowledge` and delete anything it left, or the retry creates duplicates.

> [!WARNING]
>
> Never retry `POST /v2/onboard` automatically, including on a `500` or `504` and with an `Idempotency-Key`. A `5xx` is never cached as an idempotent response, so the retry runs the whole onboarding again on top of whatever the failed call left behind. Exclude this endpoint from any generic retry loop, and retry by hand only after the cleanup above.


## OpenAPI

````yaml POST /v2/onboard
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/onboard:
    post:
      tags:
        - AI
      summary: AI-powered onboarding
      description: >-
        Set up an organization from a company description. Creates jobs,
        scripts, and knowledge base entries using AI.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                company_name:
                  type: string
                  minLength: 1
                  example: Acme Corp
                  description: Your company name.
                company_description:
                  type: string
                  example: We build payment infrastructure for startups
                  description: >-
                    A description of your company and what you do. The more
                    detail you provide, the better the generated content.
                roles_to_hire:
                  type: array
                  items:
                    type: string
                  example:
                    - Senior Software Engineer
                    - Product Designer
                  description: >-
                    Job titles you want to create. If omitted, the AI will
                    suggest roles based on your company description.
                industry:
                  type: string
                  example: Technology
                  description: >-
                    Your industry (e.g. `"Healthcare"`, `"Construction"`,
                    `"Staffing"`).
              required:
                - company_name
      responses:
        '201':
          description: Onboarding complete
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      jobs_created:
                        type: array
                        items:
                          type: object
                          properties:
                            job_id:
                              type: string
                              description: >-
                                The v2 job ID (`jobs.id`), as GET /v2/jobs
                                returns it. `job_shortcode`, where present, is
                                the v1 shortcode of the same job; every
                                `{jobId}` and `job_id` input accepts either.
                            title:
                              type: string
                            script_id:
                              type: integer
                              nullable: true
                          required:
                            - job_id
                            - title
                            - script_id
                        description: >-
                          List of jobs that were created, each with `job_id`,
                          `title`, and `script_id`.
                      knowledge_entries_created:
                        type: integer
                        description: Number of knowledge base entries that were generated.
                    required:
                      - jobs_created
                      - knowledge_entries_created
                required:
                  - data
        '400':
          description: Organization setup is incomplete
          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
        '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.