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

# List ITSM Tickets

> List tickets from the connected ITSM tool, normalised across vendors.



## OpenAPI

````yaml get /itsm/tickets
openapi: 3.1.0
info:
  title: Leen Security API
  version: 0.0.1
servers:
  - description: Production API (US)
    url: https://api.leen.dev/v1
  - description: Production API (EU)
    url: https://api.eu-c1.leen.dev/v1
  - description: Production API (APAC)
    url: https://api.ap-se2.leen.dev/v1
security: []
paths:
  /itsm/tickets:
    get:
      tags:
        - ITSM
        - Tickets
      summary: List ITSM Tickets
      description: List tickets from the connected ITSM tool, normalised across vendors.
      operationId: get_tickets
      parameters:
        - description: Filter tickets updated since a specific time
          in: query
          name: statusUpdatedSince
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            description: Filter tickets updated since a specific time
            title: Statusupdatedsince
        - description: Filter tickets by project ID
          in: query
          name: projectId
          required: false
          schema:
            anyOf:
              - format: uuid
                type: string
              - type: 'null'
            description: Filter tickets by project ID
            title: Projectid
        - description: Filter tickets by assigned user ID
          in: query
          name: assignedUserId
          required: false
          schema:
            anyOf:
              - format: uuid
                type: string
              - type: 'null'
            description: Filter tickets by assigned user ID
            title: Assigneduserid
        - description: Filter tickets by created by user ID
          in: query
          name: createdByUserId
          required: false
          schema:
            anyOf:
              - format: uuid
                type: string
              - type: 'null'
            description: Filter tickets by created by user ID
            title: Createdbyuserid
        - description: Filter tickets by priority
          in: query
          name: priority
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter tickets by priority
            title: Priority
        - description: Filter tickets by status
          in: query
          name: status
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter tickets by status
            title: Status
        - description: Filter tickets by type
          in: query
          name: type
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter tickets by type
            title: Type
        - description: Filter active tickets
          in: query
          name: active
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: Filter active tickets
            title: Active
        - description: Filter tickets by identifier (exact match)
          in: query
          name: identifier
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter tickets by identifier (exact match)
            title: Identifier
        - description: >-
            Filter tickets by tags (comma-separated, AND match — tickets must
            contain all specified tags)
          in: query
          name: tags
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Filter tickets by tags (comma-separated, AND match — tickets must
              contain all specified tags)
            title: Tags
        - description: >-
            Filter to JIRA standard (non-subtask) issue types only. JIRA
            connections only.
          in: query
          name: jiraStandardIssueTypes
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: >-
              Filter to JIRA standard (non-subtask) issue types only. JIRA
              connections only.
            title: Jirastandardissuetypes
        - description: >-
            Exclude tickets of these types (comma-separated, e.g.,
            'Epic,Sub-task')
          in: query
          name: excludeType
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Exclude tickets of these types (comma-separated, e.g.,
              'Epic,Sub-task')
            title: Excludetype
        - description: >-
            Sort field and direction (e.g., 'created_at:desc',
            'updated_at:asc'). Supported: updated_at, status_updated_at,
            ticket_created_at (or created_at as alias)
          in: query
          name: sort
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Sort field and direction (e.g., 'created_at:desc',
              'updated_at:asc'). Supported: updated_at, status_updated_at,
              ticket_created_at (or created_at as alias)
            title: Sort
        - description: >-
            Only records whose `updated_at` is at or after this time. Leen bumps
            `updated_at` whenever any field on a record changes, so this is the
            filter for an incremental sync: it returns records that are new and
            records that changed, and nothing that has stood still. Example:
            `2021-01-01T00:00:00+00:00`.
          in: query
          name: updatedSince
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            description: >-
              Only records whose `updated_at` is at or after this time. Leen
              bumps `updated_at` whenever any field on a record changes, so this
              is the filter for an incremental sync: it returns records that are
              new and records that changed, and nothing that has stood still.
              Example: `2021-01-01T00:00:00+00:00`.
            examples:
              - '2021-01-01T00:00:00+00:00'
            title: Updatedsince
        - description: >-
            Opaque position of the next page, taken from the previous response.
            Ignore its contents; it encodes where the walk had reached.
          in: query
          name: cursor
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Opaque position of the next page, taken from the previous
              response. Ignore its contents; it encodes where the walk had
              reached.
            title: Cursor
        - description: >-
            How many records to return per page. The walk is the same either
            way; a larger page means fewer round trips and more memory per
            response.
          in: query
          name: limit
          required: false
          schema:
            default: 100
            description: >-
              How many records to return per page. The walk is the same either
              way; a larger page means fewer round trips and more memory per
              response.
            maximum: 500
            minimum: 1
            title: Limit
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/KeySetPaginatedResponse_ScopedITSMTicketRespModel_
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
      security:
        - API-Key: []
          Connection-ID: []
components:
  schemas:
    KeySetPaginatedResponse_ScopedITSMTicketRespModel_:
      properties:
        items:
          description: The records on this page.
          items:
            $ref: '#/components/schemas/ScopedITSMTicketRespModel'
          title: Items
          type: array
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Opaque position of the next page. Pass it back as `cursor` to
            continue; null when this is the last page.
          title: Next Cursor
        previous_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Opaque position of the previous page, for walking backwards. Null on
            the first page.
          title: Previous Cursor
      required:
        - items
      title: KeySetPaginatedResponse[ScopedITSMTicketRespModel]
      type: object
    ErrorResponse:
      properties:
        code:
          description: Error code
          title: Code
          type: string
        detail:
          description: List of error dictionaries
          items:
            additionalProperties: true
            type: object
          title: Detail
          type: array
        message:
          description: Error message
          title: Message
          type: string
        type:
          description: Type of error
          title: Type
          type: string
      required:
        - type
        - code
        - message
        - detail
      title: ErrorResponse
      type: object
    ScopedITSMTicketRespModel:
      properties:
        active:
          anyOf:
            - type: boolean
            - type: 'null'
          description: Whether the Ticket is active
          title: Active
        assigned_user_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: User ID assigned to the Ticket
          title: Assigned User Id
        closed_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Closing time of the Ticket
          title: Closed At
        created_by_user_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: User ID who created the Ticket
          title: Created By User Id
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Description of the Ticket
          title: Description
        due_date:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Due date of the Ticket
          title: Due Date
        id:
          description: Leen's UUID for the Ticket
          format: uuid
          title: Id
          type: string
        identifier:
          anyOf:
            - type: string
            - type: 'null'
          description: User-provided tracking identifier for the Ticket
          title: Identifier
        name:
          description: Name of the Ticket
          title: Name
          type: string
        parent_ticket_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: Parent Ticket ID (for sub-tasks)
          title: Parent Ticket Id
        priority:
          anyOf:
            - type: string
            - type: 'null'
          description: Priority of the Ticket
          title: Priority
        project_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: Project ID the Ticket belongs to
          title: Project Id
        status:
          description: Status of the Ticket
          title: Status
          type: string
        status_updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Last status update time
          title: Status Updated At
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: Tags associated with the Ticket
          title: Tags
        ticket_created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Creation time of the Ticket in the vendor system
          title: Ticket Created At
        type:
          anyOf:
            - type: string
            - type: 'null'
          description: Type of the Ticket (e.g., Epic, Story, Task, Bug)
          title: Type
        type_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Vendor-specific type ID (e.g., Jira issue type ID)
          title: Type Id
        url:
          anyOf:
            - type: string
            - type: 'null'
          description: URL of the Ticket
          title: Url
        vendor_attributes:
          $ref: '#/components/schemas/ITSMTicketVendorAttributes'
          description: Vendor-specific attributes of the Ticket
      required:
        - id
        - name
        - status
        - vendor_attributes
      title: ITSM Ticket
      type: object
    ITSMTicketVendorAttributes:
      properties:
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Creation time of the Ticket in Vendor
          title: Created At
        data:
          anyOf:
            - discriminator:
                mapping:
                  JIRA: '#/components/schemas/JiraTicketVendorAttributesData'
                  SERVICENOW_ITSM: '#/components/schemas/ServiceNowTicketVendorAttributesData'
                propertyName: vendor
              oneOf:
                - $ref: '#/components/schemas/JiraTicketVendorAttributesData'
                - $ref: '#/components/schemas/ServiceNowTicketVendorAttributesData'
            - type: 'null'
          description: Vendor-specific data associated with the Ticket
          title: Data
        id:
          description: Vendor's ID for the Ticket
          title: Id
          type: string
        priority:
          anyOf:
            - type: string
            - type: 'null'
          description: Vendor priority of the Ticket
          title: Priority
        status:
          anyOf:
            - type: string
            - type: 'null'
          description: Vendor status of the Ticket
          title: Status
        type:
          anyOf:
            - type: string
            - type: 'null'
          description: Vendor type of the Ticket
          title: Type
        type_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Vendor type ID of the Ticket
          title: Type Id
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Last update time of the Ticket in Vendor
          title: Updated At
        vendor:
          description: Vendor name
          title: Vendor
          type: string
      required:
        - id
        - vendor
      title: ITSM Ticket Vendor Attributes
      type: object
    JiraTicketVendorAttributesData:
      properties:
        customFields:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Customfields
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        statusCategory:
          anyOf:
            - type: string
            - type: 'null'
          title: Statuscategory
        vendor:
          const: JIRA
          default: JIRA
          title: Vendor
          type: string
      title: JiraTicketVendorAttributesData
      type: object
    ServiceNowTicketVendorAttributesData:
      properties:
        customFields:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Customfields
        number:
          anyOf:
            - type: string
            - type: 'null'
          title: Number
        priorityNumeric:
          anyOf:
            - type: string
            - type: 'null'
          title: Prioritynumeric
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        vendor:
          const: SERVICENOW_ITSM
          default: SERVICENOW_ITSM
          title: Vendor
          type: string
      title: ServiceNowTicketVendorAttributesData
      type: object
  securitySchemes:
    API-Key:
      in: header
      name: X-API-KEY
      type: apiKey
    Connection-ID:
      in: header
      name: X-CONNECTION-ID
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.