18 KiB
\RiskAPI
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| GetRiskHealth | Get /v1/risk/health | Whether the risk model plane can actually work right now |
| RiskAdoptModel | Put /v1/risk/state/model | Put one of your organisation's own published model values in force |
| RiskFeatures | Get /v1/risk/features | The feature catalogue: what the model reads, and what your surface carries |
| RiskLearn | Post /v1/risk/learn | Teach your organisation's own model from its own events |
| RiskPolicy | Get /v1/risk/policy | Your organisation's decision-regime history, and which version is in force |
| RiskPublishModel | Post /v1/risk/state/model | Publish your organisation's model as a named, immutable value |
| RiskScore | Post /v1/risk/score | Score one event against your organisation's own model |
| RiskSearch | Post /v1/risk/search | Search exhaustively for the model shape that fits your own history |
| RiskSearchResult | Get /v1/risk/search/{id} | Read back one exhaustive search |
| RiskSetPolicy | Put /v1/risk/policy | State the decision regime: the appetite, the sample, and whether the model is live |
| RiskState | Get /v1/risk/state | Report your organisation's model: what it learned, and what it realised |
GetRiskHealth
GetRiskHealth(ctx).Execute()
Whether the risk model plane can actually work right now
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.RiskAPI.GetRiskHealth(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RiskAPI.GetRiskHealth``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Path Parameters
This endpoint does not need any parameter.
Other Parameters
Other parameters are passed through a pointer to a apiGetRiskHealthRequest struct via the builder pattern
Return type
(empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RiskAdoptModel
RiskRiskModelState RiskAdoptModel(ctx).RiskRiskAdoptIn(riskRiskAdoptIn).Execute()
Put one of your organisation's own published model values in force
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
riskRiskAdoptIn := *openapiclient.NewRiskRiskAdoptIn() // RiskRiskAdoptIn |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.RiskAPI.RiskAdoptModel(context.Background()).RiskRiskAdoptIn(riskRiskAdoptIn).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RiskAPI.RiskAdoptModel``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RiskAdoptModel`: RiskRiskModelState
fmt.Fprintf(os.Stdout, "Response from `RiskAPI.RiskAdoptModel`: %v\n", resp)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiRiskAdoptModelRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| riskRiskAdoptIn | RiskRiskAdoptIn |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RiskFeatures
RiskRiskCatalog RiskFeatures(ctx).Days(days).Execute()
The feature catalogue: what the model reads, and what your surface carries
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
days := int64(30) // int64 | Days is how far back to measure the organisation's own coverage, 1 to 400. Zero takes thirty. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.RiskAPI.RiskFeatures(context.Background()).Days(days).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RiskAPI.RiskFeatures``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RiskFeatures`: RiskRiskCatalog
fmt.Fprintf(os.Stdout, "Response from `RiskAPI.RiskFeatures`: %v\n", resp)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiRiskFeaturesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| days | int64 | Days is how far back to measure the organisation's own coverage, 1 to 400. Zero takes thirty. |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RiskLearn
RiskRiskLearnOut RiskLearn(ctx).RiskRiskLearnIn(riskRiskLearnIn).Execute()
Teach your organisation's own model from its own events
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
riskRiskLearnIn := *openapiclient.NewRiskRiskLearnIn() // RiskRiskLearnIn |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.RiskAPI.RiskLearn(context.Background()).RiskRiskLearnIn(riskRiskLearnIn).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RiskAPI.RiskLearn``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RiskLearn`: RiskRiskLearnOut
fmt.Fprintf(os.Stdout, "Response from `RiskAPI.RiskLearn`: %v\n", resp)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiRiskLearnRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| riskRiskLearnIn | RiskRiskLearnIn |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RiskPolicy
RiskRiskPolicyOut RiskPolicy(ctx).Execute()
Your organisation's decision-regime history, and which version is in force
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.RiskAPI.RiskPolicy(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RiskAPI.RiskPolicy``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RiskPolicy`: RiskRiskPolicyOut
fmt.Fprintf(os.Stdout, "Response from `RiskAPI.RiskPolicy`: %v\n", resp)
}
Path Parameters
This endpoint does not need any parameter.
Other Parameters
Other parameters are passed through a pointer to a apiRiskPolicyRequest struct via the builder pattern
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RiskPublishModel
RiskRiskPublishOut RiskPublishModel(ctx).Execute()
Publish your organisation's model as a named, immutable value
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.RiskAPI.RiskPublishModel(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RiskAPI.RiskPublishModel``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RiskPublishModel`: RiskRiskPublishOut
fmt.Fprintf(os.Stdout, "Response from `RiskAPI.RiskPublishModel`: %v\n", resp)
}
Path Parameters
This endpoint does not need any parameter.
Other Parameters
Other parameters are passed through a pointer to a apiRiskPublishModelRequest struct via the builder pattern
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RiskScore
RiskRiskScoreOut RiskScore(ctx).RiskRiskScoreIn(riskRiskScoreIn).Execute()
Score one event against your organisation's own model
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
riskRiskScoreIn := *openapiclient.NewRiskRiskScoreIn() // RiskRiskScoreIn |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.RiskAPI.RiskScore(context.Background()).RiskRiskScoreIn(riskRiskScoreIn).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RiskAPI.RiskScore``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RiskScore`: RiskRiskScoreOut
fmt.Fprintf(os.Stdout, "Response from `RiskAPI.RiskScore`: %v\n", resp)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiRiskScoreRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| riskRiskScoreIn | RiskRiskScoreIn |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RiskSearch
RiskRiskSearchRun RiskSearch(ctx).RiskRiskSearchIn(riskRiskSearchIn).Execute()
Search exhaustively for the model shape that fits your own history
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
riskRiskSearchIn := *openapiclient.NewRiskRiskSearchIn() // RiskRiskSearchIn |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.RiskAPI.RiskSearch(context.Background()).RiskRiskSearchIn(riskRiskSearchIn).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RiskAPI.RiskSearch``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RiskSearch`: RiskRiskSearchRun
fmt.Fprintf(os.Stdout, "Response from `RiskAPI.RiskSearch`: %v\n", resp)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiRiskSearchRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| riskRiskSearchIn | RiskRiskSearchIn |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RiskSearchResult
RiskRiskSearchReport RiskSearchResult(ctx, id).Execute()
Read back one exhaustive search
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
id := "srch_2f6a1c" // string | ID is the run, taken from the path. A run another organisation started is simply not there — the same answer an unknown id gives.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.RiskAPI.RiskSearchResult(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RiskAPI.RiskSearchResult``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RiskSearchResult`: RiskRiskSearchReport
fmt.Fprintf(os.Stdout, "Response from `RiskAPI.RiskSearchResult`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| id | string | ID is the run, taken from the path. A run another organisation started is simply not there — the same answer an unknown id gives. |
Other Parameters
Other parameters are passed through a pointer to a apiRiskSearchResultRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RiskSetPolicy
RiskRiskPolicyOut RiskSetPolicy(ctx).RiskRiskAppetiteIn(riskRiskAppetiteIn).Execute()
State the decision regime: the appetite, the sample, and whether the model is live
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
riskRiskAppetiteIn := *openapiclient.NewRiskRiskAppetiteIn() // RiskRiskAppetiteIn |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.RiskAPI.RiskSetPolicy(context.Background()).RiskRiskAppetiteIn(riskRiskAppetiteIn).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RiskAPI.RiskSetPolicy``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RiskSetPolicy`: RiskRiskPolicyOut
fmt.Fprintf(os.Stdout, "Response from `RiskAPI.RiskSetPolicy`: %v\n", resp)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiRiskSetPolicyRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| riskRiskAppetiteIn | RiskRiskAppetiteIn |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RiskState
RiskRiskModelState RiskState(ctx).Execute()
Report your organisation's model: what it learned, and what it realised
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.RiskAPI.RiskState(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RiskAPI.RiskState``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RiskState`: RiskRiskModelState
fmt.Fprintf(os.Stdout, "Response from `RiskAPI.RiskState`: %v\n", resp)
}
Path Parameters
This endpoint does not need any parameter.
Other Parameters
Other parameters are passed through a pointer to a apiRiskStateRequest struct via the builder pattern
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]