Provider Disconnect (HTTPS, Dev)¶
Disconnect an authorized provider and optionally delete its instance.
Purpose¶
Revoke a provider connection for a user and clean up resources if needed.
Prerequisites¶
- Dev environment running with TLS
- Authenticated user (have
ACCESS_TOKENfrom login flow) - An existing provider instance (have
PROVIDER_IDfrom onboarding flow)
make dev-up
BASE_URL=https://localhost:8000
# From previous flows
echo $ACCESS_TOKEN >/dev/null
echo $PROVIDER_ID >/dev/null
Steps¶
1) Disconnect provider session (invalidate connection)¶
curl -sk -X DELETE "$BASE_URL/api/v1/auth/$PROVIDER_ID/disconnect" \
-H "Authorization: Bearer $ACCESS_TOKEN" | python3 -m json.tool
Expected (snippet):
2) Verify provider status¶
curl -sk "$BASE_URL/api/v1/providers/$PROVIDER_ID" \
-H "Authorization: Bearer $ACCESS_TOKEN" | python3 -m json.tool
Expected (snippet):
3) (Optional) Delete provider instance¶
curl -sk -X DELETE "$BASE_URL/api/v1/providers/$PROVIDER_ID" \
-H "Authorization: Bearer $ACCESS_TOKEN" | python3 -m json.tool
Troubleshooting¶
- 404: provider not found → ensure
PROVIDER_IDis correct and belongs to the user - 403: missing/invalid Authorization header → ensure
ACCESS_TOKENis valid - SSL: use
-kwith curl in dev to accept self-signed certs
Related Flows¶
- Prerequisites: Provider Onboarding - Must have connected provider first
- Authentication: Login - Need valid access token
- Complete flow: Complete Auth Flow - Full authentication testing
- Architecture: JWT Authentication - Understanding auth requirements
Document Information¶
Template: api-flow-template.md Created: 2025-10-15 Last Updated: 2025-10-15