---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.2
alternate:
  - https://sourcecraft.dev/portal/docs/en/api-ref/Repository-or-Releases/GenerateReleaseNotes.md
  - https://sourcecraft.dev/portal/docs/ru/api-ref/Repository-or-Releases/GenerateReleaseNotes.md
  - href: en/api-ref/Repository-or-Releases/GenerateReleaseNotes.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt

<div class="openapi">

# Generate Release Notes Preview

<!-- markdownlint-disable-file -->

Returns auto-generated markdown release notes for the commit range between
`previous_tag` (or the latest prior release) and `tag`, without creating
a release. Use to preview the body before calling `Create`.

## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-post);margin-bottom: 12px">

<div class="openapi__request">

POST {.openapi__method}
```text translate=no
https://api.sourcecraft.tech/repos/{org_slug}/{repo_slug}/releases/generate-notes
```

</div>

</div>

</div>

### Path parameters

#|
|| **Name** | **Description** ||
||

_org_slug_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_repo_slug_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
|#{.json-schema-properties}

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "tag": "example",
  "target_branch": "example",
  "previous_tag": "example",
  "path_filters": [
    "example"
  ]
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_path_filters_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string[]

Restricts generated notes to PRs that touched any of the given paths.

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  "example"
]
```

{% endcut %}
{.table-cell}
||
||

_previous_tag_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

The name of the previous tag to use as the starting point for the release notes.
Use to manually specify the range of changes considered as part of this release.
If empty, the latest prior release is used.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_tag_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Target tag of the release. May or may not exist yet.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_target_branch_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Branch, ref or SHA used to resolve `tag` when it doesn't exist yet.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

A successful response.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "title": "example",
  "release_notes": "example"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_release_notes_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Rendered markdown body.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_title_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Suggested release title.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

<div class="openapi__response__code__default">

## default

Both Client Errors (4xx) and Server Errors (5xx) are serialized into this scheme

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "error_code": "example",
  "message": "example",
  "request_id": "example",
  "details": null
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_details_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: unknown

_Example:_{.json-schema-reset .json-schema-example} `null`
{.table-cell}
||
||

_error_code_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_request_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

</div>

[*Deprecated]: No longer supported, please use an alternative and newer version.