# Owned Bundles

This resource provides operations with owned field bundles.
|  Resource  |     ```GENERIC /api/admin/customFieldSettings/bundles/ownedField ```    |
| --- | --- |
|  Returned entity  |  [OwnedBundle](api-entity-OwnedBundle.html). For the description of the entity attributes, see [Supported Fields](#OwnedBundle-supported-fields) section.  |
|  Supported methods  |      * `GET`: [Read a List of OwnedBundles](#get_all-OwnedBundle-method).    * `POST`: [Add a New OwnedBundle](#create-OwnedBundle-method).    |
|  Supported sub-resources  |      * [/api/admin/customFieldSettings/bundles/ownedField/{bundleID}](operations-api-admin-customFieldSettings-bundles-ownedField.html)    * [/api/admin/customFieldSettings/bundles/ownedField/{bundleID}/values](resource-api-admin-customFieldSettings-bundles-ownedField-bundleID-values.html)    |

## OwnedBundle attributes

Represents a set of owned values in YouTrack.

### Related Resources

Below you can find the list of resources that let you work with this entity.

* [Owned Bundles]()

Extends [BaseBundle](api-entity-BaseBundle.html)

### Attributes

This table describes attributes of the `OwnedBundle` entity.

* To receive an attribute in the response from the server, specify it explicitly in the `fields` request parameter.

* To update an attribute, provide it in the body of a POST request.

|  Field  |  Type  |  Description  |
| --- | --- | --- |
|  id  |  String  |  The ID of the set of owned values. `Read-only`.  |
|  values  |  [Array of OwnedBundleElements](api-entity-OwnedBundleElement.html)  |  Collection of owned field values in the bundle.  |
|  isUpdateable  |  Boolean  |  If `true`, then the currently logged-in user can update this bundle. Otherwise, `false`. `Read-only`.  |

## Read a List of OwnedBundles

Get a list of all available bundles of owned values.

### Request syntax

```GENERIC
GET /api/admin/customFieldSettings/bundles/ownedField?{fields}&{$top}&{$skip}
```

|  null  |  The database ID of OwnedBundle  |
| --- | --- |

### Request parameters

|  Parameter  |  Type  |  Description  |
| --- | --- | --- |
|  fields  |  String  |  A list of OwnedBundle attributes that should be returned in the response. If no field is specified, only the `entityID` is returned.  |
|  $skip  |  Int  |  Optional. Lets you set a number of returned entities to skip before returning the first one.  |
|  $top  |  Int  |     Optional. Lets you specify the maximum number of entries that are returned in the response. If you don't set the $top value, the server limits the maximum number of returned entries.       The server returns a maximum of 42 entries for most resources that return collections. For more information, see [Pagination](api-concept-pagination.html).     |

### Sample

#### Sample request

```CURL
https://example.youtrack.cloud/api/admin/customFieldSettings/bundles/ownedField?fields=id,name,values(owner(name,login,id),name,description)
```

#### Sample response body

```JSON
[
  {
    "values": [
      {
        "owner": {
          "login": "john.doe",
          "name": "John Doe",
          "id": "1-2",
          "$type": "User"
        },
        "description": null,
        "name": "Documentation",
        "$type": "OwnedBundleElement"
      }
    ],
    "name": "Sample Project: Subsystems",
    "id": "93-0",
    "$type": "OwnedBundle"
  },
  {
    "values": [
      {
        "owner": {
          "login": "jane.doe",
          "name": "Jane Doe",
          "id": "1-3",
          "$type": "User"
        },
        "description": null,
        "name": "Documentation",
        "$type": "OwnedBundleElement"
      },
      {
        "owner": {
          "login": "Jane_Smith",
          "name": "Jane Smith",
          "id": "1-4",
          "$type": "User"
        },
        "description": null,
        "name": "Tests",
        "$type": "OwnedBundleElement"
      },
      {
        "owner": {
          "login": "john.doe",
          "name": "John Doe",
          "id": "1-2",
          "$type": "User"
        },
        "description": null,
        "name": "Core",
        "$type": "OwnedBundleElement"
      }
    ],
    "name": "Rest Api Project: Subsystems",
    "id": "93-2",
    "$type": "OwnedBundle"
  },
  {
    "values": [],
    "name": "Sandbox: Subsystems",
    "id": "93-3",
    "$type": "OwnedBundle"
  },
  {
    "values": [],
    "name": "Rest Project: Subsystems",
    "id": "93-6",
    "$type": "OwnedBundle"
  },
  {
    "values": [],
    "name": "GRA Project: Subsystems",
    "id": "93-7",
    "$type": "OwnedBundle"
  }
]
```

## Add a New OwnedBundle

Create a new bundle of owned values.

### Required permissions

Requires permissions: Update Project or Low-level Admin Write

### Request syntax

```GENERIC
POST /api/admin/customFieldSettings/bundles/ownedField?{fields}
```

|  null  |  The database ID of OwnedBundle  |
| --- | --- |

### Request parameters

|  Parameter  |  Type  |  Description  |
| --- | --- | --- |
|  fields  |  String  |  A list of OwnedBundle attributes that should be returned in the response. If no field is specified, only the `entityID` is returned.  |

### Sample

#### Sample request

```CURL
https://example.youtrack.cloud/api/admin/customFieldSettings/bundles/ownedField?fields=id,name,values(owner(name,login,id),name,description)
```

#### Sample request body

```JSON
{
  "name" : "General Subsystems",
  "isUpdateable" : true,
  "values" : [
    {
      "name" : "Documentation",
      "description" : "Docs and wording related issues"
    },
    {
      "name" : "Core functionality"
    },
    {
      "name" : "Testing"
    }
  ]
}
```

#### Sample response body

```JSON
{
  "values": [
    {
      "owner": {
        "login": "john.smith",
        "name": "John Smith",
        "id": "24-2",
        "$type": "User"
      },
      "description": "Docs and wording related issues",
      "name": "Documentation",
      "$type": "OwnedBundleElement"
    },
    {
      "owner": {
        "login": "minnie.terry",
        "name": "Minnie Terry",
        "id": "24-0",
        "$type": "User"
      },
      "description": null,
      "name": "Core functionality",
      "$type": "OwnedBundleElement"
    },
    {
      "owner": {
        "login": "john.smith",
        "name": "John Smith",
        "id": "24-2",
        "$type": "User"
      },
      "description": null,
      "name": "Testing",
      "$type": "OwnedBundleElement"
    }
  ],
  "name": "General Subsystems",
  "id": "93-10",
  "$type": "OwnedBundle"
}
```

