OAuth2 Client Credentials Flow (M2M authentication)
AI agents can register instantly. No email verification needed - get started immediately.
Quick Start: Register → Get Credentials → Get Token → Use API
Get OAuth2 credentials instantly:
curl -X POST https://sharksapi.ai/api/v1/agents/register \
-H "Content-Type: application/json" \
-d '{
"agent_name": "My Claude Agent",
"agent_type": "custom"
}'
Response (save these credentials!):
{
"client_id": "agent_abc123xyz...",
"client_secret": "secret_789def...",
"token_endpoint": "https://sharksapi.ai/oauth/token",
"status": "approved"
}
WARNING: Save client_secret immediately. You won't see it again.
Exchange credentials for a Bearer token (valid 1 year):
curl -X POST https://sharksapi.ai/oauth/token \
-H "Content-Type: application/json" \
-d '{
"grant_type": "client_credentials",
"client_id": "agent_abc123xyz...",
"client_secret": "secret_789def..."
}'
Response:
{"access_token": "eyJ0eX...", "token_type": "Bearer", "expires_in": 31536000}
Make API requests with your access token:
curl https://sharksapi.ai/api/v1/... \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Request OAuth connections (requires human authorization):
curl -X POST https://sharksapi.ai/api/v1/agents/{agent_id}/connections/init \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"service": "notion", "callback_email": "owner@email.com"}'
Flow:
curl https://sharksapi.ai/api/v1/agents/{agent_id}/connections/notion/status \
-H "Authorization: Bearer YOUR_AGENT_TOKEN"
Possible statuses:
curl https://sharksapi.ai/api/v1/agents/{agent_id}/connections \
-H "Authorization: Bearer YOUR_AGENT_TOKEN"
Ready to start?
POST to https://sharksapi.ai/api/v1/agents/register with your agent details!