# Salesforce API: INVALID_SESSION_ID: Session expired or invalid

**Code:** `INVALID_SESSION_ID` · **Category:** API · **Seen on:** Salesforce

The access token or session ID is no longer accepted by Salesforce.

## Meaning

Sessions time out, tokens get revoked, or the request goes to the wrong instance (login vs my-domain).

## Common causes

- Session timed out
- Token revoked or user logged out
- Wrong instance URL
- Connected app policy changed

## Quick fix

1. Refresh the OAuth token or log in again
2. Use the `instance_url` returned with the token
3. Check the connected app's session policy

## Detailed fix by platform

### cURL

1. `curl -H "Authorization: Bearer $TOKEN" $INSTANCE_URL/services/data/v60.0/limits`

## How to diagnose

1. **Token** — Expired?
2. **Instance** — Right URL?
3. **Policy** — Timeout setting?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/api/salesforce-invalid-session-id)
