# app.rocksky.mirror.putMirrorSource

> Published by [rocksky.app](https://lexicon.garden/identity/did:plc:vegqomyce4ssoqs7zwqvgqty)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:vegqomyce4ssoqs7zwqvgqty/app.rocksky.mirror.putMirrorSource)
- [Documentation](https://lexicon.garden/lexicon/did:plc:vegqomyce4ssoqs7zwqvgqty/app.rocksky.mirror.putMirrorSource/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:vegqomyce4ssoqs7zwqvgqty/app.rocksky.mirror.putMirrorSource/examples)

## Definitions

### `app.rocksky.mirror.putMirrorSource`

**Type**: `procedure`

Upsert a mirror source for the authenticated user. Toggling `enabled` notifies the mirror process over NATS so it can start/stop the per-user task without a restart.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `apiKey` | `string` | No | API key / token to be encrypted at rest. Omit to leave the existing key unchanged. Pass an empty string to clear it. |
| `enabled` | `boolean` | No | Enable or disable mirroring for this provider. |
| `provider` | `string` | Yes | One of: lastfm, listenbrainz, tealfm |
| `externalUsername` | `string` | No | External username (Last.fm / ListenBrainz). Required when enabling those providers. Ignored for Teal.fm. |

#### Output

**Encoding**: `application/json`

## Raw Schema

```json
{
  "id": "app.rocksky.mirror.putMirrorSource",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "provider"
          ],
          "properties": {
            "apiKey": {
              "type": "string",
              "description": "API key / token to be encrypted at rest. Omit to leave the existing key unchanged. Pass an empty string to clear it."
            },
            "enabled": {
              "type": "boolean",
              "description": "Enable or disable mirroring for this provider."
            },
            "provider": {
              "type": "string",
              "description": "One of: lastfm, listenbrainz, tealfm"
            },
            "externalUsername": {
              "type": "string",
              "description": "External username (Last.fm / ListenBrainz). Required when enabling those providers. Ignored for Teal.fm."
            }
          }
        },
        "encoding": "application/json"
      },
      "output": {
        "schema": {
          "ref": "app.rocksky.mirror.defs#mirrorSourceView",
          "type": "ref"
        },
        "encoding": "application/json"
      },
      "description": "Upsert a mirror source for the authenticated user. Toggling `enabled` notifies the mirror process over NATS so it can start/stop the per-user task without a restart."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
