---
title: "Creates a Draft for this resource"
method: POST
path: "/api/v1/plugins/{id}/files/{fileId}/draft"
tags: ["Plugins"]
---

# Creates a Draft for this resource

`POST /api/v1/plugins/{id}/files/{fileId}/draft`

## Path parameters

- `id` integer, required
- `fileId` integer, required

## Headers

- `X-Fields` string, mask

## Request body

- CreateNestedDraftPluginFileLoad
  - `filename` string, required — Name of the PluginFile resource.
  - `contents` string, required — Contents of the file.
  - `tasks` PluginTaskContainer
    - `functions` FunctionTaskDump[]
      - `id` integer — Id of the PluginTask.
      - `name` string, required — Name of the PluginTask.
      - `inputParams` PluginTaskInputParameterDump[]
        - `name` string, required — Name of the PluginTaskParameter.
        - `parameterType` PluginParameterTypeRef
          - `id` integer — ID for the PluginParameterType resource.
          - `group` GroupRef
            - `id` integer — ID for the Group resource.
            - `name` string — Name of the Group resource.
            - `url` string — URL for accessing the full Group resource.
          - `url` string — URL for accessing the full PluginParameterType resource.
          - `name` string — Name of the PluginParameterType resource.
        - `required` boolean — Sets whether the input parameter is required (True) or optional (False). If True, then this parameter must be assigned a value in order to execute the PluginTask.
      - `outputParams` PluginTaskOutputParameterDump[]
        - `name` string, required — Name of the PluginTaskParameter.
        - `parameterType` PluginParameterTypeRef
          - `id` integer — ID for the PluginParameterType resource.
          - `group` GroupRef
            - `id` integer — ID for the Group resource.
            - `name` string — Name of the Group resource.
            - `url` string — URL for accessing the full Group resource.
          - `url` string — URL for accessing the full PluginParameterType resource.
          - `name` string — Name of the PluginParameterType resource.
    - `artifacts` ArtifactTaskDump[]
      - `id` integer — Id of the PluginTask.
      - `name` string, required — Name of the PluginTask.
      - `outputParams` PluginTaskOutputParameterDump[]
        - `name` string, required — Name of the PluginTaskParameter.
        - `parameterType` PluginParameterTypeRef
          - `id` integer — ID for the PluginParameterType resource.
          - `group` GroupRef
            - `id` integer — ID for the Group resource.
            - `name` string — Name of the Group resource.
            - `url` string — URL for accessing the full Group resource.
          - `url` string — URL for accessing the full PluginParameterType resource.
          - `name` string — Name of the PluginParameterType resource.
  - `description` string — Description of the PluginFile resource.

## Response `200`

Success

- DraftDump
  - `id` integer — ID of the Draft.
  - `group` GroupRef
    - `id` integer — ID for the Group resource.
    - `name` string — Name of the Group resource.
    - `url` string — URL for accessing the full Group resource.
  - `user` UserRefDump
    - `id` integer — ID for the User resource.
    - `username` string — Username of the User resource.
    - `url` string — URL for accessing the full User resource.
  - `payload` object — The contents of the draft resource.
  - `createdOn` string, date-time — Timestamp when the draft resource was created.
  - `lastModifiedOn` string, date-time — Timestamp when the draft resource was last modified.
  - `resourceType` string — The type of resource of this draft.
  - `resource` integer — ID of the resource this draft modifies.
  - `resourceSnapshot` integer — ID of the resource snapshot this draft modifies.
  - `metadata` object — Additional metadata about the draft

---

[API](https://skmtc.net/usnistgov/apis/dioptra-rest-api.md) · [All operations](https://skmtc.net/usnistgov/apis/dioptra-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/usnistgov/dioptra-rest-api/versions/a73101579c5c/schema)
