# com.livtet.giveaway.listGiveaways

> List author giveaways from the activity index, newest first. Narrow by `uri`, `author`, `edition` or `status`; an unknown `uri` answers an empty list rather than `RecordNotFound`, so a page can ask about a giveaway that has already been deleted.

- Kind: query
- Authority: giveaway.livtet.com
- Lexicon: 1
- Published by [biblio.livtet.com](https://lexicon.garden/identity/did:plc:e2x3ihw2ntxt7pcgzmtu3abi), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:e2x3ihw2ntxt7pcgzmtu3abi/com.livtet.giveaway.listGiveaways)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:e2x3ihw2ntxt7pcgzmtu3abi/com.livtet.giveaway.listGiveaways/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:e2x3ihw2ntxt7pcgzmtu3abi/com.livtet.giveaway.listGiveaways/analytics)

## Query (`com.livtet.giveaway.listGiveaways`)

Type: query · GET

### Parameters (query string)

- `author` (string · did): The repo the giveaway records are written into.
- `cursor` (string): Opaque pagination cursor.
- `edition` (string · at-uri): The edition being given away.
- `limit` (integer)
  - Constraints: minimum: 1, maximum: 50, default: 50
- `status` (string): `open` means `opensAt <= now < closesAt`; `closed` is everything else, including a cancelled giveaway.
  - Constraints: knownValues: open | closed
- `uri` (string · at-uri): One giveaway record's AT-URI.

### Output (application/json)

- `cursor` (string): Opaque pagination cursor; absent when no further giveaways are known.
- `giveaways` (array, required)
  - `items` (ref)
    - Reference: `com.livtet.defs#giveawayView`

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cursor": {
              "description": "Opaque pagination cursor; absent when no further giveaways are known.",
              "type": "string"
            },
            "giveaways": {
              "items": {
                "ref": "com.livtet.defs#giveawayView",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "giveaways"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "author": {
            "description": "The repo the giveaway records are written into.",
            "format": "did",
            "type": "string"
          },
          "cursor": {
            "description": "Opaque pagination cursor.",
            "type": "string"
          },
          "edition": {
            "description": "The edition being given away.",
            "format": "at-uri",
            "type": "string"
          },
          "limit": {
            "default": 50,
            "maximum": 50,
            "minimum": 1,
            "type": "integer"
          },
          "status": {
            "description": "`open` means `opensAt <= now < closesAt`; `closed` is everything else, including a cancelled giveaway.",
            "knownValues": [
              "open",
              "closed"
            ],
            "type": "string"
          },
          "uri": {
            "description": "One giveaway record's AT-URI.",
            "format": "at-uri",
            "type": "string"
          }
        },
        "type": "params"
      },
      "type": "query"
    }
  },
  "description": "List author giveaways from the activity index, newest first. Narrow by `uri`, `author`, `edition` or `status`; an unknown `uri` answers an empty list rather than `RecordNotFound`, so a page can ask about a giveaway that has already been deleted.",
  "id": "com.livtet.giveaway.listGiveaways",
  "lexicon": 1
}
```
