# \DraftApi
All URIs are relative to */api*
[**get_draft_for_user**](DraftApi.md#get_draft_for_user) | **GET** /w/{workspace}/drafts/get/{kind}/{path} | fetch a single draft's content by workspace username (or the legacy workspace-level row)
[**get_own_draft**](DraftApi.md#get_own_draft) | **GET** /w/{workspace}/drafts/get_own/{kind}/{path} | fetch the current user's own draft content at a path (any kind)
[**list_drafts**](DraftApi.md#list_drafts) | **GET** /w/{workspace}/drafts/list | list every draft the current user has in this workspace, across all kinds
[**migrate_legacy_draft**](DraftApi.md#migrate_legacy_draft) | **POST** /w/{workspace}/drafts/migrate_legacy/{kind}/{path} | resolve a legacy (workspace-level) draft (admin only)
[**move_draft**](DraftApi.md#move_draft) | **POST** /w/{workspace}/drafts/move/{kind}/{path} | move the current user's draft-only item to another path
[**update_draft**](DraftApi.md#update_draft) | **POST** /w/{workspace}/drafts/update/{kind}/{path} | upsert (or clear) the current user's draft at a path
## get_draft_for_user
> models::GetDraftForUser200Response get_draft_for_user(workspace, kind, path, username)
fetch a single draft's content by workspace username (or the legacy workspace-level row)
### Parameters
**workspace** | **String** | | [required] |
**kind** | [**UserDraftItemKind**](.md) | | [required] |
**path** | **String** | | [required] |
**username** | Option<**String**> | Workspace username of the draft owner. Omit to fetch the legacy workspace-level (NULL email) row. | |
### Return type
[**models::GetDraftForUser200Response**](getDraftForUser_200_response.md)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_own_draft
> models::GetOwnDraft200Response get_own_draft(workspace, kind, path)
fetch the current user's own draft content at a path (any kind)
### Parameters
**workspace** | **String** | | [required] |
**kind** | [**UserDraftItemKind**](.md) | | [required] |
**path** | **String** | | [required] |
### Return type
[**models::GetOwnDraft200Response**](getOwnDraft_200_response.md)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## list_drafts
> Vec<models::ListDrafts200ResponseInner> list_drafts(workspace, all_users, compare_to_workspace)
list every draft the current user has in this workspace, across all kinds
### Parameters
**workspace** | **String** | | [required] |
**all_users** | Option<**bool**> | List every draft in the workspace (all users), not just the current user's own + legacy rows. Other users' rows come back with `mine=false` (view-only). | |
**compare_to_workspace** | Option<**String**> | A fork passes its parent workspace id here to have each row flagged with `unchanged_from_parent`. Ignored unless it is exactly this workspace's parent. | |
### Return type
[**Vec<models::ListDrafts200ResponseInner>**](listDrafts_200_response_inner.md)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## migrate_legacy_draft
> String migrate_legacy_draft(workspace, kind, path, migrate_legacy_draft_request)
resolve a legacy (workspace-level) draft (admin only)
Delete a legacy draft (email NULL) or assign it to the authed admin as a per-user draft. Workspace admins / superadmins only.
### Parameters
**workspace** | **String** | | [required] |
**kind** | [**UserDraftItemKind**](.md) | | [required] |
**path** | **String** | | [required] |
**migrate_legacy_draft_request** | [**MigrateLegacyDraftRequest**](MigrateLegacyDraftRequest.md) | | [required] |
### Return type
**String**
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: text/plain
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## move_draft
> String move_draft(workspace, kind, path, move_draft_request)
move the current user's draft-only item to another path
Relocates the authed user's own draft row, along with both path keys inside its value (the typed path and the mirror the editors keep beside it). Only for draft-only items — a deployed item must be moved through its own deploy endpoint, which carries every draft with it. Restricted to script, flow, app and raw_app; any other kind is rejected with 400, because only these keep their deploy target where this endpoint rewrites it.
### Parameters
**workspace** | **String** | | [required] |
**kind** | **String** | script, flow, app or raw_app only. | [required] |
**path** | **String** | | [required] |
**move_draft_request** | [**MoveDraftRequest**](MoveDraftRequest.md) | | [required] |
### Return type
**String**
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: text/plain
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## update_draft
> models::UpdateDraft200Response update_draft(workspace, kind, path, update_draft_request)
upsert (or clear) the current user's draft at a path
### Parameters
**workspace** | **String** | | [required] |
**kind** | [**UserDraftItemKind**](.md) | | [required] |
**path** | **String** | | [required] |
**update_draft_request** | [**UpdateDraftRequest**](UpdateDraftRequest.md) | | [required] |
### Return type
[**models::UpdateDraft200Response**](updateDraft_200_response.md)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)