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

# Set interview state

> Changes the lifecycle status of an interview or position (draft, active, archived, preparing, completed, deleted) and/or manages its embed key. Provide at least one of `status` or `is_embedded`.



## OpenAPI

````yaml https://cool.jobmojito.com/functions/v1/openapi post /job-interview-set-state
openapi: 3.1.0
info:
  title: JobMojito API
  version: 1.0.0
  description: >-
    Public API for JobMojito, served by Supabase Edge Functions. Authenticate
    with a Supabase JWT access token via the Authorization header.
servers:
  - url: https://cool.jobmojito.com/functions/v1
    description: Production
security: []
tags:
  - name: Interviews
    description: >-
      Create, configure and manage interview / coaching / assessment
      definitions.
  - name: Results
    description: >-
      Interview results, transcripts, reports, re-attempt requests and
      analytics.
  - name: Candidates
    description: List and manage candidates.
  - name: Knowledge base
    description: Upload documents used to generate knowledge-base interviews.
  - name: Resume & Form verification
    description: Pre-screen candidates from resumes and forms.
  - name: Admin
    description: >-
      Account administration — invite team/coaching users, manage sub-merchants
      and avatar templates.
paths:
  /job-interview-set-state:
    post:
      tags:
        - Interviews
      summary: Set interview state
      description: >-
        Changes the lifecycle status of an interview or position (draft, active,
        archived, preparing, completed, deleted) and/or manages its embed key.
        Provide at least one of `status` or `is_embedded`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JobInterviewSetStateRequest'
      responses:
        '200':
          description: State updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobInterviewSetStateResponse'
        '401':
          description: Missing, expired or invalid access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: >-
            Server error (includes authorization failures and unresolved
            position/interview ids).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    JobInterviewSetStateRequest:
      type: object
      properties:
        position_id:
          type: string
          minLength: 1
          format: uuid
          description: Interview definition id or position id whose state should change.
          example: 00000000-0000-0000-0000-000000000000
        status:
          type: string
          nullable: true
          enum:
            - draft
            - active
            - archived
            - deleted
            - preparing
            - completed
          description: New lifecycle status to apply.
        is_embedded:
          type: boolean
          nullable: true
          description: >-
            Controls iframe embedding of the interview on an external page. When
            true, ensures an embed key exists (returns
            embed_id/embed_signing_key, used to authenticate/sign the iframe
            embed). When false, removes the embed keys (disables embedding).
      required:
        - position_id
    JobInterviewSetStateResponse:
      anyOf:
        - type: object
          properties:
            success:
              type: boolean
          required:
            - success
        - type: object
          properties:
            embed_id:
              type: string
            embed_signing_key:
              type: string
          required:
            - embed_id
            - embed_signing_key
      description: >-
        Returns `{ embed_id, embed_signing_key }` when an embed key was
        created/returned (is_embedded=true), otherwise `{ success: true }`.
    Error:
      type: object
      properties:
        error:
          type: string
          example: Field is required.
        name:
          type: string
          example: interview_result_id
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Supabase JWT access token, passed as `Authorization: Bearer <token>`.'

````