# Workspace Templates

You can duplicate a workspace template within a project with the `POST /workspace-templates/{companyTemplateId}/use` endpoint.

This call is **asynchronous**, meaning the response will only include a "**`duplication_request_id`**". You can use this ID to track the duplication process with the `GET /design-duplication-requests/{duplicateRequestId` polling endpoint.

## Duplicate Workspace Template

> Duplicate a workspace template into a project. This operation is asynchronous.\
> Use the returned \`duplication\_request\_id\` to track the duplication progress\
> with the polling endpoint.<br>

```json
{"openapi":"3.0.3","info":{"title":"API Reference - Abyssale","version":"0.0.1"},"tags":[{"name":"Workspace Templates","description":"Workspace templates are shared templates that can be duplicated into your projects.\nThe duplication process is asynchronous and allows you to copy workspace templates into your projects for customization.\n"}],"servers":[{"url":"https://api.abyssale.com","description":"Main Production Server"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"description":"All of your Abyssale requests must contain a `x-api-key header` with your API Key.","type":"apiKey","name":"x-api-key","in":"header"}},"schemas":{"DuplicationRequest":{"type":"object","properties":{"duplication_request_id":{"type":"string","format":"uuid","description":"Unique identifier for tracking the duplication process"}},"required":["duplication_request_id"]}}},"paths":{"/workspace-templates/{companyTemplateId}/use":{"post":{"summary":"Duplicate Workspace Template","description":"Duplicate a workspace template into a project. This operation is asynchronous.\nUse the returned `duplication_request_id` to track the duplication progress\nwith the polling endpoint.\n","tags":["Workspace Templates"],"parameters":[{"in":"path","name":"companyTemplateId","schema":{"type":"string","format":"uuid"},"required":true,"description":"Unique identifier (UUID) of the workspace template to duplicate"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_id":{"type":"string","format":"uuid","description":"Target project ID where the template will be duplicated"},"name":{"type":"string","description":"Optional custom name for the duplicated template","maxLength":100,"minLength":2}},"required":["project_id"]}}}},"responses":{"200":{"description":"Duplication request accepted and processing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicationRequest"}}}},"404":{"description":"Workspace template Or Project not found"}}}}}}
```

### Duplication Request Polling - Propress check endpoint

You can poll the following endpoint to retrieve the progress status of a duplication request.&#x20;

{% hint style="info" %}
This endpoint remains available for up to 7 days after the duplication request is created.
{% endhint %}

## Get Duplication Request Status

> Poll the status of a template duplication request. Use this endpoint to track\
> the progress of an asynchronous duplication operation.<br>

```json
{"openapi":"3.0.3","info":{"title":"API Reference - Abyssale","version":"0.0.1"},"tags":[{"name":"Workspace Templates","description":"Workspace templates are shared templates that can be duplicated into your projects.\nThe duplication process is asynchronous and allows you to copy workspace templates into your projects for customization.\n"}],"servers":[{"url":"https://api.abyssale.com","description":"Main Production Server"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"description":"All of your Abyssale requests must contain a `x-api-key header` with your API Key.","type":"apiKey","name":"x-api-key","in":"header"}},"schemas":{"DuplicationRequestStatus":{"type":"object","properties":{"request_id":{"type":"string","format":"uuid","description":"Unique identifier of the duplication request"},"status":{"type":"string","enum":["INIT","IN_PROGRESS","ERROR","COMPLETED"],"description":"Current status of the duplication request"},"created_at_ts":{"type":"integer","description":"Unix timestamp when the duplication request was created"},"completed_at_ts":{"type":"integer","nullable":true,"description":"Unix timestamp when the duplication was completed (null if not completed)"},"errored_at_ts":{"type":"integer","nullable":true,"description":"Unix timestamp when the duplication failed (null if not failed)"},"target_project":{"$ref":"#/components/schemas/ProjectSummary"},"designs":{"type":"array","items":{"$ref":"#/components/schemas/DuplicatedDesign"},"description":"List of duplicated designs (empty if not completed)"}},"required":["request_id","status","created_at_ts","target_project","designs"]},"ProjectSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the project"},"name":{"type":"string","description":"Name of the project"},"created_at_ts":{"type":"integer","description":"Unix timestamp when the project was created"}},"required":["id","name","created_at_ts"]},"DuplicatedDesign":{"type":"object","properties":{"original_design_id":{"type":"string","format":"uuid","description":"ID of the original workspace template"},"target_design_id":{"type":"string","format":"uuid","description":"ID of the newly created template in your project"},"target_design_name":{"type":"string","description":"Name of the duplicated template"}},"required":["original_design_id","target_design_id","target_design_name"]}}},"paths":{"/design-duplication-requests/{duplicateRequestId}":{"get":{"summary":"Get Duplication Request Status","description":"Poll the status of a template duplication request. Use this endpoint to track\nthe progress of an asynchronous duplication operation.\n","tags":["Workspace Templates"],"parameters":[{"in":"path","name":"duplicateRequestId","schema":{"type":"string","format":"uuid"},"required":true,"description":"Unique identifier (UUID) of the duplication request"}],"responses":{"200":{"description":"Duplication request status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicationRequestStatus"}}}},"404":{"description":"Duplication request not found"}}}}}}
```
