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

# Create an SLA Rule

> Create an SLA rule. `name` is required. Attach it to a Service through the Service `sla_rule` attribute. SLA rules must be enabled for the company. This endpoint may change or be removed without prior notice.



## OpenAPI

````yaml /api-reference/openapi.yml post /v1/sla_rules
openapi: 3.0.1
info:
  title: Siit Public API
  version: v0
servers:
  - url: https://api.siit.io
security: []
paths:
  /v1/sla_rules:
    post:
      tags:
        - Unstable
        - SLA Rule
      summary: Create an SLA Rule
      description: >-
        Create an SLA rule. `name` is required. Attach it to a Service through
        the Service `sla_rule` attribute. SLA rules must be enabled for the
        company. This endpoint may change or be removed without prior notice.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: The name of the SLA rule, unique within the company
                business_calendar:
                  type: string
                  nullable: true
                  description: >-
                    The UID of the Business Calendar whose working hours the SLA
                    rule counts time against. Send null to count elapsed time
                    (24/7).
                per_priority:
                  type: boolean
                  nullable: true
                  description: >-
                    Use one target per Request priority instead of the `all_*`
                    targets.
                pause_on_waiting:
                  type: boolean
                  description: >-
                    Pause the SLA clock while the Request is waiting for the
                    requester.
                pause_on_snoozed:
                  type: boolean
                  description: Pause the SLA clock while the Request is snoozed.
                pause_when_pending_approval:
                  type: boolean
                  description: Pause the SLA clock while the Request is pending approval.
                alert_behavior:
                  type: string
                  enum:
                    - at_breach
                    - before
                    - never
                  description: >-
                    When assignees are alerted: `never`, `before` the breach
                    (see the `alert_before_*` settings), or `at_breach`.
                all_first_response_time_enabled:
                  type: boolean
                  description: >-
                    Whether the first response time target for all Requests
                    (used when `per_priority` is false) is enabled.
                all_first_response_time_minutes:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: >-
                    The first response time target for all Requests (used when
                    `per_priority` is false), in total minutes. Required, and
                    divisible by the unit, when enabled.
                all_first_response_time_unit:
                  type: string
                  enum:
                    - days
                    - hours
                    - minutes
                    - months
                    - weeks
                  description: >-
                    The unit the first response time target for all Requests
                    (used when `per_priority` is false) is displayed in. It does
                    not change `all_first_response_time_minutes`.
                all_time_to_resolve_enabled:
                  type: boolean
                  description: >-
                    Whether the time to resolve target for all Requests (used
                    when `per_priority` is false) is enabled.
                all_time_to_resolve_minutes:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: >-
                    The time to resolve target for all Requests (used when
                    `per_priority` is false), in total minutes. Required, and
                    divisible by the unit, when enabled.
                all_time_to_resolve_unit:
                  type: string
                  enum:
                    - days
                    - hours
                    - minutes
                    - months
                    - weeks
                  description: >-
                    The unit the time to resolve target for all Requests (used
                    when `per_priority` is false) is displayed in. It does not
                    change `all_time_to_resolve_minutes`.
                low_first_response_time_enabled:
                  type: boolean
                  description: >-
                    Whether the first response time target for low priority
                    Requests (used when `per_priority` is true) is enabled.
                low_first_response_time_minutes:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: >-
                    The first response time target for low priority Requests
                    (used when `per_priority` is true), in total minutes.
                    Required, and divisible by the unit, when enabled.
                low_first_response_time_unit:
                  type: string
                  enum:
                    - days
                    - hours
                    - minutes
                    - months
                    - weeks
                  description: >-
                    The unit the first response time target for low priority
                    Requests (used when `per_priority` is true) is displayed in.
                    It does not change `low_first_response_time_minutes`.
                low_time_to_resolve_enabled:
                  type: boolean
                  description: >-
                    Whether the time to resolve target for low priority Requests
                    (used when `per_priority` is true) is enabled.
                low_time_to_resolve_minutes:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: >-
                    The time to resolve target for low priority Requests (used
                    when `per_priority` is true), in total minutes. Required,
                    and divisible by the unit, when enabled.
                low_time_to_resolve_unit:
                  type: string
                  enum:
                    - days
                    - hours
                    - minutes
                    - months
                    - weeks
                  description: >-
                    The unit the time to resolve target for low priority
                    Requests (used when `per_priority` is true) is displayed in.
                    It does not change `low_time_to_resolve_minutes`.
                medium_first_response_time_enabled:
                  type: boolean
                  description: >-
                    Whether the first response time target for medium priority
                    Requests (used when `per_priority` is true) is enabled.
                medium_first_response_time_minutes:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: >-
                    The first response time target for medium priority Requests
                    (used when `per_priority` is true), in total minutes.
                    Required, and divisible by the unit, when enabled.
                medium_first_response_time_unit:
                  type: string
                  enum:
                    - days
                    - hours
                    - minutes
                    - months
                    - weeks
                  description: >-
                    The unit the first response time target for medium priority
                    Requests (used when `per_priority` is true) is displayed in.
                    It does not change `medium_first_response_time_minutes`.
                medium_time_to_resolve_enabled:
                  type: boolean
                  description: >-
                    Whether the time to resolve target for medium priority
                    Requests (used when `per_priority` is true) is enabled.
                medium_time_to_resolve_minutes:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: >-
                    The time to resolve target for medium priority Requests
                    (used when `per_priority` is true), in total minutes.
                    Required, and divisible by the unit, when enabled.
                medium_time_to_resolve_unit:
                  type: string
                  enum:
                    - days
                    - hours
                    - minutes
                    - months
                    - weeks
                  description: >-
                    The unit the time to resolve target for medium priority
                    Requests (used when `per_priority` is true) is displayed in.
                    It does not change `medium_time_to_resolve_minutes`.
                high_first_response_time_enabled:
                  type: boolean
                  description: >-
                    Whether the first response time target for high priority
                    Requests (used when `per_priority` is true) is enabled.
                high_first_response_time_minutes:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: >-
                    The first response time target for high priority Requests
                    (used when `per_priority` is true), in total minutes.
                    Required, and divisible by the unit, when enabled.
                high_first_response_time_unit:
                  type: string
                  enum:
                    - days
                    - hours
                    - minutes
                    - months
                    - weeks
                  description: >-
                    The unit the first response time target for high priority
                    Requests (used when `per_priority` is true) is displayed in.
                    It does not change `high_first_response_time_minutes`.
                high_time_to_resolve_enabled:
                  type: boolean
                  description: >-
                    Whether the time to resolve target for high priority
                    Requests (used when `per_priority` is true) is enabled.
                high_time_to_resolve_minutes:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: >-
                    The time to resolve target for high priority Requests (used
                    when `per_priority` is true), in total minutes. Required,
                    and divisible by the unit, when enabled.
                high_time_to_resolve_unit:
                  type: string
                  enum:
                    - days
                    - hours
                    - minutes
                    - months
                    - weeks
                  description: >-
                    The unit the time to resolve target for high priority
                    Requests (used when `per_priority` is true) is displayed in.
                    It does not change `high_time_to_resolve_minutes`.
                urgent_first_response_time_enabled:
                  type: boolean
                  description: >-
                    Whether the first response time target for urgent priority
                    Requests (used when `per_priority` is true) is enabled.
                urgent_first_response_time_minutes:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: >-
                    The first response time target for urgent priority Requests
                    (used when `per_priority` is true), in total minutes.
                    Required, and divisible by the unit, when enabled.
                urgent_first_response_time_unit:
                  type: string
                  enum:
                    - days
                    - hours
                    - minutes
                    - months
                    - weeks
                  description: >-
                    The unit the first response time target for urgent priority
                    Requests (used when `per_priority` is true) is displayed in.
                    It does not change `urgent_first_response_time_minutes`.
                urgent_time_to_resolve_enabled:
                  type: boolean
                  description: >-
                    Whether the time to resolve target for urgent priority
                    Requests (used when `per_priority` is true) is enabled.
                urgent_time_to_resolve_minutes:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: >-
                    The time to resolve target for urgent priority Requests
                    (used when `per_priority` is true), in total minutes.
                    Required, and divisible by the unit, when enabled.
                urgent_time_to_resolve_unit:
                  type: string
                  enum:
                    - days
                    - hours
                    - minutes
                    - months
                    - weeks
                  description: >-
                    The unit the time to resolve target for urgent priority
                    Requests (used when `per_priority` is true) is displayed in.
                    It does not change `urgent_time_to_resolve_minutes`.
                alert_before_first_response_time_enabled:
                  type: boolean
                  description: >-
                    Whether the delay before the first response time breach at
                    which alerts are sent (used when `alert_behavior` is
                    `before`) is enabled.
                alert_before_first_response_time_minutes:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: >-
                    The delay before the first response time breach at which
                    alerts are sent (used when `alert_behavior` is `before`), in
                    total minutes. Required, and divisible by the unit, when
                    enabled.
                alert_before_first_response_time_unit:
                  type: string
                  enum:
                    - days
                    - hours
                    - minutes
                    - months
                    - weeks
                  description: >-
                    The unit the delay before the first response time breach at
                    which alerts are sent (used when `alert_behavior` is
                    `before`) is displayed in. It does not change
                    `alert_before_first_response_time_minutes`.
                alert_before_time_to_resolve_enabled:
                  type: boolean
                  description: >-
                    Whether the delay before the time to resolve breach at which
                    alerts are sent (used when `alert_behavior` is `before`) is
                    enabled.
                alert_before_time_to_resolve_minutes:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: >-
                    The delay before the time to resolve breach at which alerts
                    are sent (used when `alert_behavior` is `before`), in total
                    minutes. Required, and divisible by the unit, when enabled.
                alert_before_time_to_resolve_unit:
                  type: string
                  enum:
                    - days
                    - hours
                    - minutes
                    - months
                    - weeks
                  description: >-
                    The unit the delay before the time to resolve breach at
                    which alerts are sent (used when `alert_behavior` is
                    `before`) is displayed in. It does not change
                    `alert_before_time_to_resolve_minutes`.
              required:
                - name
      responses:
        '201':
          description: SLA rule created
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    $ref: '#/components/schemas/sla_rule'
                required:
                  - result
        '400':
          description: Invalid attributes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors_object'
      security:
        - bearer: []
components:
  schemas:
    sla_rule:
      type: object
      properties:
        uid:
          type: string
          readOnly: true
        name:
          type: string
        business_calendar:
          oneOf:
            - type: string
              description: UID when not expanded
            - $ref: '#/components/schemas/business_calendar'
          description: >-
            Business calendar the SLA rule counts time against; null means
            elapsed time. Pass `?expand[]=field_name` for full object.
          nullable: true
        per_priority:
          type: boolean
          nullable: true
        pause_on_waiting:
          type: boolean
        pause_on_snoozed:
          type: boolean
        pause_when_pending_approval:
          type: boolean
        alert_behavior:
          type: string
          enum:
            - at_breach
            - before
            - never
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        all_first_response_time_enabled:
          type: boolean
        all_first_response_time_minutes:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Total minutes, regardless of display unit.
        all_first_response_time_unit:
          type: string
          enum:
            - days
            - hours
            - minutes
            - months
            - weeks
          description: >-
            Display unit. Minutes must be divisible by the selected unit when
            the target is enabled.
        all_time_to_resolve_enabled:
          type: boolean
        all_time_to_resolve_minutes:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Total minutes, regardless of display unit.
        all_time_to_resolve_unit:
          type: string
          enum:
            - days
            - hours
            - minutes
            - months
            - weeks
          description: >-
            Display unit. Minutes must be divisible by the selected unit when
            the target is enabled.
        low_first_response_time_enabled:
          type: boolean
        low_first_response_time_minutes:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Total minutes, regardless of display unit.
        low_first_response_time_unit:
          type: string
          enum:
            - days
            - hours
            - minutes
            - months
            - weeks
          description: >-
            Display unit. Minutes must be divisible by the selected unit when
            the target is enabled.
        low_time_to_resolve_enabled:
          type: boolean
        low_time_to_resolve_minutes:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Total minutes, regardless of display unit.
        low_time_to_resolve_unit:
          type: string
          enum:
            - days
            - hours
            - minutes
            - months
            - weeks
          description: >-
            Display unit. Minutes must be divisible by the selected unit when
            the target is enabled.
        medium_first_response_time_enabled:
          type: boolean
        medium_first_response_time_minutes:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Total minutes, regardless of display unit.
        medium_first_response_time_unit:
          type: string
          enum:
            - days
            - hours
            - minutes
            - months
            - weeks
          description: >-
            Display unit. Minutes must be divisible by the selected unit when
            the target is enabled.
        medium_time_to_resolve_enabled:
          type: boolean
        medium_time_to_resolve_minutes:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Total minutes, regardless of display unit.
        medium_time_to_resolve_unit:
          type: string
          enum:
            - days
            - hours
            - minutes
            - months
            - weeks
          description: >-
            Display unit. Minutes must be divisible by the selected unit when
            the target is enabled.
        high_first_response_time_enabled:
          type: boolean
        high_first_response_time_minutes:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Total minutes, regardless of display unit.
        high_first_response_time_unit:
          type: string
          enum:
            - days
            - hours
            - minutes
            - months
            - weeks
          description: >-
            Display unit. Minutes must be divisible by the selected unit when
            the target is enabled.
        high_time_to_resolve_enabled:
          type: boolean
        high_time_to_resolve_minutes:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Total minutes, regardless of display unit.
        high_time_to_resolve_unit:
          type: string
          enum:
            - days
            - hours
            - minutes
            - months
            - weeks
          description: >-
            Display unit. Minutes must be divisible by the selected unit when
            the target is enabled.
        urgent_first_response_time_enabled:
          type: boolean
        urgent_first_response_time_minutes:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Total minutes, regardless of display unit.
        urgent_first_response_time_unit:
          type: string
          enum:
            - days
            - hours
            - minutes
            - months
            - weeks
          description: >-
            Display unit. Minutes must be divisible by the selected unit when
            the target is enabled.
        urgent_time_to_resolve_enabled:
          type: boolean
        urgent_time_to_resolve_minutes:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Total minutes, regardless of display unit.
        urgent_time_to_resolve_unit:
          type: string
          enum:
            - days
            - hours
            - minutes
            - months
            - weeks
          description: >-
            Display unit. Minutes must be divisible by the selected unit when
            the target is enabled.
        alert_before_first_response_time_enabled:
          type: boolean
        alert_before_first_response_time_minutes:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Total minutes, regardless of display unit.
        alert_before_first_response_time_unit:
          type: string
          enum:
            - days
            - hours
            - minutes
            - months
            - weeks
          description: >-
            Display unit. Minutes must be divisible by the selected unit when
            the target is enabled.
        alert_before_time_to_resolve_enabled:
          type: boolean
        alert_before_time_to_resolve_minutes:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Total minutes, regardless of display unit.
        alert_before_time_to_resolve_unit:
          type: string
          enum:
            - days
            - hours
            - minutes
            - months
            - weeks
          description: >-
            Display unit. Minutes must be divisible by the selected unit when
            the target is enabled.
    errors_object:
      type: object
      properties:
        error:
          type: string
        troubleshoot:
          type: string
    business_calendar:
      type: object
      properties:
        uid:
          type: string
        name:
          type: string
        timezone:
          type: string
        slots:
          type: array
          items:
            type: object
            properties:
              on_sunday:
                type: boolean
              on_monday:
                type: boolean
              on_tuesday:
                type: boolean
              on_wednesday:
                type: boolean
              on_thursday:
                type: boolean
              on_friday:
                type: boolean
              on_saturday:
                type: boolean
              start_time:
                type: string
              end_time:
                type: string
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````