---
title: Version
summary: >-
  A Version represents a specific instance of the configuration for a service. A
  Version can be cloned, locked, activated, or deactivated.
url: https://www.fastly.com/documentation/reference/api/services/version
---

A Version represents a specific instance of the configuration for a service. A Version can be cloned, locked, activated, or deactivated.

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `active` | boolean | Whether this is the active version or not. |
| `comment` | string | A freeform descriptive note. |
| `deployed` | boolean | Unused at this time. |
| `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) |
| `staging` | boolean | Unused at this time. |
| `testing` | boolean | Unused at this time. |
| `service_id` | string | Alphanumeric string identifying the service. (Read-only) |
| `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. |
| `updated_at` | string | Date and time in ISO 8601 format. (Read-only) |

## API endpoints

### List versions of a service

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

List the versions for a particular service.

**Parameters:**

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

### Create a service version

**POST** `/service/{service_id}/version`

Create a version for a particular service.

**Parameters:**

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

### Get a version of a service

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

Get the version for a particular service.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Update a service version

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

Update a particular version for a particular service.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Validate a service version

**GET** `/service/{service_id}/version/{version_id}/validate`

Validate the version for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Activate a service version

**PUT** `/service/{service_id}/version/{version_id}/activate`

Activate the current version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Activate a service version on the specified environment

**PUT** `/service/{service_id}/version/{version_id}/activate/{environment_name}`

Activate a version on a given environment, i.e. "staging".

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `environment_name` | string | path | Yes |  |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Deactivate a service version

**PUT** `/service/{service_id}/version/{version_id}/deactivate`

Deactivate the current version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Deactivate a service version on an environment

**PUT** `/service/{service_id}/version/{version_id}/deactivate/{environment_name}`

Deactivate the current version on a given environment, i.e. "staging".

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `environment_name` | string | path | Yes |  |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Clone a service version

**PUT** `/service/{service_id}/version/{version_id}/clone`

Clone the current configuration into a new version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Lock a service version

**PUT** `/service/{service_id}/version/{version_id}/lock`

Locks the specified version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |
