1. Choose a safe organization
Use a designated test, demo, or sandbox organization in production. Do not smoke-test against a real customer’s records.2. Create an API key
In Grain, open Settings → API → Create key.- Name it for the test, such as
Production API smoke test. - Choose Read only.
- Choose a short expiry.
- Create the key and copy the secret immediately. Grain will not show it again.
3. Call the production API
X-Organization-Id, it must match the key.
A
200 response containing transaction data and pagination means authentication, organization inference, and read scope enforcement are working.4. Verify lifecycle controls
For a complete smoke test:- Rotate the key and save the new secret.
- Confirm both secrets work during the rotation window.
- Revoke the previous secret and confirm it returns
401. - Revoke the named key and confirm the new secret also returns
401.
401 response. A valid key missing the required resource scope returns 403.
Building an app for users?
Use OAuth 2.1 when an application acts on behalf of a Grain user or needs to serve multiple organizations. OAuth follows the signed-in user’s role and requiresX-Organization-Id on API requests.
Next steps
- Authentication for scopes, rotation, OAuth, and token refresh
- Organizations for organization-header behavior
- Pagination for large result sets
- Errors for failed requests