# Get deployed service version

Source: https://govform.com/resources/documentation/article/33-05-api-get-deployed-service-version
Topic: Govform API & MCP

**API units: 1.** Each deployed-version status request uses 1 unit.

This endpoint gets the version and timestamp of the last deployment of a service to an environment.

## Endpoint and parameters

```
GET /api/service-deployments/{libraryId}/{serviceId}
```

| Parameter | Description | Mandatory |
| --- | --- | --- |
| **libraryId** | The ID of the library of the service to deploy | yes |
| **serviceId** | The service ID of the service to deploy | yes |

### Query parameters

No query parameters.

**Authentication:** send `GovformsApiKey <key-id>:<key-secret>` in the `Authorization` header. Substitute credentials from your secrets manager; never copy a live key into documentation, source control or logs.

## Examples

Request Headers

| Header name | value |
| --- | --- |
| Authorization | GovformsApiKey <key-id>:<key-secret> |

**Retrieve deployed service version in QA**

Request URL

```
GET https://qa.cloud.govforms.uk/api/service-deployments/demo-library/demo-service-1
```

Request body This endpoint does not expect a request body.   Response Headers

| Header name | value |
| --- | --- |
| Content-Type | application/json |

Response body 200 OK

```
{
  "isDeployed": true,
  "serviceVersion": 125,
  "versionTimestamp": "2023-03-14T10:51:44.288+00:00",
  "lastDeploymentTimestamp": "2023-03-15T15:22:13.552+00:00"
}
```

**Determine service not deployed in Production**

Request URL

```
GET https://cloud.govforms.uk/api/service-deployments/demo-library/demo-service-1
```

Request body This endpoint does not expect a request body.   Response Headers

| Header name | value |
| --- | --- |
| Content-Type | application/json |

Response body 200 OK

```
{
  "isDeployed": false
}
```

* * *

## Discover Service IDs and compare with Builder

This endpoint requires the `getDeployedServiceVersion` API-key permission. To discover IDs first, use the [Builder service directory](<https://govform.com/resources/documentation/article/33-09-api-list-services-and-form-schemas>). Pass the Service ID without its library prefix to this QA or Production endpoint.

A current Builder definition may contain changes beyond the deployed version. Builder deployment history lists recent recorded releases and withdrawals; this endpoint checks what is currently deployed in the environment you call.
