2 endpoints

Authentication

Manage API keys and tokens

POST

Create an access token

/auth/token

Exchange your API key for a short-lived access token.

Request Body

application/json

api_keystringrequired

Your API key from the dashboard

Example: "ps_live_abc123def456"

expires_innumber

Token TTL in seconds (default 3600)

Example: 7200

Code Examples

curl -X POST "https://api.pipesolar.com/v1/auth/token" \
  -H "Authorization: Bearer ps_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "ps_live_abc123def456",
  "expires_in": 7200
}'

Response

Example Response
{
  "access_token": "eyJhbGciOiJIUzI1NiIs...",
  "token_type": "Bearer",
  "expires_in": 7200
}

Playground

POST/auth/tokenTry it
POST

Revoke an access token

/auth/revoke

Invalidate an existing access token immediately.

Request Body

application/json

tokenstringrequired

The access token to revoke

Code Examples

curl -X POST "https://api.pipesolar.com/v1/auth/revoke" \
  -H "Authorization: Bearer ps_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "token": "example"
}'

Response

Example Response
{
  "revoked": true
}

Playground

POST/auth/revokeTry it