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

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

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

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