Endpoints
Call these through the okoro proxy at https://okoro.ai/p/google-drive
| Action | Method | Path | Min scope |
|---|---|---|---|
| Read drive info | GET | read | |
| List files | GET | read | |
| Read file | GET | read | |
| Export file | GET | read | |
| Create file | POST | write | |
| Copy file | POST | write | |
| Update file | PATCH | update | |
| Delete file | DELETE | delete | |
| Read permission | GET | read | |
| Share file | POST | write | |
| Remove permission | DELETE | delete |
Examples
Every request requires a short-lived operation token scoped to a single action.
1. Get an operation token
Exchange your service token for a short-lived operation token scoped to a single action.
TOKEN=$(curl -sX POST "https://okoro.ai/t/tokens" \
-H "Authorization: Bearer $OKORO_SERVICE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"provider": "google-drive", "scope": "read", "intent": "describe what you are doing"}' \
| jq -r '.token')2. Call the API
Use the operation token as a Bearer token. The proxy forwards the request to Google Drive and logs the action.
Read drive info
curl -X GET "https://okoro.ai/p/google-drive/about" \
-H "Authorization: Bearer $TOKEN"List files
curl -X GET "https://okoro.ai/p/google-drive/files" \
-H "Authorization: Bearer $TOKEN"Read file
curl -X GET "https://okoro.ai/p/google-drive/files/{id}" \
-H "Authorization: Bearer $TOKEN"Export file
curl -X GET "https://okoro.ai/p/google-drive/files/{id}/export" \
-H "Authorization: Bearer $TOKEN"Create file
curl -X POST "https://okoro.ai/p/google-drive/files" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Copy file
curl -X POST "https://okoro.ai/p/google-drive/files/{id}/copy" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Update file
curl -X PATCH "https://okoro.ai/p/google-drive/files/{id}" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Delete file
curl -X DELETE "https://okoro.ai/p/google-drive/files/{id}" \
-H "Authorization: Bearer $TOKEN"Read permission
curl -X GET "https://okoro.ai/p/google-drive/permissions/{id}" \
-H "Authorization: Bearer $TOKEN"Share file
curl -X POST "https://okoro.ai/p/google-drive/permissions" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Remove permission
curl -X DELETE "https://okoro.ai/p/google-drive/permissions/{id}" \
-H "Authorization: Bearer $TOKEN"Scopes
Your service token must be configured with at least the required scope level.
readGET/drive/v3/about
/drive/v3/files
/drive/v3/files/*
/drive/v3/files/*/export
/drive/v3/files/*/permissions
/drive/v3/files/*/permissions/*writeGET
POST/drive/v3/files
/drive/v3/files/*
/drive/v3/files/*/copy
/upload/drive/v3/filesupdateGET
POST
PATCH/drive/v3/files/*
/drive/v3/files/*/permissions
/drive/v3/files/*/permissions/*
/upload/drive/v3/files/*deleteGET
POST
PATCH
DELETE/drive/v3/files/*
/drive/v3/files/*/permissions/*allGET
POST
PATCH
DELETE/drive/v3/**
/upload/drive/v3/**