openapi: 3.1.0 info: title: Gainsight CS User Management API description: >- The User Management API provides endpoints for managing Gainsight users, company team records, and includes SCIM support for automated user provisioning and de-provisioning through identity providers. version: '1.0' contact: name: Gainsight Support url: https://support.gainsight.com email: support@gainsight.com termsOfService: https://www.gainsight.com/terms-of-service/ externalDocs: description: User Management API Documentation url: https://support.gainsight.com/gainsight_nxt/API_and_Developer_Docs/User_Management_APIs/User_Management_APIs servers: - url: https://{domain}.gainsightcloud.com/v1 description: Gainsight CS Production variables: domain: default: customer description: Customer-specific domain prefix tags: - name: Company Team description: Manage company team records - name: SCIM description: SCIM provisioning endpoints - name: Users description: Manage Gainsight users security: - apiKey: [] paths: /users: get: operationId: listUsers summary: Gainsight List users description: Retrieve a list of Gainsight users. tags: - Users parameters: - name: pageNumber in: query description: Page number schema: type: integer default: 0 - name: pageSize in: query description: Records per page schema: type: integer default: 25 responses: '200': description: Users returned content: application/json: schema: type: object properties: result: type: boolean data: type: object properties: records: type: array items: $ref: '#/components/schemas/GainsightUser' totalCount: type: integer '401': $ref: '#/components/responses/Unauthorized' /users/{userId}: get: operationId: getUser summary: Gainsight Get a user description: Retrieve a specific Gainsight user by ID. tags: - Users parameters: - $ref: '#/components/parameters/userId' responses: '200': description: User returned content: application/json: schema: type: object properties: result: type: boolean data: $ref: '#/components/schemas/GainsightUser' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' put: operationId: updateUser summary: Gainsight Update a user description: Update a Gainsight user record. tags: - Users parameters: - $ref: '#/components/parameters/userId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/GainsightUserInput' responses: '200': description: User updated content: application/json: schema: $ref: '#/components/schemas/ApiResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /users/{userId}/deactivate: post: operationId: deactivateUser summary: Gainsight Deactivate a user description: Deactivate a Gainsight user account. tags: - Users parameters: - $ref: '#/components/parameters/userId' responses: '200': description: User deactivated content: application/json: schema: $ref: '#/components/schemas/ApiResponse' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /companyteam: post: operationId: upsertCompanyTeam summary: Gainsight Upsert company team records description: >- Insert or update company team records that associate Gainsight users with company accounts. tags: - Company Team requestBody: required: true content: application/json: schema: type: object required: - records properties: records: type: array items: $ref: '#/components/schemas/CompanyTeamRecord' responses: '200': description: Records upserted content: application/json: schema: $ref: '#/components/schemas/ApiResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' /companyteam/search: post: operationId: searchCompanyTeam summary: Gainsight Search company team records description: Search for company team records using filter criteria. tags: - Company Team requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/SearchRequest' responses: '200': description: Results returned content: application/json: schema: type: object properties: result: type: boolean data: type: object properties: records: type: array items: $ref: '#/components/schemas/CompanyTeamRecord' totalCount: type: integer '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' /scim/v2/Users: get: operationId: scimListUsers summary: Gainsight SCIM list users description: List users via SCIM 2.0 protocol for identity provider integration. tags: - SCIM parameters: - name: filter in: query description: SCIM filter expression schema: type: string - name: startIndex in: query description: Starting index schema: type: integer default: 1 - name: count in: query description: Number of records schema: type: integer default: 100 responses: '200': description: SCIM users returned content: application/scim+json: schema: type: object properties: schemas: type: array items: type: string totalResults: type: integer startIndex: type: integer itemsPerPage: type: integer Resources: type: array items: $ref: '#/components/schemas/ScimUser' '401': $ref: '#/components/responses/Unauthorized' post: operationId: scimCreateUser summary: Gainsight SCIM create user description: Provision a new user via SCIM 2.0. tags: - SCIM requestBody: required: true content: application/scim+json: schema: $ref: '#/components/schemas/ScimUserInput' responses: '201': description: User provisioned content: application/scim+json: schema: $ref: '#/components/schemas/ScimUser' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '409': description: User already exists /scim/v2/Users/{scimUserId}: get: operationId: scimGetUser summary: Gainsight SCIM get user description: Retrieve a user via SCIM 2.0. tags: - SCIM parameters: - $ref: '#/components/parameters/scimUserId' responses: '200': description: SCIM user returned content: application/scim+json: schema: $ref: '#/components/schemas/ScimUser' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' put: operationId: scimUpdateUser summary: Gainsight SCIM update user description: Update a user via SCIM 2.0. tags: - SCIM parameters: - $ref: '#/components/parameters/scimUserId' requestBody: required: true content: application/scim+json: schema: $ref: '#/components/schemas/ScimUserInput' responses: '200': description: User updated content: application/scim+json: schema: $ref: '#/components/schemas/ScimUser' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' delete: operationId: scimDeleteUser summary: Gainsight SCIM delete user description: De-provision a user via SCIM 2.0. tags: - SCIM parameters: - $ref: '#/components/parameters/scimUserId' responses: '204': description: User de-provisioned '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' components: securitySchemes: apiKey: type: apiKey name: accessKey in: header description: Gainsight CS REST API access key parameters: userId: name: userId in: path required: true description: Gainsight user ID schema: type: string scimUserId: name: scimUserId in: path required: true description: SCIM user ID schema: type: string responses: Unauthorized: description: Authentication failed or access key is missing BadRequest: description: Invalid request body or parameters NotFound: description: The requested resource was not found schemas: ApiResponse: type: object properties: result: type: boolean errorCode: type: string errorDesc: type: string requestId: type: string SearchRequest: type: object properties: select: type: array items: type: string where: type: object properties: conditions: type: array items: type: object properties: name: type: string value: {} operator: type: string expression: type: string limit: type: integer offset: type: integer GainsightUser: type: object properties: Gsid: type: string description: User unique identifier FirstName: type: string description: First name LastName: type: string description: Last name Email: type: string format: email description: Email address UserType: type: string description: User type IsActive: type: boolean description: Whether the user is active LicenseType: type: string description: License type assigned Role: type: string description: User role SfdcUserId: type: string description: Salesforce user ID CreatedDate: type: string format: date-time ModifiedDate: type: string format: date-time GainsightUserInput: type: object properties: FirstName: type: string LastName: type: string Email: type: string format: email UserType: type: string LicenseType: type: string Role: type: string CompanyTeamRecord: type: object properties: Gsid: type: string description: Record identifier CompanyId: type: string description: Company Gsid UserId: type: string description: Gainsight user Gsid TeamRole: type: string description: Team role (e.g., CSM, Executive Sponsor) IsPrimary: type: boolean description: Whether this is the primary team member ScimUser: type: object properties: schemas: type: array items: type: string id: type: string userName: type: string name: type: object properties: givenName: type: string familyName: type: string emails: type: array items: type: object properties: value: type: string format: email type: type: string primary: type: boolean active: type: boolean meta: type: object properties: resourceType: type: string created: type: string format: date-time lastModified: type: string format: date-time ScimUserInput: type: object required: - schemas - userName - name - emails properties: schemas: type: array items: type: string userName: type: string name: type: object required: - givenName - familyName properties: givenName: type: string familyName: type: string emails: type: array items: type: object properties: value: type: string format: email type: type: string primary: type: boolean active: type: boolean