# technology.agave.marketplace.putUses

> Published by [catalogue.agave.technology](https://lexicon.garden/identity/did:plc:jgjchylj237en76b3hi2xu4g)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:jgjchylj237en76b3hi2xu4g/technology.agave.marketplace.putUses)
- [Documentation](https://lexicon.garden/lexicon/did:plc:jgjchylj237en76b3hi2xu4g/technology.agave.marketplace.putUses/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:jgjchylj237en76b3hi2xu4g/technology.agave.marketplace.putUses/examples)

## Definitions

### `technology.agave.marketplace.putUses`

**Type**: `procedure`

Replace one instance's use counts with the ones given. Authenticated with a service token of any of the instance's members (aud: the marketplace's DID, lxm: this method); the marketplace keeps the counts under the instance id and never the member.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `instance` | `string` | Yes | An opaque id the instance draws once from at least 16 random bytes and keeps: letters, digits, dash and underscore. A report replaces the previous one under the same id. |
| `uses` | `array` | Yes |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `accepted` | `integer` | Yes | How many entries name a slug the marketplace indexed; the others are dropped. |

#### Errors

- **AuthenticationRequired**: The call carries no service token.
- **InvalidToken**: The token is expired, not signed by the key its issuer's DID document names, or not addressed to the marketplace and this method.

### `technology.agave.marketplace.putUses#use`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `author` | `string` (did) | Yes |  |
| `count` | `integer` | Yes | Copies of the slug, any version, across the instance's fleets. |
| `slug` | `string` | Yes |  |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Replace one instance's use counts with the ones given. Authenticated with a service token of any of the instance's members (aud: the marketplace's DID, lxm: this method); the marketplace keeps the counts under the instance id and never the member.",
      "errors": [
        {
          "description": "The call carries no service token.",
          "name": "AuthenticationRequired"
        },
        {
          "description": "The token is expired, not signed by the key its issuer's DID document names, or not addressed to the marketplace and this method.",
          "name": "InvalidToken"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "instance": {
              "description": "An opaque id the instance draws once from at least 16 random bytes and keeps: letters, digits, dash and underscore. A report replaces the previous one under the same id.",
              "maxLength": 64,
              "minLength": 16,
              "type": "string"
            },
            "uses": {
              "items": {
                "ref": "#use",
                "type": "ref"
              },
              "maxLength": 1000,
              "type": "array"
            }
          },
          "required": [
            "instance",
            "uses"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "accepted": {
              "description": "How many entries name a slug the marketplace indexed; the others are dropped.",
              "minimum": 0,
              "type": "integer"
            }
          },
          "required": [
            "accepted"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    },
    "use": {
      "properties": {
        "author": {
          "format": "did",
          "type": "string"
        },
        "count": {
          "description": "Copies of the slug, any version, across the instance's fleets.",
          "maximum": 10000,
          "minimum": 1,
          "type": "integer"
        },
        "slug": {
          "maxLength": 40,
          "type": "string"
        }
      },
      "required": [
        "author",
        "slug",
        "count"
      ],
      "type": "object"
    }
  },
  "id": "technology.agave.marketplace.putUses",
  "lexicon": 1
}
```
