Datashielder API

Customer API
reference.

Use organization-scoped API keys to read scan credits, list targets, inspect target sets, and request manual scans from your own tooling.

Authentication
Bearer API key
Format
JSON over HTTPS
Tenant boundary
Clerk organization

01 / Quick Start

Base URL and request shape

All customer API routes are served from the Datashielder app domain. Send and receive JSON, and authenticate every request with an organization-scoped API key.

Base URL
https://app.datashielder.com
Authorization
Bearer <api_key_secret>
Content-Type
application/json
Example request
curl -H "Authorization: Bearer $DATASHIELDER_API_KEY" \
  https://app.datashielder.com/api/external/targets

02 / Authentication

Organization keys and scopes

API keys are created in Clerk and must be scoped to an organization. Keys with explicit scopes can call only matching routes. Keys created with an empty scope list are treated as full-access organization keys.

ScopeAccess
read:orgRead organization summary, counts, and recent scans.
read:creditsRead scan credit balance and credit history.
read:targetsRead target sets, targets, active state, and latest scan data.
write:targetsCreate target sets and their targets for the organization.
read:reportsRead approved reports and report details for the organization.
read:scan_requestsRead manual scan request history.
write:scan_requestsCreate manual scan requests for targets in the organization.

03 / Endpoints

Available customer routes

GET
/api/external/org

Organization metadata, target counts, open report count, and the 10 most recent scans.

read:org
GET
/api/external/credits

Available credits, total purchased, consumed count, and recent credit history.

read:credits
GET
/api/external/target-sets

All target sets, target counts, domains to watch, latest scan timestamp, and target summaries.

read:targets
POST
/api/external/target-sets

Create a target set with a name, optional domains to watch, and optional target hostnames. Targets are validated for blocked and internal hosts before they are saved.

write:targets
GET
/api/external/targets

All organization targets, including active state, mode, source, counts, latest scan, and pending scan request.

read:targets
GET
/api/external/reports

Approved reports for the organization, with status, scan, target, search, limit, and offset filters.

read:reports
GET
/api/external/reports/{id}

Full approved report details, including content, URLs, reproduction steps, mitigation steps, scan, target, and domain metadata.

read:reports
GET
/api/external/scan-requests

Recent manual scan requests, optionally filtered by pending or fulfilled status.

read:scan_requests
POST
/api/external/scan-requests

Create a manual scan request for a target. Consumes a scan credit unless the organization has an active or trialing subscription.

write:scan_requests

04 / Examples

Common workflows

Check scan credit balance

Use this before offering a manual scan button inside your own portal.

curl
curl -H "Authorization: Bearer $DATASHIELDER_API_KEY" \
  "https://app.datashielder.com/api/external/credits?limit=10"

List active targets

Use target IDs from this response when creating manual scan requests.

curl
curl -H "Authorization: Bearer $DATASHIELDER_API_KEY" \
  "https://app.datashielder.com/api/external/targets?active=true"

List open reports

Status 0 means pending action. Use limit and offset to paginate through larger report sets.

curl
curl -H "Authorization: Bearer $DATASHIELDER_API_KEY" \
  "https://app.datashielder.com/api/external/reports?status=0&limit=100&offset=0"

Create a target set

Pass full hostnames in targets. Their domains are reused or created automatically. A successful request returns 201.

curl
curl -X POST \
  -H "Authorization: Bearer $DATASHIELDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"My set","domainsToWatch":["example.com"],"targets":["api.example.com"]}' \
  https://app.datashielder.com/api/external/target-sets

Request a manual scan

A successful request returns 201. If a pending request already exists, the API returns 409.

curl
curl -X POST \
  -H "Authorization: Bearer $DATASHIELDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"targetId":123}' \
  https://app.datashielder.com/api/external/scan-requests

05 / Errors

Status codes and error bodies

Failed requests return JSON with an `error` field. Validation failures can also include a `details` object.

Error body
{
  "error": "Missing required scope: write:scan_requests"
}
200
The request succeeded.
201
A resource was created, such as a target set or manual scan request.
400
The request body or query string is invalid.
401
The bearer token is missing, empty, invalid, or revoked.
402
No scan credits are available for an organization without an active subscription.
403
The key is not scoped to an organization or lacks the required scope.
404
The requested target or resource does not belong to the organization.
409
A pending scan request already exists for the target.