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

# Replace the join code

> Turns off the current code and issues a new one. Needs `humans:write`.



## OpenAPI

````yaml POST /api/workflows/{id}/join-code/rotate
openapi: 3.1.0
info:
  title: HITL API
  version: 1.0.0
  description: >-
    Run the workflows you build in HITL, follow each run until a person has
    answered, and manage who reviews them.
servers:
  - url: https://api.hitl.sh/v1
security:
  - bearerAuth: []
tags:
  - name: Workflows
  - name: Runs
  - name: Reviewers
  - name: Webhooks
  - name: Account
  - name: Uploads
paths:
  /api/workflows/{id}/join-code/rotate:
    post:
      tags:
        - Reviewers
      summary: Replace the join code
      description: Turns off the current code and issues a new one. Needs `humans:write`.
      operationId: reviewers-rotate-join-code
      parameters:
        - name: id
          in: path
          required: true
          description: The workflow id
          schema:
            type: string
            example: 6af2ce4e8207961501f59472
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: boolean
                  msg:
                    type: string
                  data:
                    $ref: '#/components/schemas/JoinCode'
              example:
                error: false
                msg: Invite code rotated
                data:
                  code: HITL-9F3KQZ
                  created_at: '2026-11-10T07:57:26Z'
                  id: 6af2ce668207961501f59488
                  invite_url: https://hitl.sh/invites/HITL-9F3KQZ
                  join_url: https://my.hitl.sh/join/HITL-9F3KQZ
                  status: active
                  usage_count: 0
        '401':
          $ref: '#/components/responses/E401'
        '404':
          $ref: '#/components/responses/E404'
components:
  schemas:
    JoinCode:
      type: object
      properties:
        id:
          type: string
        code:
          type: string
          example: HITL-422WCA
        invite_url:
          type: string
        join_url:
          type: string
        status:
          type: string
        usage_count:
          type: integer
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
        - msg
      properties:
        error:
          type: boolean
          example: true
        msg:
          type: string
          description: What went wrong, in plain words
        code:
          type: string
          description: >-
            A machine-readable reason, when there is one (for example
            `confirmation_required`)
  responses:
    E401:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: true
            msg: Invalid API key
    E404:
      description: Not found, or not yours
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: true
            msg: Workflow not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key: `hitl_live_…`'

````

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