openapi: 3.1.0
info:
title: LogRocket GraphQL Data Export Users API
description: The LogRocket GraphQL API allows developers to query session replay and analytics data using GraphQL. It provides a flexible query interface for retrieving session information, user activity, error details, and performance metrics. Developers can use this API to build custom dashboards, integrate session data into internal tools, and perform advanced filtering and aggregation of LogRocket monitoring data.
version: '1.0'
contact:
name: LogRocket Support
url: https://logrocket.com/support
termsOfService: https://logrocket.com/terms
servers:
- url: https://api.logrocket.com
description: LogRocket Production API
security:
- tokenAuth: []
tags:
- name: Users
description: Manage user identification and traits for session context.
paths:
/orgs/{orgId}/apps/{appId}/users/{userId}:
put:
operationId: updateUser
summary: Create or update user traits
description: Creates or updates a user record with the specified traits. If the user already exists, any traits present in the request will be updated to the new value. Traits not included in the request will maintain their previous values. To remove a trait, set it to a blank value. Any user trait values submitted as integers or booleans will be converted to strings in the response.
tags:
- Users
parameters:
- $ref: '#/components/parameters/orgId'
- $ref: '#/components/parameters/appId'
- name: userId
in: path
required: true
description: The unique identifier for the user within your application.
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UserIdentificationRequest'
responses:
'200':
description: User traits successfully updated.
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'400':
description: Invalid request body or parameters.
'401':
description: Missing or invalid API key.
'404':
description: Organization or application not found.
components:
schemas:
User:
type: object
description: A LogRocket user record with identification traits.
properties:
userId:
type: string
description: The unique identifier for the user.
name:
type: string
description: The display name of the user.
email:
type: string
format: email
description: The email address of the user.
traits:
type: object
description: Custom key-value pairs representing user traits. All values are returned as strings regardless of the input type.
additionalProperties:
type: string
UserIdentificationRequest:
type: object
description: Request body for creating or updating user identification traits.
properties:
name:
type: string
description: The display name of the user.
email:
type: string
format: email
description: The email address of the user.
traits:
type: object
description: Custom key-value pairs representing user traits such as subscription type, revenue data, or product interest. Values will be converted to strings in the response.
additionalProperties:
oneOf:
- type: string
- type: integer
- type: boolean
parameters:
orgId:
name: orgId
in: path
required: true
description: The organization identifier found in the LogRocket dashboard URL.
schema:
type: string
appId:
name: appId
in: path
required: true
description: The application or project identifier found in the LogRocket dashboard URL.
schema:
type: string
securitySchemes:
tokenAuth:
type: apiKey
in: header
name: Authorization
description: API token authentication. Use the format "token <your-api-key>". API keys are available from the LogRocket dashboard under Settings > General Settings.
externalDocs:
description: LogRocket GraphQL API Documentation
url: https://docs.logrocket.com/reference/graphql-1