# dev.tsunagite.submitScore

> Published by [tsunagite.dev](https://lexicon.garden/identity/did:plc:pz4sp2vf5w26wnaee253gfms)

✓ This is the authoritative definition for this NSID.

## Description

Definitions related to submitting scores to games hosting leaderboards via Tsunagite.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:pz4sp2vf5w26wnaee253gfms/dev.tsunagite.submitScore)
- [Documentation](https://lexicon.garden/lexicon/did:plc:pz4sp2vf5w26wnaee253gfms/dev.tsunagite.submitScore/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:pz4sp2vf5w26wnaee253gfms/dev.tsunagite.submitScore/examples)

## Definitions

### `dev.tsunagite.submitScore`

**Type**: `procedure`

Submit a score on a given chart.

#### Input

**Encoding**: `application/json`

#### Output

**Encoding**: `application/json`

#### Errors

- **gameNotFound**: No game matching the given URI was found.
- **songNotFound**: No song matching the given URI was found.
- **chartNotFound**: No chart matching the given URI was found.
- **scoreInvalid**: The submitted score is missing components, or its components hold invalid data.
- **scoreDuplicate**: The submitted score has already been submitted before.

## Raw Schema

```json
{
  "id": "dev.tsunagite.submitScore",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "ref": "dev.tsunagite.score",
          "type": "ref"
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "gameNotFound",
          "description": "No game matching the given URI was found."
        },
        {
          "name": "songNotFound",
          "description": "No song matching the given URI was found."
        },
        {
          "name": "chartNotFound",
          "description": "No chart matching the given URI was found."
        },
        {
          "name": "scoreInvalid",
          "description": "The submitted score is missing components, or its components hold invalid data."
        },
        {
          "name": "scoreDuplicate",
          "description": "The submitted score has already been submitted before."
        }
      ],
      "output": {
        "type": "object",
        "encoding": "application/json",
        "required": [
          "uri"
        ],
        "properties": {
          "uri": {
            "type": "string",
            "description": "The URI of the newly-created score."
          },
          "position": {
            "type": "integer",
            "minimum": 1,
            "description": "The position in the default leaderboard sort order this score places."
          }
        }
      },
      "description": "Submit a score on a given chart."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "description": "Definitions related to submitting scores to games hosting leaderboards via Tsunagite."
}
```
