swagger: '2.0'
info:
  version: 1.0.0
  title: SystemLog Service
  description: SystemLog ChangeEvent Api.
host: 'api-us.cloud.com'
schemes:
  - https
basePath: /systemlog
paths:
  "/records":
    x-summary: "Provides Access To Log Records"
    get:
      tags:
        - Records
      summary: "Gets Log Records With A Specified Query And Returns The Estimated Total Items Count"
      operationId: GetRecords
      consumes:
        - application/json
      produces:
        - text/plain
        - application/json
        - text/json
      security:
        - CWSAuth: []
        - Basic: []
      parameters:
        - name: Accept
          in: header
          description: Accepted Content Types
          required: true
          type: string
        - name: Accept-Charset
          in: header
          description: Specifies Character Encodings. Only UTF-8 supported.
          required: false
          type: string
        - name: Authorization
          in: header
          description: The access token.
          type: string
        - name: Citrix-TransactionId
          in: header
          required: false
          type: string
        - name: Citrix-CustomerId
          in: header
          description: ID of the customer.
          required: true
          type: string
        - name: startDateTime
          in: query
          description: Start DateTime for the records to be retrieved.
          required: false
          type: string
          format: date-time
        - name: endDateTime
          in: query
          description: End DateTime for the records to be retrieved.
          required: false
          type: string
          format: date-time
        - name: limit
          in: query
          description: How many items to be returned per page
          required: false
          type: integer
          format: int32
        - name: continuationToken
          in: query
          description: Continuation token for the next page.
          required: false
          type: string
      responses:
        '200':
          description: Success
          headers:
            Content-type:
              type: string
              description: application/json;charset=utf-8
            Citrix-TransactionId:
              type: string
              description: Unique Transaction ID of the call
          schema:
            "$ref": "#/definitions/RecordsResult"
        '401':
          description: Authentication failed.
          headers:
            Content-type:
              type: string
              description: application/json;charset=utf-8
            Citrix-TransactionId:
              type: string
              description: Unique Transaction ID of the call
          schema:
            "$ref": "#/definitions/ExceptionContract"
          x-error-response-example:
            type: 'https://errors-api.cloud.com/common/authorization'
            detail: Missing or invalid authentication details.
            parameters:
              - name: reason
                value: missing
        '404':
          description: Resource not found.
          headers:
            Content-type:
              type: string
              description: application/json;charset=utf-8
            Citrix-TransactionId:
              type: string
              description: Unique Transaction ID of the call
          schema:
            "$ref": "#/definitions/ExceptionContract"
          x-error-response-example:
            type: 'https://errors-api.cloud.com/common/notFound'
            detail: Resource not found.
        '406':
          description: Charset not accepted or mediatype not supported
          headers:
            Content-type:
              type: string
              description: application/json;charset=utf-8
            Citrix-TransactionId:
              type: string
              description: Unique Transaction ID of the call
          schema:
            "$ref": "#/definitions/ExceptionContract"
          x-error-response-example:
            type: 'https://errors-api.cloud.com/common/notAcceptable'
            detail: Charset other than utf-8 is not supported
            parameters:
              - name: reason
                value: missing
definitions:
  ExceptionContract:
    type: object
    required:
      - type
      - detail
    properties:
      type:
        type: string
      detail:
        type: string
      parameters:
        type: array
        items:
          $ref: '#/definitions/ExceptionParameter'
  ExceptionParameter:
    type: object
    required:
      - name
      - value 
    properties:
      name:
        type: string
      value:
        type: string
  RecordsResult:
    description: Result object for the Get records
    type: object
    properties:
      items:
        description: Items contains a list of User definitions.
        uniqueItems: false
        type: array
        items:
          "$ref": "#/definitions/SystemLogRecord"
      count:
        format: int32
        description: Number of records that has been returned
        type: integer
      estimatedTotalItems:
        format: int32
        description: Estimation of how many items we have in total with the current filter.
        type: integer
      continuationToken:
        description: Token for getting next page of items.
        maxLength: 256
        minLength: 0
        type: string
  SystemLogRecord:
    description: Represents an record in the system log.
    type: object
    properties:
      recordId:
        description: Gets or sets the unique identifier for the persisted log record.
        type: string
      utcTimestamp:
        format: date-time
        description: Gets or sets the time stamp when the event is recorded.
        type: string
      customerId:
        description: Gets or sets the customer ID this event applies to.
        type: string
      eventType:
        description: Gets or sets the type (a.k.a. "category" of the recorded event).
        type: string
      targetId:
        description: Gets or sets the ID of the target resource.
        type: string
      targetDisplayName:
        description: Gets or sets the display name of the target resource.
        type: string
      targetEmail:
        description: Gets or sets the email of the target resource.
        type: string
      targetUserId:
        description: Gets or sets the Citrix Identity Platform UserId of the target resource.
        type: string
      targetType:
        description: Gets or sets the type of the target resource.
        type: string
      beforeChanges:
        description: Gets or sets a list of relevant property values before the attempted modification of the resource.
        type: object
        additionalProperties:
          type: string
      afterChanges:
        description: Gets or sets a list of relevant property values after the attempted modification of the resource.
        type: object
        additionalProperties:
          type: string
      agentId:
        description: Gets or sets a recognizable identity of the system or service acting on behalf of 'actorId'.
        type: string
      serviceProfileName:
        description: Gets or sets the optional name of the service profile.
        type: string
      actorId:
        description: Gets or sets the internal ID of the actor that generated the event.
        type: string
      actorDisplayName:
        description: Gets or sets the username or system name of the actor that generated the event.
        type: string
      actorType:
        description: Gets or sets the type of actor that generated the event.
        type: string
      message:
        description: Gets or sets the optional localized message associated with the event.
        type: object
        additionalProperties:
          type: string
securityDefinitions:
  CWSAuth:
    type: apiKey
    name: Authorization
    in: header
  Basic:
    type: basic
security:
  - CWSAuth: []
  - Basic: []
tags:
  - name: Records
    description: Requests for SystemLog records.