---
title: "OAuth flow for Google Drive permission"
method: POST
path: "/grantpermission"
tags: ["GrantPermission"]
---

# OAuth flow for Google Drive permission

`POST /grantpermission`

Handles the OAuth2 flow for granting Google Drive permissions.
- If `token` and `code` are provided, completes the OAuth flow.
- Otherwise, returns an authorization URL to start the flow.

## Request body

- object
  - `token` string — Existing OAuth token (optional)
  - `code` string — OAuth authorization code (optional)
  - `email` string, email, required
  - `file` string, required — Google Drive file ID

## Response `200`

Permission granted or auth URL returned

- union
  - object
    - `message` string
    - `token` string
  - object
    - `url` string, uri

## Other responses

- `400` — Bad request

---

[API](https://skmtc.dev/hackforla/apis/vrms-api.md) · [All operations](https://skmtc.dev/hackforla/apis/vrms-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hackforla/vrms-api/revisions/092c34cc0e58/schema)
