{"openapi":"3.0.3","info":{"title":"Digits Connect API - OAuth Authorization","version":"1.0","description":"OAuth 2.0 authorization endpoint for the Digits Connect API.\nThis endpoint is a special handler in grpc-gateway and is not part of the auto-generated spec.\n"},"servers":[{"url":"https://connect.digits.com","description":"Production"}],"paths":{"/v1/oauth/authorize":{"get":{"tags":["AuthorizationService"],"summary":"Authorize","description":"Initiates the OAuth 2.0 authorization flow by redirecting users to authorize your application.\n\nAfter the user authorizes your application, they will be redirected to your `redirect_uri` with the authorization code as a query parameter.\n\n**Example Usage:**\n\n```\nhttps://connect.digits.com/v1/oauth/authorize?response_type=code &client_id=<your_client_id_here> &redirect_uri=<valid_redirect_url> &scope=source%3Async%20ledger%3Aread%20documents%3Awrite &state=<random_state_string>\n```\n\n**Redirect Response:**\nAfter authorization, the user will be redirected to:\n\n```\nhttps://yourapp.com/oauth/callback?code=base64_encoded_authorization_code&state=random_state_string\n```\n","operationId":"OAuth_Authorize","parameters":[{"name":"response_type","in":"query","required":true,"description":"Must be set to \"code\" for authorization code grant type","schema":{"type":"string","enum":["code"]},"example":"code"},{"name":"client_id","in":"query","required":true,"description":"Your application's Client ID from the Digits developer portal","schema":{"type":"string"},"example":"your_client_id_here"},{"name":"redirect_uri","in":"query","required":true,"description":"Must exactly match one of your registered redirect URIs","schema":{"type":"string","format":"uri"},"example":"https://yourapp.com/oauth/callback"},{"name":"scope","in":"query","required":true,"description":"Space-separated list of requested scopes:\n- `source:sync` - Write ledger data to Digits\n- `ledger:read` - Read ledger data from Digits\n- `documents:write` - Upload and manage documents\n- `organization:sync` - Manage clients, entities, and roles\n- `user:sync` - Manage users\n","schema":{"type":"string"},"example":"source:sync ledger:read documents:write"},{"name":"state","in":"query","required":false,"description":"Random string to prevent CSRF attacks. Highly recommended for security.","schema":{"type":"string"},"example":"random_state_string_12345"}],"responses":{"302":{"description":"Redirect to authorization page. The user will be prompted to authorize your application.\nAfter authorization, they will be redirected to your redirect_uri with the authorization code.\n","headers":{"Location":{"description":"URL to the authorization page","schema":{"type":"string"}}}},"400":{"description":"Bad Request - Missing required query parameters","content":{"text/plain":{"schema":{"type":"string","example":"Missing required URL parameters: client_id, redirect_uri"}}}}},"security":[]}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2.0 Bearer token. Include the access token in the Authorization header:\n`Authorization: Bearer <access_token>`\n"}}}}