Repository navigation
Configuration and Authentication
Before you can make a call, the client needs three pieces of information.
| Value | What it is | Example |
|---|---|---|
| Host | Your Strobes platform domain |
mycorp.strobes.co, mycorp.in.strobes.co, mycorp.us.strobes.co
|
| API Token | A per-user token that authenticates every request |
9f3c… (long alphanumeric string) |
| Organization ID | The UUID of the organization you're working in | 0c5c2d61-4a3a-4a58-9b4b-4a1b9f0f2f11 |
- Open your Strobes platform in a browser and log in.
- Go to Settings (top-right).
- Select API Access.
- Click Generate Token and copy the token.
- Note the Organization ID shown on the same page.
🎥 Video: Getting your API token and org ID
Treat the token like a password. It grants API access to your organization's data. Don't commit it to source control or paste it into shared channels. Prefer environment variables (below) over hard-coding.
The client is constructed explicitly with a host and token:
StrobesGQLClient(host="mycorp.strobes.co", api_token="<token>")Every request is sent to https://<host>/api/public/graphql/ with the header
Authorization: token <api_token>.
strobes_gql_client/enums.py provides convenient defaults so you don't have to
repeat these values. There are two common ways to supply them.
enums.py reads two environment variables:
# strobes_gql_client/enums.py (excerpt)
API_TOKEN = os.getenv('STROBES_API_TOKEN')
ORGANIZATION_ID = os.getenv('STROBES_ORGANIZATION_ID')
APP_HOST = "automate.in.strobes.co" # change to your hostSet them in your shell:
export STROBES_API_TOKEN="<your-api-token>"
export STROBES_ORGANIZATION_ID="<your-org-uuid>"Then in code:
from strobes_gql_client.client import StrobesGQLClient
from strobes_gql_client import enums
client = StrobesGQLClient(host=enums.APP_HOST, api_token=enums.API_TOKEN)Set
APP_HOSTinenums.pyto your own domain, or passhost=explicitly when you construct the client.
# strobes_gql_client/enums.py
USER_AGENT = "strobes-python-gql-client"
APP_PORT = 443
APP_SCHEME = "https"
APP_HOST = "mycorp.strobes.co" # your domain
API_TOKEN = "your_api_token_here" # your token
ORGANIZATION_ID = "your_organization_uuid" # your org idLeave APP_SCHEME and APP_PORT as-is unless you're on a non-standard setup.
StrobesGQLClient(host, api_token, verify=True)| Argument | Default | Description |
|---|---|---|
host |
— | Your platform domain (no scheme, no trailing slash). |
api_token |
— | The API token from Settings → API Access. |
verify |
True |
TLS certificate verification. Set False only for a host with a self-signed cert (not recommended in production). |
The scheme (https) and port (443) come from enums.py and rarely need
changing.
Run the bundled script:
python examples/test-connectivity-example.pyOr do it inline:
from strobes_gql_client.client import StrobesGQLClient
from strobes_gql_client import enums
client = StrobesGQLClient(host=enums.APP_HOST, api_token=enums.API_TOKEN)
resp = client.execute_query("all_assets", organization_id=enums.ORGANIZATION_ID)
assets = resp.get("data", {}).get("allAssets", {}).get("objects", [])
print(f"Connected — {len(assets)} assets visible")If an asset count prints without error, you're ready. If not, see Troubleshooting.
Getting started
Guides
- Search Query Language
- Assets
- Findings
- Engagements
- Comments
- Vault Documents
- Reports
- Exporting Data
- Connectors & Scan Logs
- File Uploads & CSV Imports
Reference