---
title: "Get session form"
method: GET
path: "/api/session/{sessionID}/form/{formID}"
tags: ["session"]
---

# Get session form

`GET /api/session/{sessionID}/form/{formID}`

## Request

- Base URL: `https://opencode.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://opencode.ai/api/session/{sessionID}/form/{formID}`
- Auth: none required

Retrieve a form and its current state for a session.

## Path parameters

- `sessionID` string, required
- `formID` string, required

## Response `200`

Success

- object
  - `data` FormDetail, required
    - `id` string, required
    - `sessionID` string, required
    - `title` string, required
    - `metadata` FormMetadata
    - `fields` FormField[], required
      - union
        - FormStringField
          - `key` string, required
          - `title` string
          - `description` string
          - `required` boolean
          - `hidden` boolean
          - `when` FormWhen[]
            - `key` string, required
            - `op` 'eq' | 'neq', required
            - `value` union, required
              - …
          - `type` 'string', required
          - `format` 'email' | 'uri' | 'date' | 'date-time'
          - `minLength` integer
          - `maxLength` integer
          - `pattern` string
          - `placeholder` string
          - `default` string
          - `options` FormOption[]
            - `value` string, required
            - `label` string, required
            - `description` string
          - `custom` boolean
        - FormNumberField
          - `key` string, required
          - `title` string
          - `description` string
          - `required` boolean
          - `hidden` boolean
          - `when` FormWhen[]
            - `key` string, required
            - `op` 'eq' | 'neq', required
            - `value` union, required
              - …
          - `type` 'number', required
          - `minimum` union
            - number
            - 'Infinity' | '-Infinity' | 'NaN'
          - `maximum` union
            - number
            - 'Infinity' | '-Infinity' | 'NaN'
          - `default` union
            - number
            - 'Infinity' | '-Infinity' | 'NaN'
        - FormIntegerField
          - `key` string, required
          - `title` string
          - `description` string
          - `required` boolean
          - `hidden` boolean
          - `when` FormWhen[]
            - `key` string, required
            - `op` 'eq' | 'neq', required
            - `value` union, required
              - …
          - `type` 'integer', required
          - `minimum` union
            - number
            - 'Infinity' | '-Infinity' | 'NaN'
          - `maximum` union
            - number
            - 'Infinity' | '-Infinity' | 'NaN'
          - `default` union
            - number
            - 'Infinity' | '-Infinity' | 'NaN'
        - FormBooleanField
          - `key` string, required
          - `title` string
          - `description` string
          - `required` boolean
          - `hidden` boolean
          - `when` FormWhen[]
            - `key` string, required
            - `op` 'eq' | 'neq', required
            - `value` union, required
              - …
          - `type` 'boolean', required
          - `default` boolean
        - FormMultiselectField
          - `key` string, required
          - `title` string
          - `description` string
          - `required` boolean
          - `hidden` boolean
          - `when` FormWhen[]
            - `key` string, required
            - `op` 'eq' | 'neq', required
            - `value` union, required
              - …
          - `type` 'multiselect', required
          - `options` FormOption[], required
            - `value` string, required
            - `label` string, required
            - `description` string
          - `minItems` integer
          - `maxItems` integer
          - `custom` boolean
          - `default` string[]
        - FormExternalField
          - `key` string, required
          - `type` 'external', required
          - `url` string, required
          - `title` string
          - `description` string
    - `state` union, required
      - object
        - `status` 'pending', required
      - object
        - `status` 'answered', required
        - `answer` FormAnswer, required
      - object
        - `status` 'cancelled', required
        - `message` string

## Other responses

- `400`: InvalidRequestError
- `401`: UnauthorizedError
- `404`: SessionNotFoundError | FormNotFoundError | LocationNotFoundError

---

[API](https://skmtc.dev/kaaass/apis/opencode.md) - [All operations](https://skmtc.dev/kaaass/apis/opencode/llms.txt) - [OpenAPI document](https://skmtc.dev/kaaass/apis/opencode/revisions/4e083d954707?raw)
