# at.happyproto.registry.getArtifact

> Published by [happyproto.at](https://lexicon.garden/identity/did:plc:mo7vq4jbioxwafy5zkcc3eux)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.registry.getArtifact)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.registry.getArtifact/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.registry.getArtifact/examples)

## Definitions

### `at.happyproto.registry.getArtifact`

**Type**: `query`

The bytes of a blob the registry has copied, served from its own copy and never redirected to the publisher, so a version stays installable after its publisher deletes it. Name the blob either by version and kind or by its CID. Only blobs that an indexed manifest or publication references are served. The output encoding is `*/*`, as com.atproto.sync.getBlob's is; the media type is the one the blob was published with.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | No | The blob's CID, in place of the other parameters. |
| `did` | `string` (did) | No | The publisher. Required unless cid is given. |
| `index` | `integer` | No | Which screenshot, counting from 0, when kind is `screenshot`. |
| `kind` | `string` | No | Which blob of the version. Required unless cid is given. `icon` is the project's publication icon. |
| `name` | `string` | No | The project's name, which is the record key of its software.release.project: 1 to 64 lowercase letters, digits and interior hyphens. Required unless cid is given. |
| `version` | `string` | No | A semver version without build metadata, with an optional lowercase prerelease, such as `1.2.0` or `1.2.0-beta.1`. Required unless cid is given. |

#### Output

**Encoding**: `*/*`

#### Errors

- **ArtifactNotHeld**: The registry does not hold that blob: it has not copied it yet, the version does not have one of that kind, or nothing indexed references it.
- **NotConfigured**: The registry has no identity configured, so it cannot read its own state. An operator problem, not a caller's.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "The bytes of a blob the registry has copied, served from its own copy and never redirected to the publisher, so a version stays installable after its publisher deletes it. Name the blob either by version and kind or by its CID. Only blobs that an indexed manifest or publication references are served. The output encoding is `*/*`, as com.atproto.sync.getBlob's is; the media type is the one the blob was published with.",
      "errors": [
        {
          "description": "The registry does not hold that blob: it has not copied it yet, the version does not have one of that kind, or nothing indexed references it.",
          "name": "ArtifactNotHeld"
        },
        {
          "description": "The registry has no identity configured, so it cannot read its own state. An operator problem, not a caller's.",
          "name": "NotConfigured"
        }
      ],
      "output": {
        "encoding": "*/*"
      },
      "parameters": {
        "properties": {
          "cid": {
            "description": "The blob's CID, in place of the other parameters.",
            "format": "cid",
            "type": "string"
          },
          "did": {
            "description": "The publisher. Required unless cid is given.",
            "format": "did",
            "type": "string"
          },
          "index": {
            "default": 0,
            "description": "Which screenshot, counting from 0, when kind is `screenshot`.",
            "maximum": 7,
            "minimum": 0,
            "type": "integer"
          },
          "kind": {
            "description": "Which blob of the version. Required unless cid is given. `icon` is the project's publication icon.",
            "knownValues": [
              "package",
              "manifest",
              "icon",
              "banner",
              "screenshot"
            ],
            "type": "string"
          },
          "name": {
            "description": "The project's name, which is the record key of its software.release.project: 1 to 64 lowercase letters, digits and interior hyphens. Required unless cid is given.",
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          },
          "version": {
            "description": "A semver version without build metadata, with an optional lowercase prerelease, such as `1.2.0` or `1.2.0-beta.1`. Required unless cid is given.",
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          }
        },
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "at.happyproto.registry.getArtifact",
  "lexicon": 1
}
```
