### Rootly API - Example GET Request
Source: https://docs.rootly.com/api-reference/escalationlevelspath/creates-an-escalation-level-for-an-escalation-path
This example shows how to make a GET request to the Rootly API to retrieve a list of incidents. It includes necessary headers for content type and authorization, and demonstrates pagination using query parameters.
```bash
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents
```
--------------------------------
### Example Pagination Request (Rootly API)
Source: https://docs.rootly.com/api-reference/formfieldpositions/delete-a-formfieldposition
Demonstrates how to use the 'page' query parameter to paginate through collections of items in the Rootly API. This example shows a GET request to the /v1/incidents endpoint with parameters to specify the page number and size.
```bash
```bash
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10
```
```
--------------------------------
### Example API Key Generation and Authentication (Rootly API)
Source: https://docs.rootly.com/api-reference/formfieldpositions/delete-a-formfieldposition
Illustrates how to generate an API key through the Rootly organization settings and provides an example using cURL to make an authenticated GET request to the /v1/incidents endpoint. It emphasizes the use of the 'Authorization: Bearer YOUR-TOKEN' header and the 'application/vnd.api+json' content type.
```bash
```bash
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents
```
```
--------------------------------
### Example API Request using cURL (Bash)
Source: https://docs.rootly.com/api-reference/incidenteventservices/retrieves-an-incident-event-service
This example demonstrates how to make a GET request to the Rootly API using cURL. It includes essential headers for authentication (Bearer token) and content type (application/vnd.api+json). It also shows how to use query parameters for pagination.
```bash
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10
```
--------------------------------
### Example API Key Generation and Usage (Markdown)
Source: https://docs.rootly.com/api-reference/playbooks/delete-a-playbook
This snippet explains how to generate an API key within the Rootly platform and provides a cURL example for making authenticated GET requests to the API. It highlights the importance of the 'Authorization: Bearer YOUR-TOKEN' header.
```markdown
# How to generate an API Key?
- **Organization dropdown** > **Organization Settings** > **API Keys**
# JSON:API Specification
Rootly is using **JSON:API** (https://jsonapi.org) specification:
- JSON:API is a specification for how a client should request that resources
be fetched or modified, and how a server should respond to those requests.
- JSON:API is designed to minimize both the number of requests and the
amount of data transmitted between clients and servers. This efficiency is
achieved without compromising readability, flexibility, or discoverability.
- JSON:API requires use of the JSON:API media type
(**application/vnd.api+json**) for exchanging data.
# Authentication and Requests
We use standard HTTP Authentication over HTTPS to authorize your requests.
```
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents
```
```
--------------------------------
### Rootly API - Example Paginated GET Request
Source: https://docs.rootly.com/api-reference/escalationlevelspath/creates-an-escalation-level-for-an-escalation-path
This example demonstrates how to fetch incidents from the Rootly API with pagination applied. It uses query parameters `page[number]` and `page[size]` to control the results returned, adhering to the API's pagination strategy.
```bash
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10
```
--------------------------------
### Authenticate and Request Data using cURL (Bash)
Source: https://docs.rootly.com/api-reference/alertgroups/creates-an-alert-group
This example demonstrates how to authenticate with the Rootly API using a Bearer token and make a GET request to the /v1/incidents endpoint. It also shows how to use query parameters for pagination.
```bash
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents
# Example with pagination:
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10
```
--------------------------------
### Example API Key Generation (Rootly Documentation)
Source: https://docs.rootly.com/api-reference/incidentroletasks/retrieves-an-incident-role-task
This snippet explains how to generate an API key within the Rootly platform. It guides users to the 'API Keys' section under 'Organization Settings'.
```markdown
# How to generate an API Key?
- **Organization dropdown** > **Organization Settings** > **API Keys**
```
--------------------------------
### Rootly API v1 - Get Teams Example (YAML)
Source: https://docs.rootly.com/api-reference/teams/list-teams
This snippet shows an example of how to fetch a list of teams from the Rootly API using a GET request. It specifies the content type and authorization headers required for the request.
```yaml
openapi: 3.0.1
info:
title: Rootly API v1
version: v1
description: >+
# How to generate an API Key?
- **Organization dropdown** > **Organization Settings** > **API Keys**
# JSON:API Specification
Rootly is using **JSON:API** (https://jsonapi.org) specification:
- JSON:API is a specification for how a client should request that resources
be fetched or modified, and how a server should respond to those requests.
- JSON:API is designed to minimize both the number of requests and the
amount of data transmitted between clients and servers. This efficiency is
achieved without compromising readability, flexibility, or discoverability.
- JSON:API requires use of the JSON:API media type
(**application/vnd.api+json**) for exchanging data.
# Authentication and Requests
We use standard HTTP Authentication over HTTPS to authorize your requests.
```
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents
```
# Rate limiting
- There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls
**per API key** every **60 seconds** (0 hours). The limit is calculated over
a **0-hour sliding window** looking back from the current time. While the
limit can be configured to support higher thresholds, you must first contact
your **Rootly Customer Success Manager** to make any adjustments.
- There is a default limit of **3** **POST**, **PUT**, **PATCH** or
**DELETE** calls **per API key** every **60 seconds** (0 hours). The limit
is calculated over a **0-hour sliding window** looking back from the current
time. While the limit can be configured to support higher thresholds, you
must first contact your **Rootly Customer Success Manager** to make any
adjustments.
- When rate limits are exceeded, the API will return a **429 Too Many
Requests** HTTP status code with the response: `{"error": "Rate limit
exceeded. Try again later."}`
- **X-RateLimit headers** are included in every API response, providing
real-time rate limit information:
- **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., "1000, 1000;window=3600" for 1000 requests per hour)
- **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window
- **X-RateLimit-Used** - The number of requests already made in the current window
- **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds
# Pagination
- Pagination is supported for all endpoints that return a collection of
items.
- Pagination is controlled by the **page** query parameter
## Example
```
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10
```
x-logo:
url: https://rootly-heroku.s3.us-east-1.amazonaws.com/swagger/v1/logo.png
alt: Rootly
servers:
- url: https://api.rootly.com
security: []
paths:
/v1/teams:
get:
tags:
- Teams
summary: List teams
description: List teams
operationId: listTeams
parameters:
- name: include
in: query
description: 'comma separated if needed. eg: users'
schema:
type: string
enum:
- users
required: false
- name: page[number]
in: query
required: false
schema:
type: integer
- name: page[size]
in: query
required: false
schema:
type: integer
- name: filter[search]
in: query
required: false
schema:
type: string
- name: filter[slug]
in: query
required: false
schema:
type: string
- name: filter[name]
in: query
required: false
schema:
type: string
- name: filter[backstage_id]
in: query
required: false
schema:
type: string
- name: filter[cortex_id]
in: query
required: false
schema:
type: string
- name: filter[opslevel_id]
in: query
required: false
schema:
type: string
- name: filter[external_id]
in: query
required: false
schema:
type: string
- name: filter[color]
in: query
required: false
schema:
type: string
- name: filter[alert_broadcast_enabled]
```
--------------------------------
### Rootly API Get Alert Route Example (OpenAPI)
Source: https://docs.rootly.com/api-reference/alertroutes/get-an-alert-route
An OpenAPI definition snippet for the GET /v1/alert_routes/{id} endpoint, detailing its parameters, responses, and schema.
```yaml
openapi: 3.0.1
info:
title: Rootly API v1
version: v1
description: "# How to generate an API Key?\n\n - **Organization dropdown** > **Organization Settings** > **API Keys**\n\n\n # JSON:API Specification\n\n Rootly is using **JSON:API** (https://jsonapi.org) specification:\n\n - JSON:API is a specification for how a client should request that resources\n be fetched or modified, and how a server should respond to those requests.\n\n - JSON:API is designed to minimize both the number of requests and the\n amount of data transmitted between clients and servers. This efficiency is\n achieved without compromising readability, flexibility, or discoverability.\n\n - JSON:API requires use of the JSON:API media type\n (**application/vnd.api+json**) for exchanging data.\n\n\n # Authentication and Requests\n\n We use standard HTTP Authentication over HTTPS to authorize your requests.\n\n ```\n curl --request GET \n --header 'Content-Type: application/vnd.api+json' \n\n --header 'Authorization: Bearer YOUR-TOKEN' \n\n --url https://api.rootly.com/v1/incidents\n\n ```\n\n\n
\n\n\n # Rate limiting\n\n - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls\n **per API key** every **60 seconds** (0 hours). The limit is calculated over\n a **0-hour sliding window** looking back from the current time. While the\n limit can be configured to support higher thresholds, you must first contact\n your **Rootly Customer Success Manager** to make any adjustments.\n\n - There is a default limit of **3** **POST**, **PUT**, **PATCH** or\n **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit\n is calculated over a **0-hour sliding window** looking back from the current\n time. While the limit can be configured to support higher thresholds, you\n must first contact your **Rootly Customer Success Manager** to make any\n adjustments.\n\n - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{"error": "Rate limit exceeded. Try again later."}`\n\n - **X-RateLimit headers** are included in every API response, providing\n real-time rate limit information:\n - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., "1000, 1000;window=3600" for 1000 requests per hour)\n - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window\n - **X-RateLimit-Used** - The number of requests already made in the current window\n - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds\n\n # Pagination\n\n - Pagination is supported for all endpoints that return a collection of\n items.\n\n - Pagination is controlled by the **page** query parameter\n\n\n ## Example\n\n ```\n curl --request GET \n --header 'Content-Type: application/vnd.api+json' \n\n --header 'Authorization: Bearer YOUR-TOKEN' \n\n --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10\n\n ```"
x-logo:
url: https://rootly-heroku.s3.us-east-1.amazonaws.com/swagger/v1/logo.png
alt: Rootly
servers:
- url: https://api.rootly.com
security: []
paths:
/v1/alert_routes/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: string
get:
tags:
- AlertRoutes
summary: Get an alert route
description: >-
Get a specific alert route by id. **Note: This endpoint requires access
to Advanced Alert Routing. If you're unsure whether you have access to
this feature, please contact Rootly customer support.**
operationId: getAlertRoute
responses:
'200':
description: alert route found
content:
application/vnd.api+json:
example:
data:
id: 1efddff0-c73a-4d22-b11c-dcfad309757f
type: alert_routes
attributes:
name: Test Alert Route-edac
enabled: true
created_at: '2026-01-31T09:12:33.254-08:00'
updated_at: '2026-01-31T09:12:33.254-08:00'
alerts_source_ids: []
owning_team_ids: []
rules: []
schema:
$ref: '#/components/schemas/alert_route_response'
'401':
description: unauthorized
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/errors_list'
'404':
description: cross-team access denied
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/errors_list'
security: []
```
--------------------------------
### API Pagination Example (curl)
Source: https://docs.rootly.com/api-reference/alerts/acknowledges-an-alert
Illustrates how to use pagination for API endpoints that return collections of items. It shows a curl command example using the 'page' query parameter to specify the page number and size.
```bash
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10
```
--------------------------------
### API Authentication and Request Example (curl)
Source: https://docs.rootly.com/api-reference/alerts/acknowledges-an-alert
Demonstrates how to authenticate API requests using standard HTTP Authentication over HTTPS with a Bearer token. Provides a curl command example for fetching incidents.
```bash
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents
```
--------------------------------
### Rootly API v1 Authentication Example (curl)
Source: https://docs.rootly.com/api-reference/alerturgencies/delete-an-alert-urgency
Demonstrates how to authenticate with the Rootly API v1 using a Bearer token in the Authorization header. This example shows a GET request to the /v1/incidents endpoint, which is a common pattern for fetching resources.
```bash
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents
```
--------------------------------
### POST /websites/rootly/retrospective_configurations
Source: https://docs.rootly.com/api-reference/retrospectiveconfigurations/retrieves-a-retrospective-configuration
Creates a new retrospective configuration.
```APIDOC
## POST /websites/rootly/retrospective_configurations
### Description
Creates a new retrospective configuration.
### Method
POST
### Endpoint
/websites/rootly/retrospective_configurations
### Request Body
- **data** (object) - Required - The retrospective configuration data.
- **type** (string) - Required - Must be 'retrospective_configurations'.
- **attributes** (object) - Required - The attributes of the retrospective configuration.
- **kind** (string) - Required - The kind of the configuration ('skip' or 'mandatory').
- **severity_ids** (array[string]) - Optional - The Severity IDs to attach to the configuration.
- **group_ids** (array[string]) - Optional - The Team IDs to attach to the configuration.
- **incident_type_ids** (array[string]) - Optional - The Incident Type IDs to attach to the configuration.
### Request Example
```json
{
"data": {
"type": "retrospective_configurations",
"attributes": {
"kind": "mandatory",
"severity_ids": ["sev-a"],
"group_ids": ["team-y"],
"incident_type_ids": []
}
}
}
```
### Response
#### Success Response (201 Created)
- **data** (object) - The created retrospective configuration object.
- **id** (string) - Unique ID of the retrospective configuration.
- **type** (string) - Type of the resource, should be 'retrospective_configurations'.
- **attributes** (object) - Contains the attributes of the retrospective configuration.
- **kind** (string) - The kind of the configuration ('skip' or 'mandatory').
- **severity_ids** (array[string]) - The Severity IDs attached to the configuration.
- **group_ids** (array[string]) - The Team IDs attached to the configuration.
- **incident_type_ids** (array[string]) - The Incident Type IDs attached to the configuration.
- **created_at** (string) - Date of creation.
- **updated_at** (string) - Date of last update.
#### Response Example
```json
{
"data": {
"id": "config-456",
"type": "retrospective_configurations",
"attributes": {
"kind": "mandatory",
"severity_ids": ["sev-a"],
"group_ids": ["team-y"],
"incident_type_ids": [],
"created_at": "2023-10-27T11:00:00Z",
"updated_at": "2023-10-27T11:00:00Z"
}
}
}
```
#### Error Response (404)
- **errors** (array) - An array of error objects.
- **title** (string) - A short, human-readable summary of the problem.
- **status** (string) - The HTTP status code.
- **code** (string, nullable) - An application-specific error code.
- **detail** (string, nullable) - A human-readable explanation specific to this occurrence of the problem.
#### Error Response Example
```json
{
"errors": [
{
"title": "Not found or unauthorized",
"status": "404"
}
]
}
```
```
--------------------------------
### Systemd Service Control for Rootly Edge Connector
Source: https://docs.rootly.com/edge-connectors-installation
Commands to manage the rootly-edge-connector service using systemd. This includes starting, stopping, restarting, checking status, and configuring the service to start on boot.
```bash
sudo systemctl start rootly-edge-connector
sudo systemctl stop rootly-edge-connector
sudo systemctl restart rootly-edge-connector
sudo systemctl status rootly-edge-connector
sudo systemctl enable rootly-edge-connector
sudo systemctl disable rootly-edge-connector
```
--------------------------------
### Setup Python Virtual Environment and Install Dependencies
Source: https://docs.rootly.com/integrations/glean
Clones the Rootly Glean Connector repository, sets up a Python virtual environment named 'venv', activates it, and installs all required dependencies from the 'requirements.txt' file.
```bash
git clone https://github.com/rootlyhq/rootly-glean-connector.git
cd rootly-glean-connector
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```
--------------------------------
### Rootly API: Example GET Request (Shell)
Source: https://docs.rootly.com/api-reference/oncallroles/retrieves-an-on-call-role
This snippet demonstrates how to make a GET request to the Rootly API using curl. It includes essential headers for content type and authorization, and shows how to specify an ID for a resource.
```shell
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/on_call_roles/{id}
```
--------------------------------
### List Retrospective Configurations with cURL
Source: https://docs.rootly.com/api-reference/retrospectiveconfigurations/list-retrospective-configurations
Shows how to list retrospective configurations using cURL. This example specifies the Content-Type and Authorization headers, and targets the /v1/retrospective_configurations endpoint. It's useful for retrieving configuration data.
```bash
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/retrospective_configurations
```
--------------------------------
### Rootly API Pagination Example (curl)
Source: https://docs.rootly.com/api-reference/%5Bdeprecated%5D-customfieldoptions/%5Bdeprecated%5D-retrieves-a-custom-field-option
Illustrates how to use pagination parameters with the Rootly API using curl. This example shows how to request a specific page and size of incident data.
```bash
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10
```
--------------------------------
### Rootly TUI Configuration File Example
Source: https://docs.rootly.com/integrations/tui
Shows an example of the configuration file (`~/.rootly-tui/config.yaml`) used by the Rootly TUI. This file stores settings like API key, endpoint, timezone, and language.
```yaml
api_key: "your-api-key"
endpoint: "api.rootly.com"
timezone: "America/Los_Angeles"
language: "en_US"
```
--------------------------------
### Rootly API Get Communications Type Example (OpenAPI)
Source: https://docs.rootly.com/api-reference/communications-types/shows-a-communications-type
Defines the GET request for retrieving a specific communications type by its ID. It includes parameter details, response schemas for success (200) and not found (404) cases, and authentication requirements.
```yaml
openapi: 3.0.1
info:
title: Rootly API v1
version: v1
description: >+
# How to generate an API Key?
- **Organization dropdown** > **Organization Settings** > **API Keys**
# JSON:API Specification
Rootly is using **JSON:API** (https://jsonapi.org) specification:
- JSON:API is a specification for how a client should request that resources
be fetched or modified, and how a server should respond to those requests.
- JSON:API is designed to minimize both the number of requests and the
amount of data transmitted between clients and servers. This efficiency is
achieved without compromising readability, flexibility, or discoverability.
- JSON:API requires use of the JSON:API media type
(**application/vnd.api+json**) for exchanging data.
# Authentication and Requests
We use standard HTTP Authentication over HTTPS to authorize your requests.
```
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents
```
# Rate limiting
- There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls
**per API key** every **60 seconds** (0 hours). The limit is calculated over
a **0-hour sliding window** looking back from the current time. While the
limit can be configured to support higher thresholds, you must first contact
your **Rootly Customer Success Manager** to make any adjustments.
- There is a default limit of **3** **POST**, **PUT**, **PATCH** or
**DELETE** calls **per API key** every **60 seconds** (0 hours). The limit
is calculated over a **0-hour sliding window** looking back from the current
time. While the limit can be configured to support higher thresholds, you
must first contact your **Rootly Customer Success Manager** to make any
adjustments.
- When rate limits are exceeded, the API will return a **429 Too Many
Requests** HTTP status code with the response: `{"error": "Rate limit
exceeded. Try again later."}`
- **X-RateLimit headers** are included in every API response, providing
real-time rate limit information:
- **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., "1000, 1000;window=3600" for 1000 requests per hour)
- **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window
- **X-RateLimit-Used** - The number of requests already made in the current window
- **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds
# Pagination
- Pagination is supported for all endpoints that return a collection of
items.
- Pagination is controlled by the **page** query parameter
## Example
```
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10
```
x-logo:
url: https://rootly-heroku.s3.us-east-1.amazonaws.com/swagger/v1/logo.png
alt: Rootly
servers:
- url: https://api.rootly.com
security: []
paths:
/v1/communications/types/{id}:
parameters:
- name: id
in: path
description: Communications Type ID
required: true
schema:
type: string
get:
tags: []
summary: Shows a communications type
description: Shows details of a communications type
operationId: getCommunicationsType
responses:
'200':
description: communications type found
content:
application/vnd.api+json:
example:
data:
id: c18971a5-ecca-45c9-8554-af3bcb68034c
type: communications_types
attributes:
name: 33um4
slug: 33um4
description: Placeat eum eligendi corrupti.
color: '#FAEBB7'
position: 1
created_at: '2026-01-31T09:14:25.332-08:00'
updated_at: '2026-01-31T09:14:25.332-08:00'
communication_groups: []
communication_templates: []
schema:
$ref: '#/components/schemas/communications_type_response'
'404':
description: communications type not found
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/errors_list'
security:
- bearer_auth: []
components:
schemas:
communications_type_response:
type: object
properties:
data:
type: object
```
--------------------------------
### Create Service
Source: https://docs.rootly.com/api-reference/incidents/add-subscribers-to-incident
Creates a new service with initial configuration details.
```APIDOC
## POST /websites/rootly
### Description
Creates a new service.
### Method
POST
### Endpoint
/websites/rootly
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
- **name** (string) - Required - The name of the service.
- **github_repository_name** (string) - Optional - The GitHub repository name associated with this service.
- **github_repository_branch** (string) - Optional - The GitHub repository branch associated with this service.
- **gitlab_repository_name** (string) - Optional - The GitLab repository name associated with this service.
- **gitlab_repository_branch** (string) - Optional - The GitLab repository branch associated with this service.
- **kubernetes_deployment_name** (string) - Optional - The Kubernetes deployment name associated with this service.
- **environment_ids** (array[string]) - Optional - Environments associated with this service.
- **service_ids** (array[string]) - Optional - Services dependent on this service.
- **owner_group_ids** (array[string]) - Optional - Owner Teams associated with this service.
- **owner_user_ids** (array[integer]) - Optional - Owner Users associated with this service.
- **alert_urgency_id** (string) - Optional - The alert urgency ID of the service.
- **escalation_policy_id** (string) - Optional - The escalation policy ID of the service.
- **alerts_email_enabled** (boolean) - Optional - Enable alerts through email.
- **alerts_email_address** (string) - Optional - Email generated to send alerts to.
- **slack_channels** (array[object]) - Optional - Slack Channels associated with this service. Each object should contain 'id' (string) and 'name' (string).
- **slack_aliases** (array[object]) - Optional - Slack Aliases associated with this service. Each object should contain 'id' (string) and 'name' (string).
- **alert_broadcast_enabled** (boolean) - Optional - Enable alerts to be broadcasted to a specific channel.
- **alert_broadcast_channel** (object) - Optional - Slack channel to broadcast alerts to. Should contain 'id' (string) and 'name' (string).
- **incident_broadcast_enabled** (boolean) - Optional - Enable incidents to be broadcasted to a specific channel.
- **incident_broadcast_channel** (object) - Optional - Slack channel to broadcast incidents to. Should contain 'id' (string) and 'name' (string).
### Request Example
```json
{
"name": "new-service",
"github_repository_name": "rootlyhq/new-service",
"github_repository_branch": "main",
"environment_ids": ["env-abc"]
}
```
### Response
#### Success Response (201)
- **id** (string) - The unique identifier of the newly created service.
- **name** (string) - The name of the service.
- **created_at** (string) - Date of creation.
- **updated_at** (string) - Date of last update.
#### Response Example
```json
{
"id": "svc-12345",
"name": "new-service",
"created_at": "2023-10-27T11:00:00Z",
"updated_at": "2023-10-27T11:00:00Z"
}
```
```
--------------------------------
### API Pagination Example (Markdown)
Source: https://docs.rootly.com/api-reference/playbooks/delete-a-playbook
This section explains how to use pagination for API endpoints that return collections of items. It specifies that pagination is controlled by the 'page' query parameter and provides a cURL example demonstrating its usage with 'page[number]' and 'page[size]'.
```markdown
# Pagination
- Pagination is supported for all endpoints that return a collection of
items.
- Pagination is controlled by the **page** query parameter
## Example
```
curl --request GET \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10
```
```