> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://hiddenlayer.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://hiddenlayer.ferndocs.com/_mcp/server.

# Upload scan results

POST https://api.hiddenlayer.ai/scan-indices/v3/submission
Content-Type: application/json; charset=utf-8

Reference: https://hiddenlayer.ferndocs.com/api-reference/llm-proxy-api/indices/submit

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.hiddenlayer.ai` (ProdUs, default)
- `https://api.eu.hiddenlayer.ai` (ProdEu)

## Request

### Body (application/json; charset=utf-8)

This endpoint expects a ScanSubmission.

- `scanner_type` (string, required)
- `source` (ScanSubmissionSource, required)
- `scan_result` (ScanSubmissionScanResult, required)

## Response

### 201

The results were stored successfully.

### 202

The request was accepted, but no file results were read from it.

## Errors

### 400 Bad Request Error

The request failed due to a client error, with one or more of the following possible causes: 1. The request required a tenant_id field, which was missing. 2. The request was malformed syntactically or semantically.

- `any`

## Types

### ScanSubmissionSource

- `REPO` (ScanSubmissionSourceRepo, optional)
- `SAAS` (ScanSubmissionSourceSaas, optional)

### ScanSubmissionScanResult

### ScanSubmissionSourceRepo

### ScanSubmissionSourceSaas

- `requester_id` (string, optional)

## Examples

### Example 1

**Request**

```json
{
  "scanner_type": "hl_model_scanner",
  "source": {
    "SAAS": {
      "requester_id": "someone@hiddenlayer.com"
    }
  },
  "scan_result": {
    "file_results": [
      {
        "status": "done",
        "details": {
          "sha256": "fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6"
        }
      }
    ]
  }
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://api.hiddenlayer.ai/scan-indices/v3/submission"

payload = "{\n  \"scanner_type\": \"hl_model_scanner\",\n  \"source\": {\n    \"SAAS\": {\n      \"requester_id\": \"someone@hiddenlayer.com\"\n    }\n  },\n  \"scan_result\": {\n    \"file_results\": [\n      {\n        \"status\": \"done\",\n        \"details\": {\n          \"sha256\": \"fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6\"\n        }\n      }\n    ]\n  }\n}"
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json; charset=utf-8"
}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.hiddenlayer.ai/scan-indices/v3/submission';
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json; charset=utf-8'
  },
  body: '{\n  "scanner_type": "hl_model_scanner",\n  "source": {\n    "SAAS": {\n      "requester_id": "someone@hiddenlayer.com"\n    }\n  },\n  "scan_result": {\n    "file_results": [\n      {\n        "status": "done",\n        "details": {\n          "sha256": "fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6"\n        }\n      }\n    ]\n  }\n}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.hiddenlayer.ai/scan-indices/v3/submission"

	payload := strings.NewReader("{\n  \"scanner_type\": \"hl_model_scanner\",\n  \"source\": {\n    \"SAAS\": {\n      \"requester_id\": \"someone@hiddenlayer.com\"\n    }\n  },\n  \"scan_result\": {\n    \"file_results\": [\n      {\n        \"status\": \"done\",\n        \"details\": {\n          \"sha256\": \"fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6\"\n        }\n      }\n    ]\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json; charset=utf-8")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.hiddenlayer.ai/scan-indices/v3/submission")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json; charset=utf-8'
request.body = "{\n  \"scanner_type\": \"hl_model_scanner\",\n  \"source\": {\n    \"SAAS\": {\n      \"requester_id\": \"someone@hiddenlayer.com\"\n    }\n  },\n  \"scan_result\": {\n    \"file_results\": [\n      {\n        \"status\": \"done\",\n        \"details\": {\n          \"sha256\": \"fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6\"\n        }\n      }\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.hiddenlayer.ai/scan-indices/v3/submission")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json; charset=utf-8")
  .body("{\n  \"scanner_type\": \"hl_model_scanner\",\n  \"source\": {\n    \"SAAS\": {\n      \"requester_id\": \"someone@hiddenlayer.com\"\n    }\n  },\n  \"scan_result\": {\n    \"file_results\": [\n      {\n        \"status\": \"done\",\n        \"details\": {\n          \"sha256\": \"fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6\"\n        }\n      }\n    ]\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.hiddenlayer.ai/scan-indices/v3/submission', [
  'body' => '{
  "scanner_type": "hl_model_scanner",
  "source": {
    "SAAS": {
      "requester_id": "someone@hiddenlayer.com"
    }
  },
  "scan_result": {
    "file_results": [
      {
        "status": "done",
        "details": {
          "sha256": "fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6"
        }
      }
    ]
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json; charset=utf-8',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.hiddenlayer.ai/scan-indices/v3/submission");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json; charset=utf-8");
request.AddParameter("application/json; charset=utf-8", "{\n  \"scanner_type\": \"hl_model_scanner\",\n  \"source\": {\n    \"SAAS\": {\n      \"requester_id\": \"someone@hiddenlayer.com\"\n    }\n  },\n  \"scan_result\": {\n    \"file_results\": [\n      {\n        \"status\": \"done\",\n        \"details\": {\n          \"sha256\": \"fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6\"\n        }\n      }\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json; charset=utf-8"
]

let postData = NSData(data: "{
  "scanner_type": "hl_model_scanner",
  "source": {
    "SAAS": {
      "requester_id": "someone@hiddenlayer.com"
    }
  },
  "scan_result": {
    "file_results": [
      {
        "status": "done",
        "details": {
          "sha256": "fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6"
        }
      }
    ]
  }
}".data(using: String.Encoding.utf8)!)

let request = NSMutableURLRequest(url: NSURL(string: "https://api.hiddenlayer.ai/scan-indices/v3/submission")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Example 2

**Request**

```json
{
  "scanner_type": "hl_model_scanner",
  "source": {
    "SAAS": {
      "requester_id": "someone@hiddenlayer.com"
    }
  },
  "scan_result": {
    "file_results": [
      {
        "status": "done",
        "details": {
          "sha256": "fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6"
        }
      }
    ]
  }
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://api.hiddenlayer.ai/scan-indices/v3/submission"

payload = "{\n  \"scanner_type\": \"hl_model_scanner\",\n  \"source\": {\n    \"SAAS\": {\n      \"requester_id\": \"someone@hiddenlayer.com\"\n    }\n  },\n  \"scan_result\": {\n    \"file_results\": [\n      {\n        \"status\": \"done\",\n        \"details\": {\n          \"sha256\": \"fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6\"\n        }\n      }\n    ]\n  }\n}"
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json; charset=utf-8"
}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.hiddenlayer.ai/scan-indices/v3/submission';
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json; charset=utf-8'
  },
  body: '{\n  "scanner_type": "hl_model_scanner",\n  "source": {\n    "SAAS": {\n      "requester_id": "someone@hiddenlayer.com"\n    }\n  },\n  "scan_result": {\n    "file_results": [\n      {\n        "status": "done",\n        "details": {\n          "sha256": "fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6"\n        }\n      }\n    ]\n  }\n}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.hiddenlayer.ai/scan-indices/v3/submission"

	payload := strings.NewReader("{\n  \"scanner_type\": \"hl_model_scanner\",\n  \"source\": {\n    \"SAAS\": {\n      \"requester_id\": \"someone@hiddenlayer.com\"\n    }\n  },\n  \"scan_result\": {\n    \"file_results\": [\n      {\n        \"status\": \"done\",\n        \"details\": {\n          \"sha256\": \"fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6\"\n        }\n      }\n    ]\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json; charset=utf-8")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.hiddenlayer.ai/scan-indices/v3/submission")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json; charset=utf-8'
request.body = "{\n  \"scanner_type\": \"hl_model_scanner\",\n  \"source\": {\n    \"SAAS\": {\n      \"requester_id\": \"someone@hiddenlayer.com\"\n    }\n  },\n  \"scan_result\": {\n    \"file_results\": [\n      {\n        \"status\": \"done\",\n        \"details\": {\n          \"sha256\": \"fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6\"\n        }\n      }\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.hiddenlayer.ai/scan-indices/v3/submission")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json; charset=utf-8")
  .body("{\n  \"scanner_type\": \"hl_model_scanner\",\n  \"source\": {\n    \"SAAS\": {\n      \"requester_id\": \"someone@hiddenlayer.com\"\n    }\n  },\n  \"scan_result\": {\n    \"file_results\": [\n      {\n        \"status\": \"done\",\n        \"details\": {\n          \"sha256\": \"fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6\"\n        }\n      }\n    ]\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.hiddenlayer.ai/scan-indices/v3/submission', [
  'body' => '{
  "scanner_type": "hl_model_scanner",
  "source": {
    "SAAS": {
      "requester_id": "someone@hiddenlayer.com"
    }
  },
  "scan_result": {
    "file_results": [
      {
        "status": "done",
        "details": {
          "sha256": "fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6"
        }
      }
    ]
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json; charset=utf-8',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.hiddenlayer.ai/scan-indices/v3/submission");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json; charset=utf-8");
request.AddParameter("application/json; charset=utf-8", "{\n  \"scanner_type\": \"hl_model_scanner\",\n  \"source\": {\n    \"SAAS\": {\n      \"requester_id\": \"someone@hiddenlayer.com\"\n    }\n  },\n  \"scan_result\": {\n    \"file_results\": [\n      {\n        \"status\": \"done\",\n        \"details\": {\n          \"sha256\": \"fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6\"\n        }\n      }\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json; charset=utf-8"
]

let postData = NSData(data: "{
  "scanner_type": "hl_model_scanner",
  "source": {
    "SAAS": {
      "requester_id": "someone@hiddenlayer.com"
    }
  },
  "scan_result": {
    "file_results": [
      {
        "status": "done",
        "details": {
          "sha256": "fae6d75cb56ba5d9bf898b5b49a83d635668cf726f0a1b25cf7dbb1b299101d6"
        }
      }
    ]
  }
}".data(using: String.Encoding.utf8)!)

let request = NSMutableURLRequest(url: NSURL(string: "https://api.hiddenlayer.ai/scan-indices/v3/submission")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```