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

# Get State by State ID

> Get a state by its unique state ID.



## OpenAPI

````yaml https://agentex.dev-sgp.scale.com/openapi.json get /states/{state_id}
openapi: 3.1.0
info:
  title: Agentex API
  version: 0.1.0
servers: []
security: []
paths:
  /states/{state_id}:
    get:
      tags:
        - States
      summary: Get State by State ID
      description: Get a state by its unique state ID.
      operationId: get_state_states__state_id__get
      parameters:
        - name: state_id
          in: path
          required: true
          schema:
            type: string
            title: State Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/State'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    State:
      properties:
        task_id:
          type: string
          title: The unique id of the task to send the state to
        agent_id:
          type: string
          title: The unique id of the agent to send the state to
        state:
          additionalProperties: true
          type: object
          title: The state to send to the task.
        id:
          type: string
          title: Id
          description: The task state's unique id
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The timestamp when the state was created
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: The timestamp when the state was last updated
      type: object
      required:
        - task_id
        - agent_id
        - state
        - id
        - created_at
      title: State
      description: >-
        Represents a state in the agent system. A state is associated uniquely
        with a task and an agent.


        This entity is used to store states in MongoDB, with each state

        associated with a specific task and agent. The combination of task_id
        and agent_id is globally unique.


        The state is a dictionary of arbitrary data.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````