---
updatedAt: 2025-02-27T21:04:24.000Z
agentTools:
  projectIndex: https://developers.atlas.so/llms.txt
---

# Create sla rule

Creates sla rule

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Atlas API",
    "description": "Atlas API Documentation",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.atlas.so"
    }
  ],
  "paths": {
    "/v1/sla-rules": {
      "post": {
        "tags": [
          "Sla Rules"
        ],
        "summary": "Create sla rule",
        "description": "Creates sla rule",
        "operationId": "create_api_v1_sla_rules_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalCreateSlaRule"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalSlaRule"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DeliveryType": {
        "type": "integer",
        "enum": [
          1,
          2,
          4,
          5,
          6,
          7,
          3,
          99,
          100
        ],
        "title": "DeliveryType"
      },
      "ExternalConversationPriority": {
        "type": "string",
        "enum": [
          "NO_PRIORITY",
          "LOW",
          "MEDIUM",
          "HIGH",
          "URGENT"
        ],
        "title": "ExternalConversationPriority"
      },
      "ExternalCreateSlaRule": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "segment": {
            "type": "string",
            "title": "Segment"
          },
          "priorities": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ExternalConversationPriority"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Priorities"
          },
          "firstResponseTime": {
            "type": "integer",
            "title": "Firstresponsetime"
          },
          "nextResponseTime": {
            "type": "integer",
            "title": "Nextresponsetime"
          },
          "workingHours": {
            "$ref": "#/components/schemas/WorkingHourTypes"
          },
          "rank": {
            "type": "number",
            "title": "Rank"
          },
          "notifications": {
            "items": {
              "$ref": "#/components/schemas/SlaRuleNotification"
            },
            "type": "array",
            "title": "Notifications"
          },
          "channels": {
            "items": {
              "$ref": "#/components/schemas/DeliveryType"
            },
            "type": "array",
            "title": "Channels",
            "default": []
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "default": []
          },
          "teams": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Teams",
            "default": []
          },
          "subChannels": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subchannels",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "name",
          "segment",
          "firstResponseTime",
          "nextResponseTime",
          "workingHours",
          "rank",
          "notifications"
        ],
        "title": "ExternalCreateSlaRule"
      },
      "ExternalSlaRule": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "segment": {
            "type": "string",
            "title": "Segment"
          },
          "priorities": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ExternalConversationPriority"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Priorities"
          },
          "firstResponseTime": {
            "type": "integer",
            "title": "Firstresponsetime"
          },
          "nextResponseTime": {
            "type": "integer",
            "title": "Nextresponsetime"
          },
          "workingHours": {
            "$ref": "#/components/schemas/WorkingHourTypes"
          },
          "rank": {
            "type": "number",
            "title": "Rank"
          },
          "notifications": {
            "items": {
              "$ref": "#/components/schemas/SlaRuleNotification"
            },
            "type": "array",
            "title": "Notifications"
          },
          "channels": {
            "items": {
              "$ref": "#/components/schemas/DeliveryType"
            },
            "type": "array",
            "title": "Channels",
            "default": []
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "default": []
          },
          "teams": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Teams",
            "default": []
          },
          "subChannels": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subchannels",
            "default": []
          },
          "id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "companyId": {
            "type": "string",
            "format": "uuid",
            "title": "Companyid"
          }
        },
        "type": "object",
        "required": [
          "name",
          "segment",
          "firstResponseTime",
          "nextResponseTime",
          "workingHours",
          "rank",
          "notifications",
          "companyId"
        ],
        "title": "ExternalSlaRule"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "SlaRuleNotification": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "interval": {
            "type": "integer",
            "title": "Interval"
          },
          "condition": {
            "anyOf": [
              {
                "type": "string",
                "const": "before"
              },
              {
                "type": "string",
                "const": "after"
              }
            ],
            "title": "Condition"
          },
          "channel": {
            "anyOf": [
              {
                "type": "string",
                "const": "slack"
              },
              {
                "type": "string",
                "const": "email"
              }
            ],
            "title": "Channel"
          },
          "notify": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            ],
            "title": "Notify"
          },
          "showFullDetailsPostAnswerInSlack": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Showfulldetailspostanswerinslack"
          }
        },
        "type": "object",
        "required": [
          "name",
          "interval",
          "condition",
          "channel",
          "notify"
        ],
        "title": "SlaRuleNotification"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "WorkingHourTypes": {
        "type": "string",
        "enum": [
          "always",
          "custom"
        ],
        "title": "WorkingHourTypes"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
```