> You are reading the Docusign Developer Documentation. For clean Markdown of any page, append .md to the page URL.
>
> Documentation indexes by section:
> - APIs and SDKs: https://docusign.docs.buildwithfern.com/docs/llms.txt
> - Platform 101: https://docusign.docs.buildwithfern.com/platform/llms.txt
> - Extension Apps: https://docusign.docs.buildwithfern.com/extension-apps/llms.txt
> - Docusign CLI: https://docusign.docs.buildwithfern.com/docusign-cli/llms.txt
>
> Authentication (OAuth, JWT Grant, M2M): https://docusign.docs.buildwithfern.com/platform/auth
> Webhooks and Connect: https://docusign.docs.buildwithfern.com/platform/webhooks
>
> OpenAPI specifications: https://docusign.docs.buildwithfern.com/openapi.json
> MCP server: https://docusign.docs.buildwithfern.com/_mcp/server

# How to create a workspace upload request

> See how to create a workspace upload request using API calls.

This topic demonstrates how to create a workspace upload request. Each workspace upload request represents a task in a workspace that is assigned to specific participants, such as asking a wealth management client to upload proof of income like a pay stub or tax document.

> **Note**
>
> Run this code example from our [Quickstart](/docs/esign-rest-api/quickstart) or launcher projects: [Bash](https://github.com/docusign/code-examples-bash), [C#](https://github.com/docusign/code-examples-csharp), [Java](https://github.com/docusign/code-examples-java), [Node.js](https://github.com/docusign/code-examples-node), [PowerShell](https://github.com/docusign/code-examples-powershell).

## Required data

Running the code in this how-to requires this data:

| Data element            | Description                                                                                                                                                                                                                                                                                                            |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \{API_ACCOUNT_ID}       | A [GUID](http://guid.one/) value that identifies your account. This value is automatically generated by Docusign for any account you create. Copy the value from the **API Account ID** field on the [Apps and Keys](https://admindemo.docusign.com/authenticate?goTo=appsAndKeys) page.                               |
| \{WORKSPACES_BASE_PATH} | A string value that forms the root of the URL required to make API calls. The base path value in the example code is set to target the developer environment at `https://<domain>` Where `<domain>` is `https://api-d.docusign.com/v1` for the developer environment and `https://api.docusign.com/v1` for production. |
| \{PARTICIPANT_EMAIL}    | The email address for the workspace participant to whom the upload request will be assigned.                                                                                                                                                                                                                           |
| \{DUE_DATE}             | The due date of the upload request.                                                                                                                                                                                                                                                                                    |
| \{WORKSPACE_ID}         | The ID of the workspace within which the upload request will be created. Run the [How to create a workspace](/docs/workspaces-api/how-to/create-workspace) code example before doing this walkthrough to ensure that this value is available.                                                                          |
| \{WORKSPACE_CREATOR_ID} | The GUID ID of the user who created the workspace. Run the [How to create a workspace](/docs/workspaces-api/how-to/create-workspace) code example before doing this walkthrough to ensure that this value is available.                                                                                                |

## Step 1. Obtain your OAuth token

To make the API call shown in this how-to, you need a valid OAuth access token. Docusign supports access tokens for three different recommended OAuth grant types: Public Authorization Code Grant, Confidential Authorization Code Grant, and JSON Web Token (JWT) Grant. Choose the OAuth grant type appropriate for your scenario.

Wondering which grant type suits your integration? See [Authenticate](/platform/auth) for guidance on your options to get an OAuth token.

Workspaces OAuth access tokens are the same ones used for our eSignature REST API, although you must request the `signature` scope and one or more Workspaces scopes to call the Workspaces API.

> **Note**
>
> See [Workspaces authentication](/docs/workspaces-api/auth) for details and the full list of Workspaces scopes.

![Three icons that represent the three methods a user can use to obtain an OAuth token: JSON Web Token (JWT), Public Authorization Code Grant (ACG), and Confidential Authorization Code grant](/_fern-files/_img/64f473773042ee439449a096bf7673292b1585b86a4ccc55f82ba0dda41f61a1.webp)

## Step 2. Construct your API headers

After you have a valid OAuth access token, you are ready to construct the API headers that you will pass to the API call. Construct your headers like this, but make sure to substitute your valid OAuth access token for \{ACCESS_TOKEN}.

**`Bash`**

```bash title="Bash"
declare -a Headers=('--header' "Authorization: Bearer ${ACCESS_TOKEN}" \
    '--header' "Accept: application/json" \
    '--header' "Content-Type: application/json")
```

**`C#`**

```csharp title="C#"
var client = CreateAuthenticatedClient(accessToken);
var dueDate = DateTime.Now.AddDays(7);
```

**`Java`**

```java title="Java"
private static IamClient createIamClient(String accessToken) {
    return IamClient.builder().accessToken(accessToken).build();
}
```

**`Node.js`**

```javascript title="Node.js"
const client = new iam.IamClient({ accessToken: args.accessToken });
```

**`PowerShell`**

```text title="PowerShell"
$headers = @{
    'Authorization' = "Bearer $accessToken";
    'Accept'        = 'application/json';
    'Content-Type'  = 'application/json';
}
```

## Step 3. Construct the request body

Next, create the request body. An upload request requires a name, description, due date, and assignments. The following example shows a request body with all required fields. Make sure to substitute your due date for \{DUE_DATE}, your email for \{SIGNER_EMAIL}, and your workspace creator ID for \{WORKSPACE_CREATOR_ID}.

**`Bash`**

```bash title="Bash"
printf \
'{
    "name": "Upload Request example '"${DUE_DATE}"'",
    "description": "This is an example upload request created via the workspaces API",
    "due_date": "'"${DUE_DATE}"'",
    "assignments": [
        {
            "upload_request_responsibility_type_id": "assignee",
            "first_name": "Test",
            "last_name": "User",
            "email": "'"${SIGNER_EMAIL}"'"
        },
        {
            "assignee_user_id": "'"${workspace_creator_id}"'",
            "upload_request_responsibility_type_id": "watcher"
        }
    ],
    "status": "draft"
}' >> $request_data
```

**`C#`**

```csharp title="C#"
var createUploadRequest = new CreateWorkspaceUploadRequestBody()
{
    Name = $"Upload Request example {dueDate}",
    Description = "This is an example upload request created via the workspaces API",
    DueDate = dueDate,
    Assignments = new List<CreateWorkspaceUploadRequestAssignment>
    {
        new CreateWorkspaceUploadRequestAssignment
        {
            Email = assigneeEmail,
            UploadRequestResponsibilityTypeId = WorkspaceUploadRequestResponsibilityType.Assignee,
            FirstName = "Test",
            LastName = "User",
        },
        new CreateWorkspaceUploadRequestAssignment
        {
            AssigneeUserId = creatorId,
            UploadRequestResponsibilityTypeId = WorkspaceUploadRequestResponsibilityType.Watcher,
        },
    },
    Status = WorkspaceUploadRequestStatus.Draft,
};
```

**`Java`**

```java title="Java"
OffsetDateTime dueDate = OffsetDateTime.now().plusDays(7);

var assignmentFoAssignee = new CreateWorkspaceUploadRequestAssignment(
        WorkspaceUploadRequestResponsibilityType.ASSIGNEE)
        .withFirstName("Test")
        .withLastName("User")
        .withEmail(assigneeEmail);
var assignmentForCreator = new CreateWorkspaceUploadRequestAssignment(
        WorkspaceUploadRequestResponsibilityType.WATCHER)
        .withAssigneeUserId(creatorId);
var assignments = Arrays.asList(
        assignmentFoAssignee,
        assignmentForCreator);

var createWorkspaceUploadRequestBody = new CreateWorkspaceUploadRequestBody(dueDate,
        WorkspaceUploadRequestStatus.DRAFT)
        .withName("Upload Request example " + dueDate)
        .withDescription("This is an example upload request created via the workspaces API")
        .withAssignments(assignments);
```

**`Node.js`**

```javascript title="Node.js"
// create assignments
const assigneeAssignment = {
  uploadRequestResponsibilityTypeId: 'assignee',
  firstName: 'Test',
  lastName: 'User',
  email: args.assigneeEmail,
};
const watcherAssignments = {
  assigneeUserId: args.workspaceCreatorId,
  uploadRequestResponsibilityTypeId: 'watcher'
};

// create upload request
const createWorkspaceUploadRequestBody = {
  name: `Upload Request example ${dueDate}`,
  description: 'This is an example upload request created via the workspaces API',
  dueDate: dueDate,
  status: 'draft',
  assignments: [assigneeAssignment, watcherAssignments],
};
```

**`PowerShell`**

```text title="PowerShell"
$body = @{
    name        = "Upload Request example $dueDate";
    description = 'This is an example upload request created via the workspaces API';
    status      = 'draft';
    due_date    = $dueDate;
    assignments = @(
        @{
            upload_request_responsibility_type_id = 'assignee';
            first_name                            = 'Test';
            last_name                             = 'User';
            email                                 = $variables.SIGNER_EMAIL;
        };
        @{
            assignee_user_id                      = "$workspaceCreatorId";
            upload_request_responsibility_type_id = 'watcher';
        };
    );
} | ConvertTo-Json
```

## Step 4. Call the Workspaces API

Now that you have constructed your API headers and request body, make a POST request to the [Workspaces: createWorkspaceUploadRequest](/docs/workspaces-api/reference/workspaces/workspaceuploadrequest/createworkspaceuploadrequest) endpoint and include the request body to create the workspace. Here’s how you make the call, but make sure to substitute your API account ID for \{account_id} and your workspace ID for \{workspace_id}.

> **Note**
>
> View the source code for this how-to on GitHub:  [Bash](https://github.com/docusign/code-examples-bash/blob/master/examples/Workspaces/eg005CreateUploadRequest.sh), [C#](https://github.com/docusign/code-examples-csharp/blob/master/launcher-csharp/Workspaces/Examples/CreateUploadRequest.cs), [Java](https://github.com/docusign/code-examples-java/blob/master/src/main/java/com/docusign/controller/workspaces/examples/Work005CreateUploadRequestController.java), [Node.js](https://github.com/docusign/code-examples-node/blob/master/lib/workspaces/examples/createUploadRequest.js), and [PowerShell](https://github.com/docusign/code-examples-powershell/blob/master/examples/Workspaces/eg005CreateUploadRequest.ps1).

**`Bash`**

```bash title="Bash"
Status=$(curl -s -w "%{http_code}\n" -i \
     --request POST ${base_path}/accounts/${account_id}/workspaces/${workspace_id}/upload-requests \
    "${Headers[@]}" \
    --data-binary @${request_data} \
    --output ${response})
```

**`C#`**

```csharp title="C#"
return await client.Workspaces.WorkspaceUploadRequest.CreateWorkspaceUploadRequestAsync(
    accountId,
    workspaceId,
    createUploadRequest);
        }
```

**`Java`**

```java title="Java"
return createIamClient(accessToken)
        .workspaces()
        .workspaceUploadRequest()
        .createWorkspaceUploadRequest()
        .accountId(accountId)
        .workspaceId(workspaceId)
        .createWorkspaceUploadRequestBody(createWorkspaceUploadRequestBody)
        .call();
```

**`Node.js`**

```javascript title="Node.js"
return await client.workspaces1.workspaceUploadRequest.createWorkspaceUploadRequest(
  {
    accountId: args.accountId,
    workspaceId: args.workspaceId,
    createWorkspaceUploadRequestBody,
  }
);
```

**`PowerShell`**

```text title="PowerShell"
$response = $(Invoke-WebRequest `
    -Uri "${apiUri}/accounts/${accountId}/workspaces/${workspaceId}/upload-requests" `
    -Method 'POST' `
    -headers $headers `
    -body $body)
```

## Expected response

If you run this code example from our Quickstart or launcher projects, you should see a JSON response similar to the code shown.

**`Expected response`**

```json title="Expected response"
{"upload_request_id":"4c290dad-3e1b-4a9f-b8d1-de90eb0a2104","workspace_id":"50db67eb-0405-4043-b2c6-8a291e595f8b","name":"Upload Request example 2025-11-13T11:49:34Z","description":"This is an example upload request created via the workspaces API","upload_request_owner":{"user_id":"c0c1f365-b1a1-42a0-b0d4-090950b97fac"},"status":"draft","documents":[],"assignments":[{"assignee_user_id":"c0c1f365-b1a1-42a0-b0d4-090950b97fac","upload_request_responsibility_type_id":"watcher"},{"assignee_user_id":"8946d162-a27f-4753-912e-16411adaab8e","upload_request_responsibility_type_id":"assignee"}],"created_date":"2025-11-06T19:49:37.74Z","updated_date":"2025-11-06T19:49:37.787Z","due_date":"2025-11-13T11:49:34Z","sent_date":null,"completed_date":null,"can_view":true,"can_edit":true,"can_delete":true}
```

## Next steps

* Run this code example from our [Quickstart](/docs/esign-rest-api/quickstart) or launcher projects: [Bash](https://github.com/docusign/code-examples-bash), [C#](https://github.com/docusign/code-examples-csharp), [Java](https://github.com/docusign/code-examples-java), [Node.js](https://github.com/docusign/code-examples-node), [PowerShell](https://github.com/docusign/code-examples-powershell).
* See [How to add a document to workspace](/docs/workspaces-api/how-to/add-a-document).
* See [How to send an envelope with recipient info](/docs/workspaces-api/how-to/send-envelope-with-recipient-information).
* See how to [Go-Live](/docs/workspaces-api/go-live) with a completed app.