> 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

# Create workspace file

POST https://demo.docusign.net/restapi/v2.1/accounts/{accountId}/workspaces/{workspaceId}/folders/{folderId}/files

This method adds a file to a workspace.

Reference: https://developers.docusign.com/docs/esign-rest-api/reference/workspaces/workspaceitems/createfile

## Authentication

- `Authorization` header (required) (prefixed with ` Bearer  `) — OAuth 2.0 access token (JWT or auth-code grant). Sent as `Authorization: Bearer <token>` on every request except `GET /v2.1` and `GET /service_information`, which are public discovery endpoints.

## Servers

- `https://demo.docusign.net/restapi` (Demo, default)
- `https://www.docusign.net/restapi` (Production)

## Request

### Path parameters

- `accountId` (string, required) — The external account number (int) or account ID Guid.
- `folderId` (string, required) — The ID of the folder.
- `workspaceId` (string, required) — The ID of the workspace.

## Response

### 201

Successful response.

- `callerAuthorization` (workspaceUserAuthorization, optional) — Provides properties that describe user authorization to a workspace.
- `contentType` (string, optional) — If the item is a file, this property specifies the content type of the file.
- `created` (string, optional) — The UTC DateTime when the workspace item was created.
- `createdById` (string, optional) — The ID of the user who created the workspace item.
- `createdByInformation` (workspaceUser, optional) — This object represents the workspace user. This property is only returned in response to user specific GET call.
- `extension` (string, optional) — The file extension of a file item.
- `fileSize` (string, optional) — The size of the file in bytes.
- `fileUri` (string, optional) — The URI for retrieving the file.
- `id` (string, optional) — A unique ID for the Salesforce object.
- `isPublic` (string, optional) — When **true,** the item is public.
- `lastModified` (string, optional) — The UTC date and time that the comment was last updated. **Note:** This can only be done by the creator.
- `lastModifiedById` (string, optional) — The ID of the user who last modified the item.
- `lastModifiedByInformation` (workspaceUser, optional) — This object represents the workspace user. This property is only returned in response to user specific GET call.
- `name` (string, optional) — The name of the file or folder.
- `pageCount` (string, optional) — The number of pages in a file.
- `parentFolderId` (string, optional) — The ID of the parent folder, or the special value `root` for the root folder.
- `parentFolderUri` (string, optional) — The URI of the parent folder.
- `sha256` (string, optional) — A 64-byte, Secure Hash Algorithm 256 (SHA256) checksum that the caller computes across the entirety of the original content of a file. Docusign compares this value to its own computation. If the two values are not equal, the original content and received content are not the same and the upload is refused.
- `thumbHeight` (string, optional) — The height of the thumbnail image.
- `thumbnail` (page, optional) — Description of a page of a document.
- `thumbWidth` (string, optional) — The width of the thumbnail image.
- `type` (string, optional) — The type of the workspace item. Valid values are file, folder.
- `uri` (string, optional) — A URI containing the user ID.
- `userAuthorization` (workspaceUserAuthorization, optional) — Provides properties that describe user authorization to a workspace.

## Errors

### 400 Bad Request Error

Error encountered.

- `errorCode` (string, optional) — The code associated with the error condition.
- `message` (string, optional) — A brief message describing the error condition.

## Types

### workspaceUserAuthorization

Provides properties that describe user authorization to a workspace.

- `canDelete` (string, optional) — When **true,** the workspace user can delete items from the workspace.
- `canMove` (string, optional) — When **true,** the workspace user can move the items in the workspace.
- `canTransact` (string, optional) — When **true,** the workspace user can create transactions from the workspace.
- `canView` (string, optional) — When **true,** the workspace user can view the items in the workspace.
- `created` (string, optional) — The UTC DateTime when the workspace user authorization was created.
- `createdById` (string, optional) — The ID of the user who created the workspace user authorization.
- `errorDetails` (errorDetails, optional) — This object describes errors that occur. It is only valid for responses, and ignored in requests.
- `modified` (string, optional) — The UTC DateTime when the workspace user authorization was last modified.
- `modifiedById` (string, optional) — The ID of the user who last modified the workspace user authorization.
- `workspaceUserId` (string, optional) — The ID of the workspace user.
- `workspaceUserInformation` (workspaceUser, optional) — This object represents the workspace user. This property is only returned in response to user specific GET call.

### workspaceUser

This object represents the workspace user. This property is only returned in response to user specific GET call.

- `accountId` (string, optional) — The account ID associated with the workspace user.
- `accountName` (string, optional) — The name of the account that the workspace user belongs to.
- `activeSince` (string, optional) — The UTC DateTime when the user joined the workspace.
- `created` (string, optional) — The UTC DateTime when the workspace user was created.
- `createdById` (string, optional) — The ID of the user who created this workspace user.
- `email` (string, optional) — The workspace user's email address.
- `errorDetails` (errorDetails, optional) — This object describes errors that occur. It is only valid for responses, and ignored in requests.
- `invitationEmailBlurb` (string, optional) — The text of the workspace invitation email message sent to the user.
- `invitationEmailSubject` (string, optional) — The subject line of the workspace invitation email message sent to the user.
- `lastModified` (string, optional) — The UTC DateTime that the workspace user was last modified.
- `lastModifiedById` (string, optional) — The ID of the user who last modified the workspace user.
- `status` (string, optional) — Filters the results by user status. You can specify a comma-separated list of the following statuses: - ActivationRequired - ActivationSent - Active - Closed - Disabled
- `type` (string, optional) — Type of the user. Valid values: type_owner, type_participant.
- `userId` (string, optional) — The ID of the workspace user.
- `userName` (string, optional) — The name of workspace user.
- `workspaceId` (string, optional) — The ID of the workspace.
- `workspaceUserBaseUrl` (string, optional) — The URL for accessing the workspace user.
- `workspaceUserId` (string, optional) — The ID of the workspace user.
- `workspaceUserUri` (string, optional) — The URI for accessing the workspace user.

### page

Description of a page of a document.

- `dpi` (string, optional) — The number of dots per inch used for the page image.
- `errorDetails` (errorDetails, optional) — This object describes errors that occur. It is only valid for responses, and ignored in requests.
- `height` (string, optional) — The height of the page in pixels. Must be an integer.
- `imageBytes` (string, optional) — The number of image bytes.
- `mimeType` (string, optional) — The MIME type.
- `pageId` (string, optional) — The ID of the page.
- `sequence` (string, optional) — The sequence of the page in the document, or page number.
- `width` (string, optional) — The width of the page in pixels. Must be an integer.

### errorDetails

This object describes errors that occur. It is only valid for responses, and ignored in requests.

- `errorCode` (string, optional) — The code associated with the error condition.
- `message` (string, optional) — A brief message describing the error condition.

## Examples

**Response**

```json
{
  "callerAuthorization": {
    "canDelete": "sample string 1",
    "canMove": "sample string 2",
    "canTransact": "sample string 3",
    "canView": "sample string 4",
    "created": "sample string 5",
    "createdById": "sample string 6",
    "errorDetails": {
      "errorCode": "sample string 1",
      "message": "sample string 2"
    },
    "modified": "sample string 7",
    "modifiedById": "sample string 8",
    "workspaceUserId": "sample string 9",
    "workspaceUserInformation": {
      "accountId": "sample string 1",
      "accountName": "sample string 2",
      "activeSince": "sample string 3",
      "created": "sample string 4",
      "createdById": "sample string 5",
      "email": "sample string 6",
      "invitationEmailBlurb": "sample string 7",
      "invitationEmailSubject": "sample string 8",
      "lastModified": "sample string 9",
      "lastModifiedById": "sample string 10",
      "status": "sample string 11",
      "type": "sample string 12",
      "userId": "sample string 13",
      "userName": "sample string 14",
      "workspaceId": "sample string 15",
      "workspaceUserBaseUrl": "sample string 16",
      "workspaceUserId": "sample string 17",
      "workspaceUserUri": "sample string 18"
    }
  },
  "contentType": "sample string 1",
  "created": "sample string 2",
  "createdById": "sample string 3",
  "extension": "sample string 4",
  "fileSize": "sample string 5",
  "fileUri": "sample string 6",
  "id": "sample string 7",
  "isPublic": "sample string 8",
  "lastModified": "sample string 9",
  "lastModifiedById": "sample string 10",
  "name": "sample string 11",
  "pageCount": "sample string 12",
  "parentFolderId": "sample string 13",
  "parentFolderUri": "sample string 14",
  "sha256": "sample string 15",
  "thumbHeight": "sample string 16",
  "thumbnail": {
    "dpi": "sample string 1",
    "height": "sample string 2",
    "imageBytes": "sample string 3",
    "mimeType": "sample string 4",
    "pageId": "sample string 5",
    "sequence": "sample string 6",
    "width": "sample string 7"
  },
  "thumbWidth": "sample string 17",
  "type": "sample string 18",
  "uri": "sample string 19"
}
```