> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://contentful.com/developers/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://contentful.com/developers/docs/_mcp/server.

# Create an asset in a release

POST https://api.contentful.com/spaces/{space_id}/environments/{environment_id}/releases/{release_id}/assets
Content-Type: application/vnd.contentful.management.v1+json

Creates a new asset and adds it to the release in one step. An ID is auto-generated and returned with the response.

Reference: https://contentful.com/developers/docs/references/content-management-api/timeline-assets/create-an-asset-in-a-release

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `space_id` (string, required) — ID of the space in form of a string
- `environment_id` (string, required) — ID of the environment in form of a string
- `release_id` (string, required) — ID of the release in form of a string

### Body (application/vnd.contentful.management.v1+json)

This endpoint expects a map from string to any.

- `map from string to any`

## Response

### 201

Created - Resource created successfully

- `map from string to any`

## Examples

**Request**

```json
{
  "fields": {
    "file": {
      "en-US": {
        "contentType": "image/jpeg",
        "fileName": "example.jpeg",
        "upload": "https://example.com/example.jpg"
      }
    },
    "title": {
      "en-US": "Playsam Streamliner"
    }
  },
  "metadata": {
    "tags": [
      {
        "sys": {
          "id": "nyCampaign",
          "linkType": "Tag",
          "type": "Link"
        }
      }
    ]
  }
}
```

**Response**

```json
{
  "fields": {
    "file": {
      "en-US": {
        "contentType": "image/jpeg",
        "fileName": "example.jpeg",
        "upload": "https://example.com/example.jpg"
      }
    },
    "title": {
      "en-US": "Playsam Streamliner"
    }
  },
  "metadata": {
    "tags": [
      {
        "sys": {
          "id": "nyCampaign",
          "linkType": "Tag",
          "type": "Link"
        }
      }
    ]
  },
  "sys": {
    "createdAt": "2025-02-23T10:21:46.000Z",
    "createdBy": {
      "sys": {
        "id": "7BslKh9TdKGOK41VmLDjFZ",
        "linkType": "User",
        "type": "Link"
      }
    },
    "environment": {
      "sys": {
        "id": "staging",
        "linkType": "Environment",
        "type": "Link"
      }
    },
    "id": "wtrHxeu3zEoEce2MokCSi",
    "release": {
      "sys": {
        "id": "black",
        "linkType": "Release",
        "type": "Link"
      }
    },
    "space": {
      "sys": {
        "id": "yadj1kx9rmg0",
        "linkType": "Space",
        "type": "Link"
      }
    },
    "type": "Asset",
    "updatedAt": "2025-02-23T10:21:46.000Z",
    "updatedBy": {
      "sys": {
        "id": "4FLrUHftHW3v2BLi9fzfjU",
        "linkType": "User",
        "type": "Link"
      }
    },
    "version": 1
  }
}
```

**SDK Code**

```javascript JavaScript
import { createClient } from 'contentful-management'

// Client init
const client = createClient({
  accessToken: '<content_management_api_key>'
})

const rawData = {
  fields: {
    title: {
      'en-US': 'Asset title',
    },
    description: {
      'en-US': 'Asset description',
    },
    file: {
      'en-US': {
        contentType: 'image/jpeg',
        fileName: 'example.jpeg',
        upload: 'https://example.com/example.jpg',
      },
    },
  },
};

// Create asset with an auto-generated ID
const asset = await client.release.asset.create(
  {
    spaceId: '<space_id>',
    environmentId: '<environment_id>',
    releaseId: '<release_id>',
  },
  rawData
);

// Or create asset with a given ID
const asset = await client.release.asset.createWithId(
  {
    spaceId: '<space_id>',
    environmentId: '<environment_id>',
    releaseId: '<release_id>',
    assetId: '<asset_id>',
  },
  rawData
);
```

```android Android
No snippet for this SDK.
```

```java Java
No snippet for this SDK.
```

```kotlin Kotlin
No snippet for this SDK.
```

```swift Swift
No snippet for this SDK.
```

```js-legacy JavaScript (legacy)
No snippet for this SDK.
```

```php PHP
No snippet for this SDK.
```

```ruby Ruby
No snippet for this SDK.
```

```python Python
No snippet for this SDK.
```

```.net .NET
No snippet for this SDK.
```