# Version

## Base definition

```javascript
{
    "kind": "version",
    "tag": string,
    "index": integer,
    "label": string,
    "url": string,
    "uri": string,
    "datasetUri": string,
    "isReleased": bool,
    "isDeleted": bool
}
```

## List definition

In addition to the base definition, any version resource returned by a `list` request will contain the following properties:

```javascript
{
    "createdAt": integer,
    "updatedAt": integer,
    "releasedAt": integer    
}
```

## Get definition

In addition to the base and list definition, any version resource returned by a `get` request will contain the following properties:

```javascript
{
    "releaseNotes": string,
    "canRelease": boolean,
    "previousVersion": version.base,
    "nextVersion": version.base
}
```

## Documentation

| Fields              |                                                                                                                                                                                                                                                                                                                                       |         |           |                                                                                                                                                   |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Base**            |                                                                                                                                                                                                                                                                                                                                       |         |           |                                                                                                                                                   |
| kind                | <p><strong>string</strong></p><p>The resource type. Will always be "version".</p>                                                                                                                                                                                                                                                     |         |           |                                                                                                                                                   |
| tag                 | <p><strong>string</strong></p><p>The version's tag, in the from <code>v1.0</code>. Will always be unique to the version's dataset. If the version is unreleased, the tag will always be <code>next</code></p>                                                                                                                         |         |           |                                                                                                                                                   |
| index               | <p><strong>integer</strong></p><p>A zero based counter for the version's ordinality for its dataset. </p>                                                                                                                                                                                                                             |         |           |                                                                                                                                                   |
| label               | <p><strong>string</strong></p><p>A user-provided label for the version. May be null.</p>                                                                                                                                                                                                                                              |         |           |                                                                                                                                                   |
| uri                 | <p><strong>string</strong></p><p>The fully qualified reference to this version, for use in generating calls to this API. </p><p>For example, <code>/datasets/imathews.ian\_s\_dataset:123/versions/v1.0</code></p>                                                                                                                    |         |           |                                                                                                                                                   |
| datasetUri          | <p><strong>string</strong></p><p>The fully qualified reference to the dataset at this version. For example, <code>/datasets/imathews.ian\_s\_dataset:123:v1\_0</code></p>                                                                                                                                                             |         |           |                                                                                                                                                   |
| isReleased          | <p><strong>boolean</strong></p><p>Whether this dataset has been released.</p>                                                                                                                                                                                                                                                         |         |           |                                                                                                                                                   |
| isDeleted           | <p><strong>boolean</strong><br>Whether this version has been deleted</p>                                                                                                                                                                                                                                                              |         |           |                                                                                                                                                   |
| **List**            |                                                                                                                                                                                                                                                                                                                                       |         |           |                                                                                                                                                   |
| createdAt           | <p><strong>integer</strong></p><p>When the version was created. Stored as milliseconds since the epoch (1970-01-01).</p>                                                                                                                                                                                                              |         |           |                                                                                                                                                   |
| updatedAt           | <p><strong>integer</strong></p><p>When the version was last modified. Stored as milliseconds since the epoch (1970-01-01).</p>                                                                                                                                                                                                        |         |           |                                                                                                                                                   |
| releasedAt          | <p><strong>integer</strong></p><p>When the version was released. Stored as milliseconds since the epoch (1970-01-01).</p>                                                                                                                                                                                                             |         |           |                                                                                                                                                   |
| **Get**             |                                                                                                                                                                                                                                                                                                                                       |         |           |                                                                                                                                                   |
| releaseNotes        | <p><strong>string</strong></p><p>User-provided release notes for the version. May be null.</p>                                                                                                                                                                                                                                        |         |           |                                                                                                                                                   |
| status              | <p><strong>string</strong></p><p>An indicator for the status of a version's release. Will be one of:</p><p><code>queued                                                                                                                                                                                                               | running | completed | failed</code> </p><p>This field will be null before <a href="../rest-api/versions/releaseversion">dataset.releaseVersion</a> has been called.</p> |
| releaseErrorMessage | <p><strong>string</strong></p><p>If <code>releaseStatus == "failed"</code> , provides additional information on what caused the release to fail.</p>                                                                                                                                                                                  |         |           |                                                                                                                                                   |
| canRelease          | <p><strong>boolean</strong></p><p>Whether the version can be released. If no modifications have been made, or if some uploads are in progress and/or have failed,  this will be false. Calling <a href="../rest-api/versions/releaseversion">dataset.releaseVersion</a> when this is false will return a <code>400</code> error. </p> |         |           |                                                                                                                                                   |
