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

# Export a runtime end user's data for GDPR data portability

> Sessions, app access, and audit events from the last 90 days.



## OpenAPI

````yaml /openapi/v1.json get /orgs/{organization}/end-users/{runtimeUser}/export
openapi: 3.1.0
info:
  title: HASP AI API
  version: '2026-07-12'
  description: >-
    The HASP Public AI API is the regulated-AI substrate for healthcare and
    other

    regulated industries — identity, policy, audit, compliance, and PHI handling

    for AI inference, exposed via two surfaces:


    - **Native (`/v1/ai/*`)**: HASP-native chat with full event taxonomy, run
    lifecycle,
      and PHI metadata.
    - **Anthropic-compat (`/v1/messages`)**: Drop-in replacement for
    `@anthropic-ai/sdk` —
      change only `baseURL`. All Gateway compliance checks (BAA, credits, PHI policy) apply.

    All requests require an API key (`Authorization: Bearer
    hasp_api_live_<key>`). See

    [Authentication](https://docs.usehasp.com/ai-api/authentication) for key
    management.
servers:
  - url: https://api.usehasp.com/v1
    description: Production
security:
  - http: []
paths:
  /orgs/{organization}/end-users/{runtimeUser}/export:
    get:
      tags:
        - EndUserExport
      summary: Export a runtime end user's data for GDPR data portability
      description: Sessions, app access, and audit events from the last 90 days.
      operationId: v1.control.end_users.export
      parameters:
        - name: organization
          in: path
          required: true
          description: The organization ID
          schema:
            type: string
        - name: runtimeUser
          in: path
          required: true
          description: The runtime user ID
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      object:
                        type: string
                        const: end_user_export
                      generated_at:
                        type: string
                      end_user:
                        type: object
                        properties:
                          id:
                            type: string
                          email:
                            type: string
                          name:
                            type:
                              - string
                              - 'null'
                          external_id:
                            type:
                              - string
                              - 'null'
                          external_provider:
                            type:
                              - string
                              - 'null'
                          status:
                            anyOf:
                              - type: string
                              - type: string
                                enum:
                                  - active
                          email_verified_at:
                            type: string
                          last_sign_in_at:
                            type: string
                          created_at:
                            type: string
                        required:
                          - id
                          - email
                          - name
                          - external_id
                          - external_provider
                          - status
                          - email_verified_at
                          - last_sign_in_at
                          - created_at
                      sessions_last_90_days:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            app_id:
                              type:
                                - string
                                - 'null'
                            ip_address:
                              type:
                                - string
                                - 'null'
                            user_agent:
                              type:
                                - string
                                - 'null'
                            created_at:
                              type: string
                            last_activity_at:
                              type: string
                            expires_at:
                              type: string
                          required:
                            - id
                            - app_id
                            - ip_address
                            - user_agent
                            - created_at
                            - last_activity_at
                            - expires_at
                      app_access:
                        type: array
                        items:
                          type: object
                          properties:
                            app_id:
                              type: string
                            first_seen_at:
                              type: string
                            last_seen_at:
                              type: string
                          required:
                            - app_id
                            - first_seen_at
                            - last_seen_at
                      audit_events_last_90_days:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            action:
                              type: string
                            created_at:
                              type: string
                          required:
                            - id
                            - action
                            - created_at
                    required:
                      - object
                      - generated_at
                      - end_user
                      - sessions_last_90_days
                      - app_access
                      - audit_events_last_90_days
                  - type: string
        '401':
          description: Bearer token is missing, malformed, or revoked.
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  error:
                    type: authentication
                    code: INVALID_API_KEY
                    message: Bearer token is missing, malformed, or revoked.
                    param: null
                    details: null
                    retryable: false
                    request_id: 01JQREQ7XZQK5N6PZ1VVXHYB8T
                  meta:
                    request_id: 01JQREQ7XZQK5N6PZ1VVXHYB8T
        '403':
          description: >-
            The caller is authenticated but lacks the scope or capability this
            route requires.
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  error:
                    type: permission
                    code: MISSING_SCOPE
                    message: >-
                      The caller is authenticated but lacks the scope or
                      capability this route requires.
                    param: null
                    details: null
                    retryable: false
                    request_id: 01JQREQ7XZQK5N6PZ1VVXHYB8T
                  meta:
                    request_id: 01JQREQ7XZQK5N6PZ1VVXHYB8T
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
components:
  responses:
    ModelNotFoundException:
      description: Not found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
  securitySchemes:
    http:
      type: http
      scheme: bearer

````