Overview
Registers a named credential that the authenticate task action can resolve at run time. The raw username/password never touch ScrapEngine — only the vault integration ID, the path inside your vault, and the field names to read are stored here. Each credential is scoped to one or more hostnames via allowedDomains; the authenticate action refuses to use a credential on any other host.
Body
Human-readable name. 1-100 characters.
UUID of the vault integration that will be used to read the secret. Created via POST /vault-integrations.
Path inside your vault. For HashiCorp KV v2 use the logical path (for example secret/data/login-alice).
Maps the field names stored inside the vault secret to the roles the authenticate action understands. Vault field name that holds the username.
Vault field name that holds the password.
Optional vault field name for a TOTP seed (MFA).
Hostnames this credential may be used on. At least one entry is required. Plain entries match the exact hostname; *.example.com matches subdomains but NOT the bare host. Wildcard-only (*) is rejected.
Example Request
curl -X POST "https://api.scrapengine.io/api/v1/credentials" \
-H "Authorization: Bearer $SCRAPENGINE_API_KEY " \
-H "Content-Type: application/json" \
-d '{
"name": "Alice @ app.example.com",
"vaultIntegrationId": "5f8c6a74-5f2e-4f5a-9e58-5b9c3c7d2a11",
"vaultPath": "secret/data/login-alice",
"fieldMap": {
"username": "username",
"password": "password",
"totp": "totp_seed"
},
"allowedDomains": ["app.example.com", "*.internal.example.com"]
}'
Response
Success Response (201)
Credential ID (UUID). Reference this from the authenticate task action.
The vault integration this credential reads from.
The vault path this credential reads from.
The stored field-name mapping, echoed back.
The stored allow-list of hostnames, echoed back.
Example Response:
{
"id" : "2b5aa4c8-b9e6-4e58-9c80-1d4bfd0a3f01" ,
"name" : "Alice @ app.example.com" ,
"vaultIntegrationId" : "5f8c6a74-5f2e-4f5a-9e58-5b9c3c7d2a11" ,
"vaultPath" : "secret/data/login-alice" ,
"fieldMap" : {
"username" : "username" ,
"password" : "password" ,
"totp" : "totp_seed"
},
"allowedDomains" : [ "app.example.com" , "*.internal.example.com" ],
"createdAt" : "2026-04-24T09:12:44Z" ,
"updatedAt" : "2026-04-24T09:12:44Z"
}
Error Responses
Status Description 400Invalid body, unknown vaultIntegrationId, or disallowed domain pattern (for example *). 401Unauthorized — invalid or missing API key.