> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.royalti.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Royalty Source (Admin)

> Updates a royalty source by its ID.

<Note>
  This endpoint requires authentication. Include your Bearer token in the Authorization header.
</Note>

## Description

### Required Permissions

* `sources:admin:update`

## Code Examples

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.royalti.io/sources/admin/example-id', {
    method: 'PUT',
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      "name": "Spotify UK",
      "label": "Spotify UK",
      "type": "DSP",
      "format": "csv",
      "public": true,
      "isActive": true,
      "startDate": "2021-01-01",
      "endDate": "2025-12-31",
      "dataQuery": {},
      "fileNameFormat": "sample-fileNameFormat",
      "schema": "sample-schema",
      "delimiter": "sample-delimiter",
      "tableNameFormat": "sample-tableNameFormat",
      "headerRows": 1
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  response = requests.put(
    'https://api.royalti.io/sources/admin/example-id',
    headers={
      'Authorization': f'Bearer {token}'
    },
    json={"name":"Spotify UK","label":"Spotify UK","type":"DSP","format":"csv","public":true,"isActive":true,"startDate":"2021-01-01","endDate":"2025-12-31","dataQuery":{},"fileNameFormat":"sample-fileNameFormat","schema":"sample-schema","delimiter":"sample-delimiter","tableNameFormat":"sample-tableNameFormat","headerRows":1}
  )

  data = response.json()
  print(data)
  ```

  ```bash cURL theme={null}
  curl -X PUT https://api.royalti.io/sources/admin/example-id \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"name":"Spotify UK","label":"Spotify UK","type":"DSP","format":"csv","public":true,"isActive":true,"startDate":"2021-01-01","endDate":"2025-12-31","dataQuery":{},"fileNameFormat":"sample-fileNameFormat","schema":"sample-schema","delimiter":"sample-delimiter","tableNameFormat":"sample-tableNameFormat","headerRows":1}'

  ```
</CodeGroup>
