---
sourceDocument: Australia Build or modify applications
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/application-development

 Release :

    - australia

ft:locale :

    - pt-BR

ft:publication_title :

    - Australia Build or modify applications

ft:clusterId :

    - cadev

bundleId :

    - cadev

workflow :

    - Development, Data, and Analytics


---

# Service Level Agreement API - ServiceNow Fluent

# Service Level Agreement API - ServiceNow Fluent {#fluent-sla-api__fluent-api-title}

* Versão de lançamento: Australia
* 
* Atualizado 12 de mar. de 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 7 min. de leitura

The Service Level Agreement API defines service level agreements \[contract_sla\] that set the amount of time for a task to reach a specified
condition, ensuring that tasks are resolved according to the service levels agreed between a service provider and customer.
For general information about SLAs, see [Service Level Management](https://www.servicenow.com/docs/access?context=service-level-mgmt-landing-page&version=australia&pubname=australia-it-service-management&ft:locale=en-US).{#fluent-sla-api__fluent-api-general-info}
**Conceitos relacionados**   

* [ServiceNow Fluent](https://servicenow-prod.fluidtopics.net/pP6OxbNArnr2tlBRkmrTfw "Define application metadata in source code using the ServiceNow Fluent domain-specific programming language.")

## Sla object {#fluent-sla-object__fluent-object-title}

Create
an
SLA definition
\[contract_sla\] that controls the timing, conditions, workflows, and other information required to create and progress task
SLAs.
{#fluent-sla-object__table_sla_object__entry__3}{#fluent-sla-object__now-id-desc2}

| Name | Type | Description |
|-|-|-|
| $id | String or Number | Required. A unique ID for the metadata object. When you build the application, this ID is hashed into a unique sys_id. For more information, see [ServiceNow Fluent language constructs](https://servicenow-prod.fluidtopics.net/b1y7cW0gok5uzbNJ5JcSTw "ServiceNow Fluent language constructs provide additional functionality for development in source code with ServiceNow Fluent APIs."). Format: `Now.ID['String' or Number]` |
| name | String | Required. A name for the SLA definition. |
| table | String | The name of the table to which the SLA applies. Default: incident |
| type | String | The type of service level agreement. The type is used for reporting purposes only. Valid values: * SLA: A service level agreement between a service provider and an external customer. * OLA: An operational level agreement between internal teams within the same organization. * Underpinning contract: A contract with an external vendor that underpins the service delivered to the customer. {#fluent-sla-object__ul_knc_x4c_l3c} Default: SLA |
| active | Boolean | Flag that indicates whether the SLA definition is active and can be matched against task records. Valid values: * true: The SLA definition is active. * false: The SLA definition is inactive and isn't matched against task records. {#fluent-sla-object__ul_cny_x4c_l3c} Default: true |
| target | String | The stage of the task that the SLA measures. The target is used for filtering, searching, and reporting purposes only. Valid values: * response: The SLA measures the time to first respond to a task. * resolution: The SLA measures the time to resolve a task. {#fluent-sla-object__ul_sy3_y4c_l3c} |
| duration | Object | The time duration within which the task must reach the target condition. Use the `Duration()` function to specify the duration. This property is required if the value of the durationType property is empty. Format: duration: Duration({ days: Number, hours: Number, minutes: Number, seconds: Number }) |
| durationType | Reference or String | The sys_id of a relative duration \[cmn_relative_duration\], such as Breach on Due Date or End of next business day, to use instead of a user-specified duration. To define a relative duration, use the [Record API - ServiceNow Fluent](https://servicenow-prod.fluidtopics.net/ZgSD9CwRLbWqLhdTkFJpZA#record-api-now-ts "The Record API defines records in any table. Use the Record API to define application metadata that doesn't have a dedicated ServiceNow Fluent API."). |
| relativeDurationWorksOn | String | The record type from which the relative duration is calculated. This property only applies if the value of the durationType property is set. Valid values: * Task record: The relative duration is calculated from the task record. * SLA record: The relative duration is calculated from the SLA record. {#fluent-sla-object__ul_nh3_wrc_l3c} Default: Task record |
| schedule | Reference or String | The sys_id of a schedule \[cmn_schedule\] for the time periods during which the SLAs accumulate business time. To define a schedule, use the [Record API - ServiceNow Fluent](https://servicenow-prod.fluidtopics.net/ZgSD9CwRLbWqLhdTkFJpZA#record-api-now-ts "The Record API defines records in any table. Use the Record API to define application metadata that doesn't have a dedicated ServiceNow Fluent API."). This property is required if the value of the scheduleSource property is `sla_definition`. |
| scheduleSource | String | The source from which the schedule is obtained. Valid values: * sla_definition: The schedule is specified in the SLA definition using the schedule property. * task_field: The schedule is obtained from a field on the task record specified with the scheduleSourceField property. * no_schedule: No schedule is used, and the SLA runs continuously (24x7). {#fluent-sla-object__ul_alc_xxc_l3c} Default: sla_definition |
| scheduleSourceField | String | The field from the task that provides the schedule. This property is required if the value of the scheduleSource property is `task_field`. |
| conditions | Object | Encoded query conditions that control the timing of an SLA. For example, `'priority=1^state!=6'` matches tasks with a priority of 1 that aren't in a closed state. For more information about SLA conditions, see [Create an SLA definition](https://www.servicenow.com/docs/access?context=t_CreateAnSLADefinition&version=australia&pubname=australia-it-service-management&ft:locale=en-US). For information about filter queries, see [Operators available for filters and queries](https://www.servicenow.com/docs/access?context=r_OpAvailableFiltersQueries&version=australia&pubname=australia-platform-user-interface&ft:locale=en-US). Format: conditions: { start: 'String', stop: 'String', pause: 'String', resume: 'String', reset: 'String', cancel: 'String', } |
| advancedConditionType | String | The type of advanced condition logic to apply. Valid values: * none: No advanced condition logic is applied. * advanced: A custom advanced condition script is used. * advanced_journal: Advanced condition logic based on journal entries is used. * advanced_system: Advanced condition logic based on system events is used. * advanced_journal_and_system: Advanced condition logic based on both journal entries and system events is used. {#fluent-sla-object__ul_lmp_wxc_l3c} Default: none |
| conditionType | String | The sys_id of an SLA condition \[sla_condition_class\] that determines when transitions between different stages of each task SLA. |
| resetAction | String | The action to take on the current task SLA record when the reset condition is met. Valid values: * cancel: The current task SLA record is canceled and a new one is created. * complete: The current task SLA record is marked as complete and a new one is created. {#fluent-sla-object__ul_tgz_dzc_l3c} Default: cancel |
| whenTo | Object | Settings that control when a paused SLA resumes and when an SLA cancels. * resume: The behavior that controls when a paused SLA resumes timing. Valid values: * on_condition: The SLA resumes when the task record matches the condition defined with the resume property of the conditions object. * no_match: The SLA resumes when the task record no longer matches the pause condition defined with the pause property of the conditions object. {#fluent-sla-object__ul_qhb_g3d_l3c} Default: on_condition * cancel: The behavior that controls when an active SLA is canceled. Valid values: * on_condition: The SLA is canceled when the task record matches the condition defined with the cancel property of the conditions object. * no_match: The SLA is canceled when the task record no longer matches the start condition defined with the start property of the conditions object. * never: The SLA is never canceled regardless of task record state. {#fluent-sla-object__ul_urx_c3d_l3c} Default: on_condition {#fluent-sla-object__ul_d1m_shd_l3c} Format: whenTo: { resume: 'String', cancel: 'String', } |
| retroactive | Object | Settings that control whether the SLA start time is set to a point in the past based on a specified field value. * start: Flag that indicates whether retroactive start is enabled. When enabled, the SLA start time is set to the value of the field specified in setStartTo rather than the time when the start condition was first met. Default: false * setStartTo: The field on the task record whose value is used as the SLA start time when retroactive start is enabled. This property is required if the value of the start property is true. * pause: Flag that indicates whether retroactive pause is enabled when retroactive start is active. When enabled, any time that the task was in a paused state before the SLA was attached is subtracted from the elapsed time. Default: true {#fluent-sla-object__ul_uzx_r3d_l3c} Format: retroactive: { start: Boolean, setStartTo: 'String', pause: Boolean, } |
| timezoneSource | String | The source from which the time zone for SLA calculations is obtained. Valid values: * task.caller_id.time_zone: The time zone of the caller on the task record. * task.caller_id.location.time_zone: The time zone of the caller's location on the task record. * task.cmdb_ci.location.time_zone: The time zone of the configuration item's location on the task record. * task.location.time_zone: The time zone of the location on the task record. * sla.timezone: The time zone specified with the timezone property. {#fluent-sla-object__ul_pvw_11d_l3c} Default: task.caller_id.time_zone |
| timezone | String | The time zone to use for SLA calculations, such as `US/Pacific`. This property is required if the value of the timezoneSource property is `sla.timezone`. |
| overrides | Reference or String | The variable identifier or sys_id of another SLA definition \[contract_sla\] that this SLA definition overrides. |
| workflow | Reference or String | The variable identifier or sys_id of a workflow \[wf_workflow\] to run when the SLA reaches a milestone or breaches. To define a workflow, use the [Record API - ServiceNow Fluent](https://servicenow-prod.fluidtopics.net/ZgSD9CwRLbWqLhdTkFJpZA#record-api-now-ts "The Record API defines records in any table. Use the Record API to define application metadata that doesn't have a dedicated ServiceNow Fluent API."). |
| flow | Reference or String | The variable identifier or sys_id of a flow \[sys_hub_flow\] to run when the SLA reaches a milestone or breaches. To define a flow, use the [Flow API - ServiceNow Fluent](https://servicenow-prod.fluidtopics.net/epOmm1j14UyFZqMbokEkhA#fluent-flow-api "The Flow API defines flows and subflows [sys_hub_flow], which automate business processes with reusable multiple-step components."). Default: Default SLA flow (828f267973333300e289235f04f6a7a3) |
| vendor | Reference or String | The variable identifier or sys_id of a company \[core_company\] that is the vendor for an underpinning contract SLA. To define a company, use the [Record API - ServiceNow Fluent](https://servicenow-prod.fluidtopics.net/ZgSD9CwRLbWqLhdTkFJpZA#record-api-now-ts "The Record API defines records in any table. Use the Record API to define application metadata that doesn't have a dedicated ServiceNow Fluent API."). |
| domainPath | String | The domain path that determines which domain owns the SLA in a multi-domain environment. Default: The global domain (/) |
| enableLogging | Boolean | Flag that indicates whether debug logging is enabled for the SLA definition. Valid values: * true: Debug logging is enabled. * false: Debug logging is turned off. {#fluent-sla-object__ul_bs5_kcd_l3c} Default: false |
| $meta | Object | Metadata for the application metadata. With the installMethod property, you can map the application metadata to an output directory that loads only in specific circumstances. $meta: { installMethod: 'String' } Valid values for installMethod: * demo: Outputs the application metadata to the metadata/unload.demo directory to be installed with the application when the Load demo data option is selected. * first install: Outputs the application metadata to the metadata/unload directory to be installed only the first time an application is installed on an instance. {#fluent-sla-object__ul_n3q_y3s_42c} |
[Tabela 1. Properties]

{#fluent-sla-object__table_sla_object}  

    import { Sla, Duration } from '@servicenow/sdk/core'

    Sla({
        $id: Now.ID['incident-p1-resolution'],
        name: 'P1 Incident Resolution',
        table: 'incident',
        target: 'resolution',
        duration: Duration({ hours: 4 }),
        schedule: 'b1992362eb601100fcfb858ad106fe16',
        conditions: {
            start: 'priority=1',
            stop: 'state=6',
            pause: 'state=3',
            resume: 'state!=3',
        },
        whenTo: {
            resume: 'on_condition',
        },
        resetAction: 'cancel',
    })


