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

# Register Presence

> Register an agent or session as active.

Creates a presence entry that auto-expires if heartbeats stop.

Returns:
    Registered presence entry with timestamps.



## OpenAPI

````yaml https://api.pragmatiks.io/openapi.json post /presence/register
openapi: 3.1.0
info:
  title: Pragma API
  version: 0.1.0
servers: []
security: []
paths:
  /presence/register:
    post:
      tags:
        - presence
      summary: Register Presence
      description: |-
        Register an agent or session as active.

        Creates a presence entry that auto-expires if heartbeats stop.

        Returns:
            Registered presence entry with timestamps.
      operationId: presence-register_presence
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PresenceRegisterRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PresenceEntry'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PresenceRegisterRequest:
      properties:
        agent_id:
          type: string
          title: Agent Id
        agent_type:
          $ref: '#/components/schemas/AgentType-Input'
        name:
          type: string
          title: Name
        activity:
          anyOf:
            - type: string
            - type: 'null'
          title: Activity
        resource_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Resource Id
      type: object
      required:
        - agent_id
        - agent_type
        - name
      title: PresenceRegisterRequest
      description: |-
        Request body for registering presence.

        Attributes:
            agent_id: Unique identifier for the agent or session.
            agent_type: Type of agent connecting.
            name: Human-readable display name.
            activity: Optional current activity description.
            resource_id: Optional resource being worked on.
    PresenceEntry:
      properties:
        agent_id:
          type: string
          title: Agent Id
        agent_type:
          $ref: '#/components/schemas/pragma_api__models__presence__AgentType'
        name:
          type: string
          title: Name
        organization_id:
          type: string
          title: Organization Id
        activity:
          anyOf:
            - type: string
            - type: 'null'
          title: Activity
        resource_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Resource Id
        registered_at:
          type: string
          format: date-time
          title: Registered At
        last_heartbeat:
          type: string
          format: date-time
          title: Last Heartbeat
      type: object
      required:
        - agent_id
        - agent_type
        - name
        - organization_id
      title: PresenceEntry
      description: |-
        Presence registration for an active agent or human session.

        Attributes:
            agent_id: Unique identifier for the connected agent or session.
            agent_type: Whether the agent is external (MCP), internal, or human.
            name: Human-readable display name.
            organization_id: Organization the agent belongs to.
            activity: Description of current activity, if any.
            resource_id: Resource the agent is currently working on, if any.
            registered_at: Timestamp when presence was first registered.
            last_heartbeat: Timestamp of the most recent heartbeat.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentType-Input:
      type: string
      enum:
        - external
        - internal
        - human
      title: AgentType
      description: Type of agent connected to the platform.
    pragma_api__models__presence__AgentType:
      type: string
      enum:
        - external
        - internal
        - human
      title: AgentType
      description: Type of agent connected to the platform.
    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

````