dev.knotless.uploadImage

lexicons.knotless.dev

Documentation

Uploads the body, a PNG, JPEG, WebP or GIF, as a blob of the account logged in to this appview's web pages, as `knotless issue --image` does: one over 1,000,000 bytes is drawn again as a JPEG that fits, at most 2000 pixels on its longest side. Its PDS keeps it only once a record attaches it: give it as one of dev.knotless.createIssue's, createPull's, createComment's or editItem's `images`, with a body linking to `url`. Requires the session cookie the pages' login sets.

main procedure

Uploads the body, a PNG, JPEG, WebP or GIF, as a blob of the account logged in to this appview's web pages, as `knotless issue --image` does: one over 1,000,000 bytes is drawn again as a JPEG that fits, at most 2000 pixels on its longest side. Its PDS keeps it only once a record attaches it: give it as one of dev.knotless.createIssue's, createPull's, createComment's or editItem's `images`, with a body linking to `url`. Requires the session cookie the pages' login sets.

Parameters

repo stringat-uri Required

The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it, whose pull, issue or comment will show it.

Input

Encoding*/*

Accepts raw binary data

Output

Encodingapplication/json
blob blob Required

The picture as uploaded, to attach.

url stringuri Required

Where its account's PDS serves it, for the body to link to.

Errors

NotFound No such repository.
InvalidRequest No picture, or one that is not a PNG, JPEG, WebP or GIF.
AuthenticationRequired No account is logged in to the pages, or its session has ended.
Try It

Requests are sent directly from your browser. Some servers may block requests due to CORS.

Base URL for XRPC calls (e.g., https://bsky.social)
Enter valid JSON for the request body
View raw schema
{
  "description": "Uploads the body, a PNG, JPEG, WebP or GIF, as a blob of the account logged in to this appview's web pages, as `knotless issue --image` does: one over 1,000,000 bytes is drawn again as a JPEG that fits, at most 2000 pixels on its longest side. Its PDS keeps it only once a record attaches it: give it as one of dev.knotless.createIssue's, createPull's, createComment's or editItem's `images`, with a body linking to `url`. Requires the session cookie the pages' login sets.",
  "errors": [
    {
      "description": "No such repository.",
      "name": "NotFound"
    },
    {
      "description": "No picture, or one that is not a PNG, JPEG, WebP or GIF.",
      "name": "InvalidRequest"
    },
    {
      "description": "No account is logged in to the pages, or its session has ended.",
      "name": "AuthenticationRequired"
    }
  ],
  "input": {
    "encoding": "*/*"
  },
  "output": {
    "encoding": "application/json",
    "schema": {
      "properties": {
        "blob": {
          "accept": [
            "image/png",
            "image/jpeg",
            "image/webp",
            "image/gif"
          ],
          "description": "The picture as uploaded, to attach.",
          "maxSize": 1000000,
          "type": "blob"
        },
        "url": {
          "description": "Where its account's PDS serves it, for the body to link to.",
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "blob",
        "url"
      ],
      "type": "object"
    }
  },
  "parameters": {
    "properties": {
      "repo": {
        "description": "The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it, whose pull, issue or comment will show it.",
        "format": "at-uri",
        "type": "string"
      }
    },
    "required": [
      "repo"
    ],
    "type": "params"
  },
  "type": "procedure"
}

Lexicon Garden

@