Discard Release (By ID)

Only 'published' releases may be discarded, drafts can only be deleted or published.
Contrary to deleted releases, discarded releases are still visible to maintainers.

Request

POST

https://api.sourcecraft.tech/releases/id:{release_id}/discard

Path parameters

Name

Description

release_id

Type: string

Example: ``

Query parameters

Name

Description

release_tag

Type: string

Example: ``

Responses

200 OK

A successful response.

Body

application/json
{
  "id": "example",
  "repo_id": "example",
  "author": {
    "id": "example",
    "slug": "example"
  },
  "tag": "example",
  "hash": "example",
  "title": "example",
  "release_notes": "example",
  "status": "draft",
  "assets": [
    {
      "id": "example",
      "name": "example",
      "link": "example",
      "attachment": {
        "id": "example",
        "name": "example",
        "mime_type": "example",
        "file_type": "image",
        "size": "example"
      }
    }
  ],
  "is_latest": true,
  "is_pre_release": true,
  "created_at": "2025-01-01T00:00:00Z",
  "updated_at": "2025-01-01T00:00:00Z",
  "released_at": "2025-01-01T00:00:00Z"
}

Name

Description

assets

Type: ReleaseAsset[]

Example
[
  {
    "id": "example",
    "name": "example",
    "link": "example",
    "attachment": {
      "id": "example",
      "name": "example",
      "mime_type": "example",
      "file_type": "image",
      "size": "example"
    }
  }
]

author

Type: UserEmbedded

Example
{
  "id": "example",
  "slug": "example"
}

created_at

Type: string<date-time>

Example: 2025-01-01T00:00:00Z

hash

Type: string

Example: example

id

Type: string

Example: example

is_latest

Type: boolean

is_pre_release

Type: boolean

release_notes

Type: string

Example: example

released_at

Type: string<date-time>

Example: 2025-01-01T00:00:00Z

repo_id

Type: string

Example: example

status

Type: Release.Status

Enum: draft, published, discarded

tag

Type: string

Example: example

title

Type: string

Example: example

updated_at

Type: string<date-time>

Example: 2025-01-01T00:00:00Z

UserEmbedded

Name

Description

id

Type: string

Example: example

slug

Type: string

Example: example

Example
{
  "id": "example",
  "slug": "example"
}

Release.Status

Type: string

Enum: draft, published, discarded

FileType

Type: string

Enum: image, document, video, container

Attachment

Name

Description

file_type

Type: FileType

Enum: image, document, video, container

id

Type: string

Example: example

mime_type

Type: string

Example: example

name

Type: string

Example: example

size

Type: string<int64>

Example: example

Example
{
  "id": "example",
  "name": "example",
  "mime_type": "example",
  "file_type": "image",
  "size": "example"
}

ReleaseAsset

Name

Description

attachment

Type: Attachment

Example
{
  "id": "example",
  "name": "example",
  "mime_type": "example",
  "file_type": "image",
  "size": "example"
}

id

Type: string

Example: example

link

Type: string

Example: example

name

Type: string

Example: example

Example
{
  "id": "example",
  "name": "example",
  "link": "example",
  "attachment": {
    "id": "example",
    "name": "example",
    "mime_type": "example",
    "file_type": "image",
    "size": "example"
  }
}

default

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

Body

application/json
{
  "error_code": "example",
  "message": "example",
  "request_id": "example",
  "details": {}
}

Name

Description

details

Type: Optional details. Exact structure depends on error_code

[additional]

Type: string

Example: example

Example
{}

error_code

Type: string

Example: example

message

Type: string

Example: example

request_id

Type: string

Example: example

Предыдущая
Следующая