---
id: creating-assets-java-sdk
slug: /sdk/java/creating-assets-java-sdk
title: 'Creating Assets with Java SDK'
description: 'This topic explains how to create assets using Java SDK'
sidebar_label: 'Creating Assets'
sidebar_position: 7
tags: ['scope', 'story', 'asset']
---

When you create a new asset with the JavaSDK, you need to specify the context of another asset that will be the parent. For example, if you create a new Story asset you can specify which Scope (project) it should be created in.

Prior to creating an asset in Digital.ai Agility, you must first instantiate a V1Connector and Services object:

```
            V1Connector connector = V1Connector
            .withInstanceUrl("<Server Base URI>")
            .withUserAgentHeader("AppName", "1.0")
            .withAccessToken("YOUR_ACCESS_TOKEN")
            .build();
   
            IServices services = new Services(connector);
        
```

## Creating a New Asset

This example shows how to create a Story asset in the context of a Scope with ID 1012:

```
                Oid projectId = services.getOid("Scope:1012");
                IAssetType storyType = services.getMeta().getAssetType("Story");
                Asset newStory = services.createNew(storyType, projectId);
                IAttributeDefinition nameAttribute = storyType.getAttributeDefinition("Name");
                newStory.setAttributeValue(nameAttribute, "My New Story");
                services.save(newStory);

                System.out.println(newStory.getOid().getToken());
                System.out.println(newStory.getAttribute(storyType.getAttributeDefinition("Scope")).getValue());
                System.out.println(newStory.getAttribute(nameAttribute).getValue());

                /***** OUTPUT *****
                Story:7617:9243
                Scope:1012
                My New Story
                ******************/
```
