Skip to main content

API Overview

StackGuardian APIs use predictable, resource-oriented URLs, accept JSON-encoded request bodies, and return JSON-encoded responses. The API uses standard HTTP response codes and verbs to indicate success or failure.

Base URL: Use this as the base for all API endpoints. https://api.app.stackguardian.io/api/v1

Authentication

Authenticate against the StackGuardian API using an API Key. Generate the API Key in your Organization's settings, then pass it in the Authorization HTTP header:

Authorization: apikey <API_KEY>

Steps to Generate an API Key

Access, generate, and use StackGuardian API key for secure authenticated requests.

1. Open the API Key Tab

To access your API key:

  • Click on profile, navigate Profile Settings → API Key

2. Generate and Copy the API Key

Manage current API key or generate a new one.

Viewing an Existing Key

Click the View button to reveal currently active API key.

  • The key will be masked by default. Once visible, you can use the Copy button to copy it securely.
note

Keep the key confidential and store it in a secure password manager.

Regenerating the API Key

If you want to invalidate the current key and create a new one:

  • Click the Regenerate button. This action deactivates the existing key and replaces it with a new one.

3. Making Requests

Once your key is copied, you can use it to authenticate HTTP requests to the StackGuardian API.

curl -H "Authorization: apikey <API_KEY>" https://api.app.stackguardian.io/api/v1/orgs/<ORG_NAME>/
info

You can run the command directly in a Unix-based terminal (Linux/macOS) or via Git Bash or WSL on Windows.

Errors

StackGuardian APIs follow standard HTTP response codes:

Status CodeDescription
200 - OKRequest was successful.
204 - OKRequest was successful, but no content to return.
400 - Bad RequestRequest was invalid due to missing or incorrect parameters.
401 - UnauthorizedInvalid or expired API Key.
403 - ForbiddenAccess to the requested resource is not permitted.
404 - Not FoundResource does not exist.
5xx - Server ErrorServer encountered an issue. Please report it to support.

Reporting Issues

If you encounter any issues: