--- title: "Auto-CSV Upload Scripts" slug: "auto-csv-example-scripts" updated: 2025-05-27T20:02:21Z published: 2025-05-27T20:02:21Z canonical: "help.claritysecurity.com/auto-csv-example-scripts" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.claritysecurity.com/llms.txt > Use this file to discover all available pages before exploring further. # Auto-CSV Upload Scripts ## Retrieve your URI and Token Values ### URI Your URI will be determined by the subdomain of your Clarity tenant. ```plaintext Format: https://YOUR_TENANT.claritysecurity.io/api/auto-upload-file Example: https://example.claritysecurity.io/api/auto-upload-file ``` ### API Token To retrieve your secure token, head to the Auto-CSV app in your tenant, click on the pencil icon in the top right corner, and look for the **API Access Token** field. Securely store this value for use in the scripts below. > [!CAUTION] > Token Example > > Take proper security precautions for securing this API Token value. > > The token below is just an example, you will need to grab the actual token from your Clarity Tenant after navigating to the particular application. ![](https://cdn.document360.io/2d020999-1823-4d4d-b6d2-4b52fb4a9617/Images/Documentation/Example API Access Token.png?sv=2026-02-06&spr=https&st=2026-11-09T19%3A53%3A05Z&se=2026-11-09T20%3A53%3A05Z&sr=c&sp=r&sig=Sw0prYzdYc8mc8kZJzZQPkukMANnUDj%2BygCTngJRZlk%3D) ## Python Please follow best practices for securing the API token for your script. > [!CAUTION] > Secure your Token > > Please follow best practices for securing the API token for your script. ### Single File Coming Soon.py ```python ``` ### Multiple Files Coming Soon.py ```python ``` ## Powershell Below are some examples of how to format the data. Powershell `Invoke-RestMethod` Cmdlet Documentation : [https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-7.5#example-6-simplified-multipart-form-data-submission](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-7.5#example-6-simplified-multipart-form-data-submission) > [!CAUTION] > Secure your Token > > Please follow best practices for securing the API token for your script. ### Single File This is an example for an application with just one file to ingest. ```powershell $uri = "https://example.claritysecurity.io/api/auto-upload-file" $token = "EpyCKbsmagyTddhAhCZNytk2vZu7JMjuRENSKF5GvbJXPmgQ6BtFH7lCGaWS" $headers = @{    "content-type" = "multipart/form-data"    "accept" = "application/json"    "authorization" = "Bearer $token" } $Form = @{    "file" = Get-Item -Path "C:\Files\example_users_groups.csv" } Invoke-RestMethod -Uri $uri -Method Post -Headers $headers -Form $Form ``` ### Multiple Files This is an example for an application with multiple files to ingest. ```powershell $uri = "https://example.claritysecurity.io/api/auto-upload-file" $token = "EpyCKbsmagyTddhAhCZNytk2vZu7JMjuRENSKF5GvbJXPmgQ6BtFH7lCGaWS" $file_list = @(    "C:\Files\example_users.xslx",    "C:\Files\example_groups.xlsx",    "C:\Files\example_user_groups.xlsx" ) $headers = @{    "content-type" = "multipart/form-data"    "accept" = "application/json"    "authorization" = "Bearer $token" } foreach ($file in $file_list) {    $Form = @{        "file" = Get-Item -Path $file    }    Invoke-RestMethod -Uri $uri -Method Post -Headers $headers -Form $Form } ``` --- ## **Need help?** If you have any problems, contact your customer success team. You can also get in touch with our general support [via email](mailto:support@claritysecurity.io), open a [support ticket](https://support.claritysecurity.com/home). Our general support team is available Monday - Friday from 8:00 AM - 6:30 PM CST.