PowerSchool API Postman Collection

PowerSchool API Postman Collection, feel free to copy to fork it

Overview

This collection provides a complete, production-ready setup for working with PowerSchool APIs. It implements automatic OAuth authentication with token validation, eliminating manual token management and enabling seamless multi-environment workflows.

Key Features

๐Ÿ” Automatic Authentication

  • Zero Manual Token Management: Tokens are obtained and validated automatically before every request
  • Smart Token Validation: Validates tokens against the PowerSchool metadata endpoint (/ws/v1/metadata)
  • Auto-Refresh on Expiry: Automatically refreshes expired or invalid tokens
  • Bearer Token Headers: All requests automatically include properly formatted Authorization: Bearer {{psAuthToken}} headers

๐ŸŒ Multi-Environment Support

  • Different PowerSchool Instances: Easily switch between multiple PowerSchool servers (Development, Staging, Production)
  • Credential Isolation: Each environment has its own psURL, psClientID, and psClientSecret
  • Shared Token Storage: psAuthToken stored at collection level, shared across all environments
  • One-Click Switching: Select different environments from Postman dropdown

โœ… Token Validation

  • Metadata Endpoint Check: Validates token by calling /ws/v1/metadata
  • Plugin ID Detection: Confirms token validity by checking for plugin_id in response
  • Automatic Recovery: If token is invalid, automatically obtains a new one
  • Error Prevention: Detects authentication issues before they cause request failures

๐Ÿ“‹ Complete Request Examples

  • PowerSchool OAuth Request: Direct OAuth endpoint for manual token retrieval
  • Get Metadata (with token): Example of authenticated request
  • Get Metadata (without token): Shows public metadata access
  • Get Students By District: Production-ready example with auto-auth

How It Works

Request Flow

When you click Send on any request:

1. Collection Pre-request Script Runs
   โ†“
2. Check: Does psAuthToken exist?
   โ”œโ”€ NO  โ†’ Obtain new token via OAuth
   โ”œโ”€ YES โ†’ Validate token via /ws/v1/metadata
   โ”‚        โ”œโ”€ Valid (has plugin_id) โ†’ Proceed
   โ”‚        โ””โ”€ Invalid (no plugin_id) โ†’ Get new token
   โ†“
3. Token stored in psAuthToken (collection variable)
   โ†“
4. Request executes with Authorization: Bearer {{psAuthToken}}
   โ†“
5. Response received

Token Validation Logic

Valid Token Response:

{
    "metadata": {
        "plugin_id": 15334,
        "powerschool_version": "25.7.0.1.252121950",
        ...
    }
}

Invalid Token Response:

{
    "metadata": {
        "district_timezone": "Asia/Riyadh",
        ...
        (NO plugin_id field)
    }
}

The script detects missing plugin_id and automatically refreshes the token.

Setup Instructions

1. Create Environments

For each PowerSchool instance, create an environment with:

VariableValue
psURLhttps://your-powerschool-domain.com
psClientIDYour OAuth client ID
psClientSecretYour OAuth client secret

2. Collection Variables

The collection already includes:

  • psAuthToken – Auto-populated by OAuth script (do not edit)

3. Select Environment

Before making requests, select your environment from the Postman dropdown (top-right).

4. Make Requests

Click Send on any request. The collection pre-request script handles all authentication automatically.

Collection Structure

PowerSchool API Postman Collection
โ”œโ”€โ”€ Authentication (Collection-level Pre-request Script)
โ”‚   โ”œโ”€โ”€ Token validation against /ws/v1/metadata
โ”‚   โ”œโ”€โ”€ Auto-refresh on expiry
โ”‚   โ””โ”€โ”€ Error handling
โ”‚
โ”œโ”€โ”€ PowerSchool OAuth Request (POST)
โ”‚   โ””โ”€โ”€ Direct OAuth endpoint access
โ”‚   โ””โ”€โ”€ Manual token retrieval (for testing)
โ”‚
โ”œโ”€โ”€ Get Metadata (with token) (GET)
โ”‚   โ””โ”€โ”€ Authenticated metadata endpoint
โ”‚   โ””โ”€โ”€ Shows valid token usage
โ”‚
โ”œโ”€โ”€ Get Metadata (without token) (GET)
โ”‚   โ””โ”€โ”€ Public metadata access
โ”‚   โ””โ”€โ”€ Shows response without authentication
โ”‚
โ””โ”€โ”€ Get Students By District (GET)
    โ””โ”€โ”€ Example authenticated API request
    โ””โ”€โ”€ Returns district student data

Variables Reference

Collection Variables

  • psAuthToken – OAuth access token (auto-populated, do NOT manually edit)

Environment Variables (Set per PowerSchool instance)

  • psURL – PowerSchool domain (e.g., https://ps.asb.bh)
  • psClientID – OAuth client ID from PowerSchool admin
  • psClientSecret – OAuth client secret from PowerSchool admin

Console Logging

The collection provides detailed console logging for debugging:

Successful Token Validation:

โš  Validating existing token...
โœ“ Token is valid. Plugin ID: 15334
โœ“ Auth token already set, proceeding...

Token Refresh:

โš  Validating existing token...
โš  Token is invalid. No plugin_id in metadata response
โš  Token is invalid, getting new one...
โš  Getting new authentication token...
โœ“ New token obtained successfully

Missing Credentials:

โœ— Missing required variables: psURL, psClientID, or psClientSecret

Open Postman Console (bottom-left) to view all logs.

Common Use Cases

Adding New PowerSchool API Endpoints

  1. Click “+” to add new request to collection
  2. Set method and URL: {{psURL}}/ws/v1/[endpoint]
  3. Add headers:
    • Authorization: Bearer {{psAuthToken}}
    • Accept: application/json
  4. Click Save

The collection pre-request script automatically handles authentication for all new requests.

Switching Between PowerSchool Instances

  1. Open Postman
  2. Click environment dropdown (top-right)
  3. Select desired environment
  4. Make request – collection script uses selected environment’s credentials

Manual OAuth Testing

  1. Click PowerSchool OAuth Request
  2. Verify environment is selected
  3. Click Send
  4. Token is extracted and stored in psAuthToken
  5. Check console for success/error messages

Validating Token Status

  1. Click Get Metadata (with token)
  2. Click Send
  3. Response shows current metadata with or without plugin_id
  4. If plugin_id is present, token is valid
  5. If plugin_id is missing, token will auto-refresh on next request

Error Handling

“Missing required variables”

Cause: Environment variables not set Solution: Add psURL, psClientID, psClientSecret to selected environment

“OAuth request failed with status 401”

Cause: Incorrect credentials Solution: Verify OAuth client ID and secret in PowerSchool admin portal

“Token is invalid. No plugin_id in metadata response”

Cause: Token lacks required permissions or is expired Solution: Token auto-refreshes automatically on next request

“Authorization header empty”

Cause: Token didn’t load before request executed Solution: Wait a moment and retry, or manually run OAuth request first

Best Practices

Security

  • โœ“ Never commit real credentials to version control
  • โœ“ Use Postman environments to store sensitive data
  • โœ“ Treat psClientSecret like a password
  • โœ“ Rotate OAuth credentials periodically

Organization

  • โœ“ Use meaningful request names
  • โœ“ Group related endpoints in folders
  • โœ“ Document expected responses in request descriptions
  • โœ“ Keep collection pre-request script clean and updated

Maintenance

  • โœ“ Test collection monthly with all environments
  • โœ“ Monitor PowerSchool API changes
  • โœ“ Update endpoints as PowerSchool APIs evolve
  • โœ“ Keep OAuth credentials current

API Endpoints Included

EndpointMethodPurpose
/oauth/access_tokenPOSTOAuth token retrieval
/ws/v1/metadataGETSystem metadata (with & without token)
/ws/v1/districtGETDistrict information

Next Steps

  1. Create Environments: Add your PowerSchool instances as separate environments
  2. Set Credentials: Configure psURL, psClientID, psClientSecret per environment
  3. Test Collection: Run requests and verify token validation in console
  4. Extend Collection: Add more endpoints as needed using the same patterns

Support & Troubleshooting

Check Console Logs

Open Postman Console (bottom of screen) to see detailed execution logs including:

  • Token validation results
  • OAuth request status
  • Variable resolution
  • Error messages

Validate Token Manually

  1. Run Get Metadata (with token)
  2. Look for "plugin_id" in response
  3. If present: Token is valid โœ“
  4. If missing: Token needs refresh (auto-handled)

Test OAuth Endpoint

  1. Run PowerSchool OAuth Request
  2. Check console for:
    • โœ“ Set psAuthToken as [token] – Success
    • โœ— OAuth failed... – Check credentials

FAQ

Q: Do I need to manually get a token? A: No. The collection automatically manages tokens. Manual OAuth request is only for testing.

Q: Can I use this with multiple PowerSchool instances? A: Yes. Create separate environments for each instance and switch between them.

Q: What happens if my token expires? A: The collection automatically detects expiry and refreshes the token before the next request.

Q: Where is my token stored? A: In the collection variable psAuthToken. It persists across environment switches.

Q: Can I see what the script is doing? A: Yes. Open Postman Console (Ctrl+Alt+C or Cmd+Option+C) to view detailed logs.

Q: How often do tokens refresh? A: Only when they expire or are invalid. Valid tokens are reused across requests.


Author: Prince PARK
Version: 1.0
Last Updated: March 26, 2026
Created For: PowerSchool API Integration
Requires: Postman 10.0+