# Get step template details

Source: https://www.jawsdeploy.net/rest-api/step-templates-details | Section: Step Templates

Retrieve one complete step template by ID or name.

`GET /api/step-template/details`

Returns the complete definition of one step template in the requested workspace, including the script body and the JSON-encoded property schema used when adding the template to a project.

Provide exactly one lookup value: `stepTemplateId`, or `name`. Use the ID when names are duplicated. Names containing spaces or punctuation must be URL encoded.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `workspaceId` | query | string | yes | ID of the workspace that owns the template. |
| `stepTemplateId` | query | string | no | Step template ID from [List step templates](https://www.jawsdeploy.net/rest-api/step-templates-list). Required when `name` is omitted. |
| `name` | query | string | no | Exact step template name. Required when `stepTemplateId` is omitted; URL encode the value. |

### What comes back in propertiesRaw

`propertiesRaw` is the stored schema rather than the text that was sent to [Create a step template](https://www.jawsdeploy.net/rest-api/step-templates-create). It is normalised on save, so every member of a property is present here, including the ones left unset, and any member that is not part of the schema is gone. A template that was written with a `DefaultValue` field comes back without it.

The typed fields carry each property's starting value - `ValueText`, `ValueBoolean`, `ValueNumber` or `ValueObject`, depending on the control type. A step added from the template starts from those.

## Errors

| Status | Meaning |
|---|---|
| 400 | Invalid `workspaceId`; neither or both lookup values were supplied; or the template was not found. |
| 401 | Missing or invalid Basic auth credentials, or the service account cannot manage step templates in this workspace. |
| 409 | The supplied name is not unique in the workspace. Retry with `stepTemplateId`. |

Example request:

```
GET /api/step-template/details?workspaceId=ws_abc&stepTemplateId=st_2 HTTP/1.1
Authorization: Basic <base64(serviceAccountId:apiKey)>

# Or look up by an URL-encoded name:
GET /api/step-template/details?workspaceId=ws_abc&name=Restart%20Windows%20service HTTP/1.1
Authorization: Basic <base64(serviceAccountId:apiKey)>
```

Example response:

```
{
  "stepTemplateId": "st_2",
  "workspaceId": "ws_abc",
  "name": "Restart Windows service",
  "description": "Stops and restarts a Windows service.",
  "version": 3,
  "scriptLanguage": "powershell",
  "supportedRunModes": ["TargetMachine"],
  "script": "Restart-Service $ServiceName",
  "propertiesRaw": "[{\"Id\":\"ServiceName\",\"Name\":\"Service name\",\"Description\":null,\"ControlType\":\"SingleLineText\",\"ControlTypeOptions\":null,\"ControlValues\":null,\"DependsOn\":null,\"IsBound\":false,\"ValueObject\":null,\"ValueText\":\"Spooler\",\"ValueNumber\":0.0,\"ValueBoolean\":false,\"Properties\":[]}]"
}
```

