> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/infrastructure-as-code-management/iacm-api-reference/workspaces/list-workspaces-associated-with-a-template-id.md).

# List workspaces associated with a template ID

Get all workspaces associated with a specific template ID

```json
{"openapi":"3.0.3","info":{"title":"Infrastructure as Code Management","version":"0.1.0"},"tags":[{"name":"workspaces","description":"Workspaces Service handles the API for managing workspaces\nand triggering workflows against them."}],"servers":[{"url":"http://localhost:80"}],"paths":{"/api/workspace/templates/{template_id}":{"get":{"tags":["workspaces"],"summary":"List workspaces associated with a template ID","description":"Get all workspaces associated with a specific template ID","operationId":"workspaces#list-associated-workspaces","parameters":[{"name":"org","in":"query","description":"Organization identifier (required for 'org' and 'project' scope).","allowEmptyValue":true,"schema":{"type":"string","description":"Organization identifier (required for 'org' and 'project' scope).","minLength":1,"maxLength":128}},{"name":"project","in":"query","description":"Project identifier (required for 'project' scope).","allowEmptyValue":true,"schema":{"type":"string","description":"Project identifier (required for 'project' scope).","minLength":1,"maxLength":128}},{"name":"version","in":"query","description":"Template version associated with the workspace.","allowEmptyValue":true,"schema":{"type":"string","description":"Template version associated with the workspace.","minLength":1,"maxLength":32}},{"name":"template_id","in":"path","description":"Template identifier to filter workspaces","required":true,"schema":{"type":"string","description":"Template identifier to filter workspaces","minLength":1,"maxLength":128}},{"name":"Harness-Account","in":"header","description":"Account identifier.","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Account identifier.","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/HarnessIacmWorkspaceTemplate"},"description":"List of workspaces associated with the template ID"}}}},"400":{"description":"BadRequestError: Bad Request response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UnauthorizedError: Unauthorized response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"ForbiddenError: Forbidden response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NotFoundError: Not Found response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"408":{"description":"TimeoutError: Request Timeout response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ConflictError: Conflict response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"description":"LockedError: Locked response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"499":{"description":"ContextCancelledError:  response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"BadGatewayError: Bad Gateway response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"HarnessIacmWorkspaceTemplate":{"type":"object","properties":{"account":{"type":"string","description":"Account identifier.","minLength":1,"maxLength":128},"created_at":{"type":"integer","description":"Timestamp when the workspace-template association was created.","format":"int64"},"org":{"type":"string","description":"Organization identifier.","minLength":1,"maxLength":128},"project":{"type":"string","description":"Project identifier.","minLength":1,"maxLength":128},"template_id":{"type":"string","description":"Template identifier.","minLength":1,"maxLength":128},"updated_at":{"type":"integer","description":"Timestamp when the workspace-template association was last updated.","format":"int64"},"version":{"type":"string","description":"Template version associated with the workspace.","minLength":1,"maxLength":32},"workspace_id":{"type":"string","description":"Workspace identifier.","minLength":1,"maxLength":128}},"description":"WorkspaceTemplateResource is the representation for a workspace-template association.","required":["workspace_id","template_id","created_at","updated_at","account","project","org"]},"Error":{"type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?"},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem."},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem."},"name":{"type":"string","description":"Name is the name of this class of errors."},"temporary":{"type":"boolean","description":"Is the error temporary?"},"timeout":{"type":"boolean","description":"Is the error a timeout?"}},"required":["name","id","message","temporary","timeout","fault"]}}}}
```
