Upload Attachment As Release Asset (By Release Tag)

Uploads attachment to a release and adds it as an asset

Request

POST

https://api.sourcecraft.tech/repos/{org_slug}/{repo_slug}/releases/tag/{release_tag}/attachments

Path parameters

Name

Description

org_slug

Type: string

Example: ``

release_tag

Type: string

Example: ``

repo_slug

Type: string

Example: ``

Body

multipart/form-data
{
  "name": "example",
  "file": "example"
}

Name

Description

file

Type: string<binary>

The file to upload

Example: example

name

Type: string

The intended name of the asset

Example: example

Responses

201 Created

A successful response.

Body

application/json
{
  "id": "example",
  "name": "example",
  "link": "example",
  "attachment": {
    "id": "example",
    "name": "example",
    "mime_type": "example",
    "file_type": "image",
    "size": "example"
  },
  "archive_link": {
    "archive_type": "tar_gz",
    "link": "example"
  }
}

Name

Description

archive_link

Type: CodeArchive

Example
{
  "archive_type": "tar_gz",
  "link": "example"
}

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

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"
}

ArchiveType

Type: string

Const: tar_gz

Example: example

CodeArchive

Name

Description

archive_type

Type: ArchiveType

Enum: tar_gz

link

Type: string

Example: example

Example
{
  "archive_type": "tar_gz",
  "link": "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": null
}

Name

Description

details

Type: unknown

Example: null

error_code

Type: string

Example: example

message

Type: string

Example: example

request_id

Type: string

Example: example