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

# Publish Session

> Promote the latest committed version to published (1.x) and return
the API address. Gated on the green board (no in-flight or failing runs
pinned to the candidate).



## OpenAPI

````yaml https://www.datalab.to/openapi.json post /api/v1/agent-studio/sessions/{session_id}/publish
openapi: 3.1.0
info:
  title: Datalab API
  version: 0.0.1
servers:
  - url: https://www.datalab.to
    description: Datalab API
security: []
paths:
  /api/v1/agent-studio/sessions/{session_id}/publish:
    post:
      tags:
        - agent-studio
      summary: Publish Session
      description: |-
        Promote the latest committed version to published (1.x) and return
        the API address. Gated on the green board (no in-flight or failing runs
        pinned to the candidate).
      operationId: publish_session_api_v1_agent_studio_sessions__session_id__publish_post
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: integer
            title: Session Id
        - name: wos-session
          in: cookie
          required: false
          schema:
            type: string
            title: Wos-Session
        - name: datalab_active_team
          in: cookie
          required: false
          schema:
            type: string
            title: Datalab Active Team
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublishResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    PublishResponse:
      properties:
        version:
          $ref: '#/components/schemas/VersionResponse'
        processor_id:
          type: string
          title: Processor Id
          description: Public processor slug.
        address:
          type: string
          title: Address
          description: The execution address, e.g. processor=ap_x@1.0.
      type: object
      required:
        - version
        - processor_id
        - address
      title: PublishResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    VersionResponse:
      properties:
        label:
          type: string
          title: Label
        state:
          type: string
          enum:
            - draft
            - committed
            - published
          title: State
        contract:
          $ref: '#/components/schemas/ContractModel'
        checks:
          items:
            $ref: '#/components/schemas/CheckSpecModel'
          type: array
          title: Checks
        caused_by:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Caused By
        created:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created
      type: object
      required:
        - label
        - state
        - contract
        - checks
      title: VersionResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ContractModel:
      properties:
        goal:
          type: string
          title: Goal
        output_shape:
          type: string
          enum:
            - parse
            - json
            - jats
            - wcag
            - segment
          title: Output Shape
        output_schema:
          anyOf:
            - type: string
            - type: 'null'
          title: Output Schema
        rules:
          items:
            $ref: '#/components/schemas/RuleFragmentModel'
          type: array
          title: Rules
        parse_params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parse Params
        knobs:
          anyOf:
            - $ref: '#/components/schemas/KnobsModel'
            - type: 'null'
      type: object
      required:
        - goal
        - output_shape
      title: ContractModel
      description: The freezable record a version snapshots (contract JSONB).
    CheckSpecModel:
      properties:
        id:
          type: string
          title: Id
        label:
          type: string
          title: Label
        description:
          type: string
          title: Description
          default: ''
        kind:
          type: string
          enum:
            - code
            - judge
          title: Kind
        blocking:
          type: boolean
          title: Blocking
          default: false
        source:
          type: string
          enum:
            - base
            - catalog
            - user
          title: Source
          default: base
        modified_from_base:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Modified From Base
      type: object
      required:
        - id
        - label
        - kind
      title: CheckSpecModel
      description: One verifier in the contract (frontend CheckSpec, snake_case).
    RuleFragmentModel:
      properties:
        id:
          type: string
          title: Id
        text:
          type: string
          title: Text
        source:
          type: string
          enum:
            - base
            - agent
            - user
          title: Source
          default: user
      type: object
      required:
        - id
        - text
      title: RuleFragmentModel
    KnobsModel:
      properties:
        max_turns:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Max Turns
        timeout_s:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Timeout S
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
      type: object
      title: KnobsModel
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````