/** * incident.io * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime.js'; import { type IncidentsConnectExternalIssuePayloadV2 } from '../models/IncidentsConnectExternalIssuePayloadV2.js'; import { type IncidentsCreatePayloadV2 } from '../models/IncidentsCreatePayloadV2.js'; import { type IncidentsCreateResultV2 } from '../models/IncidentsCreateResultV2.js'; import { type IncidentsEditPayloadV2 } from '../models/IncidentsEditPayloadV2.js'; import { type IncidentsEditResultV2 } from '../models/IncidentsEditResultV2.js'; import { type IncidentsImportPostmortemDocumentPayloadV2 } from '../models/IncidentsImportPostmortemDocumentPayloadV2.js'; import { type IncidentsImportPostmortemDocumentResultV2 } from '../models/IncidentsImportPostmortemDocumentResultV2.js'; import { type IncidentsListResultV2 } from '../models/IncidentsListResultV2.js'; import { type IncidentsShowResultV2 } from '../models/IncidentsShowResultV2.js'; export interface IncidentsV2ConnectExternalIssueRequest { /** * The unique identifier of the incident */ id: string; /** * */ body: IncidentsConnectExternalIssuePayloadV2; } export interface IncidentsV2CreateRequest { /** * */ body: IncidentsCreatePayloadV2; } export interface IncidentsV2EditRequest { /** * The unique identifier of the incident that you want to edit */ id: string; /** * */ body: IncidentsEditPayloadV2; } export interface IncidentsV2ImportPostmortemDocumentRequest { /** * The unique identifier of the incident */ id: string; /** * */ body: IncidentsImportPostmortemDocumentPayloadV2; } export interface IncidentsV2ListRequest { /** * Integer number of records to return */ page_size?: number; /** * An incident's ID. This endpoint will return a list of incidents after this ID in relation to the API response order. */ after?: string; /** * What order to return results in. */ sort_by?: IncidentsV2ListSortByEnum; /** * How to combine the filters: 'all' combines them with AND logic (all must match), 'any' combines them with OR logic (any can match). Defaults to 'all'. */ filter_mode?: IncidentsV2ListFilterModeEnum; /** * Filter on incident status. The accepted operators are 'one_of', or 'not_in'. */ status?: { [key: string]: Array; }; /** * Filter on the category of the incidents status. The accepted operators are 'one_of', or 'not_in'. */ status_category?: { [key: string]: Array; }; /** * Filter on incident created at timestamp. The accepted operators are 'gte', 'lte' and 'date_range'. */ created_at?: { [key: string]: Array; }; /** * Filter on incident updated at timestamp. The accepted operators are 'gte', 'lte' and 'date_range'. */ updated_at?: { [key: string]: Array; }; /** * Filter on incident severity. The accepted operators are 'one_of', 'not_in', 'gte', 'lte'. */ severity?: { [key: string]: Array; }; /** * Filter on incident type. The accepted operators are 'one_of, or 'not_in'. */ incident_type?: { [key: string]: Array; }; /** * Filter on an incident role. Role ID should be sent, along with backlink attribute ID (if needed) followed by the operator and values. The accepted operators are 'one_of', 'is_blank'. */ incident_role?: { [key: string]: { [key: string]: Array; }; }; /** * Filter on an incident custom field. Custom field ID should be sent, followed by the operator and values. Accepted operator will depend on the custom field type. */ custom_field?: { [key: string]: { [key: string]: Array; }; }; /** * Filter on incident mode. The accepted operator is 'one_of'. If this is not provided, this value defaults to `{"one_of": ["standard", "retrospective"] }`, meaning that test and tutorial incidents are not included. */ mode?: { [key: string]: Array; }; } export interface IncidentsV2ShowRequest { /** * Unique identifier for the incident */ id: string; } /** * */ export declare class IncidentsV2Api extends runtime.BaseAPI { /** * Creates request options for incidentsV2ConnectExternalIssue without sending the request */ incidentsV2ConnectExternalIssueRequestOpts(requestParameters: IncidentsV2ConnectExternalIssueRequest): Promise; /** * Connect an existing issue in an issue tracker to an incident, as its external issue. The issue is synced using the given incident ticket template, as if incident.io had created it from that template. The next sync writes the incident\'s fields into the issue. This works whether or not automatic incident ticket creation is turned on. While it is off, no tickets are created for other incidents, and the incident\'s fields are not written into this issue until it is turned on. This needs the incident_external_issues.create scope, either across the organisation or from an incident role on this incident. This fails if the incident already has a different external issue (unless replace is true), or if the issue is already linked to another incident or follow-up. The ID supplied can be either the incident\'s full ID, or the numeric part of its reference. * ConnectExternalIssue Incidents V2 */ incidentsV2ConnectExternalIssueRaw(requestParameters: IncidentsV2ConnectExternalIssueRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Connect an existing issue in an issue tracker to an incident, as its external issue. The issue is synced using the given incident ticket template, as if incident.io had created it from that template. The next sync writes the incident\'s fields into the issue. This works whether or not automatic incident ticket creation is turned on. While it is off, no tickets are created for other incidents, and the incident\'s fields are not written into this issue until it is turned on. This needs the incident_external_issues.create scope, either across the organisation or from an incident role on this incident. This fails if the incident already has a different external issue (unless replace is true), or if the issue is already linked to another incident or follow-up. The ID supplied can be either the incident\'s full ID, or the numeric part of its reference. * ConnectExternalIssue Incidents V2 */ incidentsV2ConnectExternalIssue(requestParameters: IncidentsV2ConnectExternalIssueRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Creates request options for incidentsV2Create without sending the request */ incidentsV2CreateRequestOpts(requestParameters: IncidentsV2CreateRequest): Promise; /** * Create a new incident. Note that if the incident mode is set to \"retrospective\" then the new incident will not be announced in Slack. * Create Incidents V2 */ incidentsV2CreateRaw(requestParameters: IncidentsV2CreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Create a new incident. Note that if the incident mode is set to \"retrospective\" then the new incident will not be announced in Slack. * Create Incidents V2 */ incidentsV2Create(requestParameters: IncidentsV2CreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Creates request options for incidentsV2Edit without sending the request */ incidentsV2EditRequestOpts(requestParameters: IncidentsV2EditRequest): Promise; /** * Edit an existing incident. This endpoint allows you to edit the properties of an existing incident: e.g. set the severity or update custom fields. When using this endpoint, only fields that are provided will be edited (omitted fields will be ignored). The API key must have `incidents.view`, and the scope corresponding to each property it changes: - `incidents.update_name` for the name or the Slack channel name override - `incidents.update_summary` for the summary - `incidents.update_severity` for the severity - `incidents.update_status` for the status - `incidents.update_custom_fields` for custom fields - `incidents.update_timestamps` for timestamps - `incidents.update_role_assignments` for role assignments - `incident_calls.create` to set the call URL - `incident_calls.destroy` when replacing an existing call URL * Edit Incidents V2 */ incidentsV2EditRaw(requestParameters: IncidentsV2EditRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Edit an existing incident. This endpoint allows you to edit the properties of an existing incident: e.g. set the severity or update custom fields. When using this endpoint, only fields that are provided will be edited (omitted fields will be ignored). The API key must have `incidents.view`, and the scope corresponding to each property it changes: - `incidents.update_name` for the name or the Slack channel name override - `incidents.update_summary` for the summary - `incidents.update_severity` for the severity - `incidents.update_status` for the status - `incidents.update_custom_fields` for custom fields - `incidents.update_timestamps` for timestamps - `incidents.update_role_assignments` for role assignments - `incident_calls.create` to set the call URL - `incident_calls.destroy` when replacing an existing call URL * Edit Incidents V2 */ incidentsV2Edit(requestParameters: IncidentsV2EditRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Creates request options for incidentsV2ImportPostmortemDocument without sending the request */ incidentsV2ImportPostmortemDocumentRequestOpts(requestParameters: IncidentsV2ImportPostmortemDocumentRequest): Promise; /** * Import a postmortem document from markdown into an incident. The document content should be provided as GitHub-Flavored Markdown. It will be parsed and converted into the collaborative editor format, and a new postmortem document will be created for the incident. If no main postmortem document exists for the incident, the imported document will become the main document. * ImportPostmortemDocument Incidents V2 */ incidentsV2ImportPostmortemDocumentRaw(requestParameters: IncidentsV2ImportPostmortemDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Import a postmortem document from markdown into an incident. The document content should be provided as GitHub-Flavored Markdown. It will be parsed and converted into the collaborative editor format, and a new postmortem document will be created for the incident. If no main postmortem document exists for the incident, the imported document will become the main document. * ImportPostmortemDocument Incidents V2 */ incidentsV2ImportPostmortemDocument(requestParameters: IncidentsV2ImportPostmortemDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Creates request options for incidentsV2List without sending the request */ incidentsV2ListRequestOpts(requestParameters: IncidentsV2ListRequest): Promise; /** * List all incidents for an organisation. This endpoint supports a number of filters, which can help find incidents matching certain criteria. Filters are provided as query parameters, but due to the dynamic nature of what you can query by (different accounts have different custom fields, statuses, etc) they are more complex than most. The maximum page size that can be requested is 250. To help, here are some exemplar curl requests with a human description of what they search for. Note that: - Filters may be combined using the filter_mode parameter: \'all\' (default) requires all filters to match (AND logic), while \'any\' requires at least one filter to match (OR logic). - IDs are normally in UUID format, but have been replaced with shorter strings to improve readability. - All query parameters must be URI encoded. ### By status With status of id=ABC, find all incidents that are set to that status: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'status[one_of]=ABC\' Or all incidents that are not set to status with id=ABC: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'status[not_in]=ABC\' ### By created_at or updated_at Find all incidents that follow specified date parameters for created_at and updated_at fields. Possible values are \"gte\" (greater than or equal to), \"lte\" (less than or equal to), and \"date_range\" (between two dates). The following example finds all incidents created before or on 2021-01-02T00:00:00Z: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'created_at[lte]=2021-01-02\' To find incidents created within a specific date range, use the date_range option with tilde-separated dates: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'created_at[date_range]=2024-12-02~2024-12-08\' ### By status category Find all incidents that are in a status category. Some categories use a different name in the API than the one shown in the dashboard — most notably \"live\" (shown as \"Active\") and \"learning\" (shown as \"Post-incident\"). The full mapping is: | API value | Shown in app as | | ---------- | --------------- | | triage | Triage | | live | Active | | learning | Post-incident | | paused | Paused | | closed | Closed | | declined | Declined | | canceled | Canceled | | merged | Merged | For example, to find all incidents the dashboard shows as \"Active\", filter on the \"live\" category: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'status_category[one_of]=live\' Or all incidents that are not in a status category: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'status_category[not_in]=live\' ### By severity With severity of id=ABC, find all incidents that are set to that severity: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'severity[one_of]=ABC\' Or all incidents where severity rank is greater-than-or-equal-to the rank of severity id=ABC: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'severity[gte]=ABC\' Or all incidents where severity rank is less-than-or-equal-to the rank of severity id=ABC: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'severity[lte]=ABC\' ### By incident type With incident type of id=ABC, find all incidents that are of that type: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'incident_type[one_of]=ABC\' Or all incidents not of that type: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'incident_type[not_in]=ABC\' ### By incident mode By default, we return standard and retrospective incidents. This means that test and tutorial incidents are filtered out. To override this behaviour, you can use the mode filter to specify which modes you want to get. To find incidents of all modes: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'mode[one_of]=standard&mode[one_of]=retrospective&mode[one_of]=test&mode[one_of]=tutorial\' To find just test incidents: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'mode[one_of]=test\' ### By incident role Roles and custom fields have another nested layer in the query parameter, to account for operations against any of the roles or custom fields created in the account. With incident role id=ABC, find all incidents where that role is unset: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'incident_role[ABC][is_set]=true\' Or where the role has been set: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'incident_role[ABC][is_set]=false\' ### By option custom fields With an option custom field id=ABC, all incidents that have field ABC set to the custom field option of id=XYZ: curl \\ --get \'https://api.incident.io/v2/incidents\' \\ --data \'custom_field[ABC][one_of]=XYZ\' Or all incidents that do not have custom field id=ABC set to option id=XYZ: curl \\ --get \'https://api.incident.io/v2/incidents\' \\ --data \'custom_field[ABC][not_in]=XYZ\' ### Sorting By default, results are ordered by their creation date. You can use the sort_by parameter to reverse this order: curl \\ --get \'https://api.incident.io/v2/incidents\' \\ --data \'sort_by=created_at_oldest_first\' * List Incidents V2 */ incidentsV2ListRaw(requestParameters: IncidentsV2ListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * List all incidents for an organisation. This endpoint supports a number of filters, which can help find incidents matching certain criteria. Filters are provided as query parameters, but due to the dynamic nature of what you can query by (different accounts have different custom fields, statuses, etc) they are more complex than most. The maximum page size that can be requested is 250. To help, here are some exemplar curl requests with a human description of what they search for. Note that: - Filters may be combined using the filter_mode parameter: \'all\' (default) requires all filters to match (AND logic), while \'any\' requires at least one filter to match (OR logic). - IDs are normally in UUID format, but have been replaced with shorter strings to improve readability. - All query parameters must be URI encoded. ### By status With status of id=ABC, find all incidents that are set to that status: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'status[one_of]=ABC\' Or all incidents that are not set to status with id=ABC: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'status[not_in]=ABC\' ### By created_at or updated_at Find all incidents that follow specified date parameters for created_at and updated_at fields. Possible values are \"gte\" (greater than or equal to), \"lte\" (less than or equal to), and \"date_range\" (between two dates). The following example finds all incidents created before or on 2021-01-02T00:00:00Z: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'created_at[lte]=2021-01-02\' To find incidents created within a specific date range, use the date_range option with tilde-separated dates: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'created_at[date_range]=2024-12-02~2024-12-08\' ### By status category Find all incidents that are in a status category. Some categories use a different name in the API than the one shown in the dashboard — most notably \"live\" (shown as \"Active\") and \"learning\" (shown as \"Post-incident\"). The full mapping is: | API value | Shown in app as | | ---------- | --------------- | | triage | Triage | | live | Active | | learning | Post-incident | | paused | Paused | | closed | Closed | | declined | Declined | | canceled | Canceled | | merged | Merged | For example, to find all incidents the dashboard shows as \"Active\", filter on the \"live\" category: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'status_category[one_of]=live\' Or all incidents that are not in a status category: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'status_category[not_in]=live\' ### By severity With severity of id=ABC, find all incidents that are set to that severity: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'severity[one_of]=ABC\' Or all incidents where severity rank is greater-than-or-equal-to the rank of severity id=ABC: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'severity[gte]=ABC\' Or all incidents where severity rank is less-than-or-equal-to the rank of severity id=ABC: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'severity[lte]=ABC\' ### By incident type With incident type of id=ABC, find all incidents that are of that type: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'incident_type[one_of]=ABC\' Or all incidents not of that type: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'incident_type[not_in]=ABC\' ### By incident mode By default, we return standard and retrospective incidents. This means that test and tutorial incidents are filtered out. To override this behaviour, you can use the mode filter to specify which modes you want to get. To find incidents of all modes: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'mode[one_of]=standard&mode[one_of]=retrospective&mode[one_of]=test&mode[one_of]=tutorial\' To find just test incidents: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'mode[one_of]=test\' ### By incident role Roles and custom fields have another nested layer in the query parameter, to account for operations against any of the roles or custom fields created in the account. With incident role id=ABC, find all incidents where that role is unset: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'incident_role[ABC][is_set]=true\' Or where the role has been set: curl --get \'https://api.incident.io/v2/incidents\' \\ --data \'incident_role[ABC][is_set]=false\' ### By option custom fields With an option custom field id=ABC, all incidents that have field ABC set to the custom field option of id=XYZ: curl \\ --get \'https://api.incident.io/v2/incidents\' \\ --data \'custom_field[ABC][one_of]=XYZ\' Or all incidents that do not have custom field id=ABC set to option id=XYZ: curl \\ --get \'https://api.incident.io/v2/incidents\' \\ --data \'custom_field[ABC][not_in]=XYZ\' ### Sorting By default, results are ordered by their creation date. You can use the sort_by parameter to reverse this order: curl \\ --get \'https://api.incident.io/v2/incidents\' \\ --data \'sort_by=created_at_oldest_first\' * List Incidents V2 */ incidentsV2List(requestParameters?: IncidentsV2ListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Creates request options for incidentsV2Show without sending the request */ incidentsV2ShowRequestOpts(requestParameters: IncidentsV2ShowRequest): Promise; /** * Get a single incident. The ID supplied can be either the incident\'s full ID, or the numeric part of its reference. For example, to get INC-123, you could use either its full ID or: curl \\ --get \'https://api.incident.io/v2/incidents/123 * Show Incidents V2 */ incidentsV2ShowRaw(requestParameters: IncidentsV2ShowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Get a single incident. The ID supplied can be either the incident\'s full ID, or the numeric part of its reference. For example, to get INC-123, you could use either its full ID or: curl \\ --get \'https://api.incident.io/v2/incidents/123 * Show Incidents V2 */ incidentsV2Show(requestParameters: IncidentsV2ShowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } /** * @export */ export declare const IncidentsV2ListSortByEnum: { readonly CreatedAtNewestFirst: "created_at_newest_first"; readonly CreatedAtOldestFirst: "created_at_oldest_first"; }; export type IncidentsV2ListSortByEnum = typeof IncidentsV2ListSortByEnum[keyof typeof IncidentsV2ListSortByEnum]; /** * @export */ export declare const IncidentsV2ListFilterModeEnum: { readonly All: "all"; readonly Any: "any"; }; export type IncidentsV2ListFilterModeEnum = typeof IncidentsV2ListFilterModeEnum[keyof typeof IncidentsV2ListFilterModeEnum];