---
title: Service
summary: >-
  A Service represents the configuration for a website, app, API, or anything
  else to be served through Fastly. A Service can have many Versions, through
  which Backends, Domains, and more can be configured.
url: https://www.fastly.com/documentation/reference/api/services/service
---

A Service represents the configuration for a website, app, API, or anything else to be served through Fastly. A Service can have many Versions, through which Backends, Domains, and more can be configured.

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `comment` | string | A freeform descriptive note. |
| `customer_id` | string | Alphanumeric string identifying the customer. |
| `name` | string | The name of the service. |
| `type` | string | The type of this service. |
| `active_version` | object |  |
| `created_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `deleted_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `environments` | array | A list of environments where the service has been deployed. |
| `id` | string | Alphanumeric string identifying the service. (Read-only) |
| `paused` | boolean | Whether the service is paused. Services are paused due to a lack of traffic for an extended period of time. Services are resumed either when a draft version is activated or a locked version is cloned and reactivated. |
| `publish_key` | string | Unused at this time. |
| `updated_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `version` | object |  |
| `versions` | array | A list of <a href="https://www.fastly.com/documentation/reference/api/services/version/">versions</a> associated with the service. |
| `active` | boolean | Whether this is the active version or not. |
| `backends` | array | List of backends associated to this service. |
| `cache_settings` | array | List of cache settings associated to this service. |
| `conditions` | array | List of conditions associated to this service. |
| `deployed` | boolean | Unused at this time. |
| `directors` | array | List of directors associated to this service. |
| `domains` | array | List of domains associated to this service. |
| `gzips` | array | List of gzip rules associated to this service. |
| `headers` | array | List of headers associated to this service. |
| `healthchecks` | array | List of healthchecks associated to this service. |
| `locked` | boolean | Whether this version is locked or not. Objects can not be added or edited on locked versions. |
| `number` | integer | The number of this version. (Read-only) |
| `request_settings` | array | List of request settings for this service. |
| `response_objects` | array | List of response objects for this service. |
| `service_id` | string | Alphanumeric string identifying the service. (Read-only) |
| `settings` | object | List of default settings for this service. |
| `snippets` | array | List of VCL snippets for this service. |
| `staging` | boolean | Unused at this time. |
| `testing` | boolean | Unused at this time. |
| `vcls` | array | List of VCL files for this service. |
| `wordpress` | array | A list of Wordpress rules with this service. |

## API endpoints

### List services

**GET** `/service`

List services.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `direction` | string | query | No | Direction in which to sort results. |
| `page` | integer | query | No | Current page. |
| `per_page` | integer | query | No | Number of records per page. |
| `sort` | string | query | No | Field on which to sort. |

### Create a service

**POST** `/service`

Create a service.

### Get service details

**GET** `/service/{service_id}/details`

List detailed information on a specified service.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `filter[versions.active]` | boolean | query | No | Limits the versions array to the active versions. Accepts <code>true</code> or <code>false</code> (defaults to false). |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version` | integer | query | No | Number identifying a version of the service. |

### Search for a service by name

**GET** `/service/search`

Get a specific service by name.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `name` | string | query | Yes | The name of the service. |

### Get a service

**GET** `/service/{service_id}`

Get a specific service by id.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |

### Update a service

**PUT** `/service/{service_id}`

Update a service.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |

### Delete a service

**DELETE** `/service/{service_id}`

Delete a service.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |

### List the domains within a service

**GET** `/service/{service_id}/domain`

List the domains within a service.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
