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

# Workspace Behaviour

> Every agent, worst first.

**Who may call it:** any role. A workspace API key is refused here: this is an act that belongs to a named person.



## OpenAPI

````yaml /api/openapi.json get /v1/behaviour
openapi: 3.1.0
info:
  title: RotaGrant API
  version: 0.1.0
  description: >-
    The HTTP API of a RotaGrant deployment, made from the product's own route
    definitions at the commit named in `x-rotascale-source`. Nothing here is
    written by hand.


    There is no shared endpoint. RotaGrant runs in your environment, and your
    deployment serves its own copy of this description at `/api/docs`. That copy
    is the authority on what your version has and which features are switched
    on; this one is the reference for one commit of the main line. The version
    is 0.1.0: routes and shapes can still change.


    Every route says who may call it. Most need a bearer token from the identity
    provider your deployment uses, held by a person with the role named. The
    routes an SDK calls also accept a workspace API key. A few are open, and say
    why.
servers:
  - url: https://{deployment}
    description: Your own deployment. There is no shared endpoint.
    variables:
      deployment:
        default: rotagrant.internal.example
        description: The host your deployment answers on.
security: []
paths:
  /v1/behaviour:
    get:
      tags:
        - Behaviour
      summary: Workspace Behaviour
      description: >-
        Every agent, worst first.


        **Who may call it:** any role. A workspace API key is refused here: this
        is an act that belongs to a named person.
      operationId: workspace_behaviour_v1_behaviour_get
      parameters:
        - name: window_days
          in: query
          required: false
          schema:
            type: integer
            maximum: 365
            minimum: 1
            default: 30
            title: Window Days
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DriftListOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - bearerToken: []
components:
  schemas:
    DriftListOut:
      properties:
        agents:
          items:
            $ref: '#/components/schemas/DriftOut'
          type: array
          title: Agents
        silent:
          type: integer
          title: Silent
        contracts:
          additionalProperties:
            $ref: '#/components/schemas/ContractStateOut'
          type: object
          title: Contracts
          default: {}
        breached:
          type: integer
          title: Breached
          default: 0
      type: object
      required:
        - agents
        - silent
      title: DriftListOut
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DriftOut:
      properties:
        agent_id:
          type: string
          title: Agent Id
        classification:
          type: string
          title: Classification
        baseline:
          $ref: '#/components/schemas/FingerprintOut'
        current:
          $ref: '#/components/schemas/FingerprintOut'
        shifts:
          items:
            $ref: '#/components/schemas/ShiftOut'
          type: array
          title: Shifts
        explanations:
          items:
            $ref: '#/components/schemas/ExplanationOut'
          type: array
          title: Explanations
        not_assessed:
          anyOf:
            - type: string
            - type: 'null'
          title: Not Assessed
        what_this_means:
          type: string
          title: What This Means
        minimum_decisions:
          type: integer
          title: Minimum Decisions
      type: object
      required:
        - agent_id
        - classification
        - baseline
        - current
        - shifts
        - explanations
        - what_this_means
        - minimum_decisions
      title: DriftOut
    ContractStateOut:
      properties:
        declared:
          type: boolean
          title: Declared
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        breached:
          items:
            type: string
          type: array
          title: Breached
          default: []
        claim_stated:
          type: boolean
          title: Claim Stated
          default: false
        breakers:
          type: integer
          title: Breakers
          default: 0
        armed:
          type: integer
          title: Armed
          default: 0
      type: object
      required:
        - declared
      title: ContractStateOut
      description: One agent's contract, for the estate view.
    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
    FingerprintOut:
      properties:
        agent_id:
          type: string
          title: Agent Id
        window_start:
          type: string
          title: Window Start
        window_end:
          type: string
          title: Window End
        decisions:
          type: integer
          title: Decisions
        reportable:
          type: boolean
          title: Reportable
        outcomes:
          additionalProperties:
            type: number
          type: object
          title: Outcomes
        tools:
          additionalProperties:
            type: number
          type: object
          title: Tools
        amount_median:
          anyOf:
            - type: number
            - type: 'null'
          title: Amount Median
        amount_p95:
          anyOf:
            - type: number
            - type: 'null'
          title: Amount P95
        policy_divergence:
          type: number
          title: Policy Divergence
        observed_scope:
          type: number
          title: Observed Scope
      type: object
      required:
        - agent_id
        - window_start
        - window_end
        - decisions
        - reportable
        - outcomes
        - tools
        - policy_divergence
        - observed_scope
      title: FingerprintOut
    ShiftOut:
      properties:
        measure:
          type: string
          title: Measure
        key:
          type: string
          title: Key
        before:
          anyOf:
            - type: number
            - type: 'null'
          title: Before
        after:
          anyOf:
            - type: number
            - type: 'null'
          title: After
        delta:
          anyOf:
            - type: number
            - type: 'null'
          title: Delta
        z:
          anyOf:
            - type: number
            - type: 'null'
          title: Z
        detail:
          type: string
          title: Detail
      type: object
      required:
        - measure
        - key
        - detail
      title: ShiftOut
    ExplanationOut:
      properties:
        kind:
          type: string
          title: Kind
        at:
          type: string
          title: At
        by:
          anyOf:
            - type: string
            - type: 'null'
          title: By
        detail:
          type: string
          title: Detail
      type: object
      required:
        - kind
        - at
        - detail
      title: ExplanationOut
  securitySchemes:
    bearerToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        A token from the identity provider your deployment federates with. It
        identifies a person; their roles in the workspace decide what they may
        do.

````

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