How to create an account
This topic demonstrates how to create a new account in your organization.
Run this code example from our Quickstart or launcher projects: Bash, C#, Java, Node.js, PHP, PowerShell, Python, or Ruby.
Required data
Running the code in this how-to requires this data:
Step 1. Obtain your OAuth token
To make the API call(s) shown in this how-to, you need a valid OAuth access token. Docusign supports access tokens for three different OAuth grant types: Authorization Code Grant, Implicit Grant, and JSON Web Token (JWT) Grant. Choose the OAuth grant type appropriate for your scenario.
Docusign Admin OAuth access tokens are the same ones used for our eSignature REST API, although you must request one or more Docusign Admin scopes to call the Docusign Admin API. The endpoint calls made in this how-to require that you request the following Docusign Admin-specific scopes when obtaining your access token: organization_sub_account_write and organization_sub_account_read.
See Docusign Admin Authentication for the full list of Docusign Admin scopes.
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}.
Step 3. Get the plan and subscription information for the new account
First, get the plan and subscription information for the organization under which the new account will be created. To do this, call the AccountCreation: GetOrganizationPlanItems endpoint. Save the values of planId and subscriptionId to be used in your request body in the next step.
Step 4. Construct the request body
Next, create the request body. Set the value of id to the subscription ID returned in the previous step. The value of planId should also come from the response of the previous step. Inside the targetAccount object, replace {ACCOUNT_NAME}, {FIRST_NAME}, {LAST_NAME}, and {EMAIL} with the name and email address of the administrator for the new account.
The countryCode parameter is used to determine the data residency for the new account. In the developer environment there is only one region available, and the value should be set to "US". In the production environment this value can be set to the two-character ISO 3166 country code for the country of the target account.
Step 5. Call the Docusign Admin API to create the account
Now that you have constructed your API headers and request body, make a POST request to the AccountCreation : CreateAssetGroupAccount endpoint and include the request body to create the new account. Here’s how you make the call, but make sure to substitute your organization ID for {ORGANIZATION_ID}.
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.
In addition, an account activation email will be sent to the email address specified in the request body. The new account must be activated before an additional account can be provisioned. Organizations with auto-activation enabled do not require this step.
Next steps
- Run this code example from our Quickstart or launcher projects: C#, Java, Node.js, PHP, Python, or Ruby.
- See How to clone an account.
- See how to Go-Live with a completed app and find the base path for API calls in the production environment.