🔃Add-on: synchronous endpoints
We offer an add-on for Unitary Premium that allows access to synchronous API endpoints. When you send a request to one of these endpoints, the Policy classification results will be returned in the API response. Therefore, these endpoints do not require the integration of webhooks.
Please get in contact ([email protected]) to discuss pricing if you are interested.
POST endpoint reference
This endpoint predicts the policy categories of a single image.
The request must contain a url
form field (a string containing a URL to download the image file from).
Example CURL:
curl --location --request POST "https://api.unitary.ai/v1/classify/policy/image/now" --header "Authorization: Bearer {API_TOKEN}" --header "Content-Type: multipart/form-data" --form "url={RESOURCE_URL}"
Authorizations
Body
callback_urlstring · uri · min: 1 · max: 2083Optional
captionstringOptional
urlstring · uri · min: 1 · max: 65536Optional
Responses
200
Successful Response
application/json
404
Not found
422
Validation Error
application/json
post
POST /classify/policy/image/now HTTP/1.1
Host:
Authorization: Bearer JWT
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 83
"callback_url='https://example.com'&caption='text'&url='https://example.com'"
{
"url": "https://example.com",
"policy_categories": [
{
"name": "ARMS_AMMO",
"description": "Arms & Ammunition",
"risk_level": "high",
"score": 0.8
}
]
}
Last updated
Was this helpful?