Skip to content

Quickstart

This quickstart assumes your platform team has already given you a Cognito domain, app client id, and any client secret required for your integration.

Use the docs site for the same environment you are calling. The examples below are rewritten during deployment so the API and Cognito URLs match the environment serving the docs.

Machine-to-machine integrations usually use Cognito’s client credentials grant. Request only the scopes your integration needs.

Terminal window
TOKEN="$(
curl -s -X POST "https://streamline-production-streamline-auth.auth.ap-southeast-2.amazoncognito.com/oauth2/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=<app-client-id>" \
-d "client_secret=<app-client-secret>" \
-d "scope=streamline/read_models streamline/run_inference" \
| jq -r .access_token
)"

Human users sign in with their Cognito username and password using the user-pool app client provided by your platform team. Their access token includes groups such as admin or client:{client_id}. Send that access token to PIE as a bearer token.

Authorization: Bearer <access_token>

GET /v2/health is public and does not require a token.

Terminal window
curl "https://pie.streamline.enterprises/v2/health"

List models to confirm your token has access to the API.

Terminal window
curl "https://pie.streamline.enterprises/v2/models" \
-H "Authorization: Bearer ${TOKEN}"

If this returns 401, the token is missing, expired, or rejected. If it returns 403, the token is valid but does not grant the permission required by the operation.

Before wiring a production flow, read: