Areev
Areev / Developers

Connect with REST API

Send work from your software, follow its progress and retrieve the supporting evidence.

1. Discover your product’s interface

You need an active deployment with this interface enabled, its deployment ID and its assigned gateway URL. Ask your Areev setup contact for these values. The Store URL and the control API URL are not your deployment’s gateway. A product SKU is not a deployment ID.

GET the deployment descriptor to read its input_schema and available endpoints. The authenticated deployment OpenAPI document describes the input schema, available endpoints and response status codes. Build request.json from that schema; inputs differ by product.

curl --fail-with-body "$AREEV_GATEWAY/v1/agents/$DEPLOYMENT_ID" \
  -H "Authorization: Bearer $AREEV_API_KEY"

curl --fail-with-body "$AREEV_GATEWAY/v1/agents/$DEPLOYMENT_ID/openapi.json" \
  -H "Authorization: Bearer $AREEV_API_KEY"

2. Submit a job

POST the product’s exact input object to /jobs. The response is 202 Accepted and includes the job id and status. Submission is not a completed outcome. Use a unique Idempotency-Key for each intended job and reuse that same key only when retrying the same submission.

curl --fail-with-body "$AREEV_GATEWAY/v1/agents/$DEPLOYMENT_ID/jobs" \
  -H "Authorization: Bearer $AREEV_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $REQUEST_ID" \
  --data-binary @request.json

3. Check progress and retrieve evidence

Poll the job address using the returned job ID. Inspect the returned state and handle unsuccessful or incomplete work explicitly. When evidence is available, the evidence endpoint returns a redirect to the bundle. Treat its location as sensitive; do not forward your API key to another host.

Polling is the supported path shown here. A stream_url in a response does not guarantee that continuous streaming is enabled in your deployment.

curl --fail-with-body "$AREEV_GATEWAY/v1/agents/$DEPLOYMENT_ID/jobs/$JOB_ID" \
  -H "Authorization: Bearer $AREEV_API_KEY"

# Inspect the evidence redirect; do not use --location-trusted.
curl --fail-with-body -D - -o /dev/null \
  "$AREEV_GATEWAY/v1/agents/$DEPLOYMENT_ID/jobs/$JOB_ID/evidence" \
  -H "Authorization: Bearer $AREEV_API_KEY"