# Initiate OAuth Authorization Start the OAuth flow for a connector. #### Query Parameters **`organization_id`** string required Organization ID (e.g., `org_722dd7...`). #### Request Body **`connector_type`** enum required One of: `atlassian`, `github`, `clickup`, `notion`. ## Returns An object containing the OAuth authorization URL and state parameter for CSRF protection. Atlassian ```bash curl -X POST "https://api.aitronos.com/v1/personal-connectors/authorize?organizationId=org_722dd7..." \ -H "X-API-Key: $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "connector_type": "atlassian" }' ``` ```python import requests import os api_key = os.environ.get("FREDDY_API_KEY") headers = { "X-API-Key": api_key, "Content-Type": "application/json" } response = requests.post( "https://api.aitronos.com/v1/personal-connectors/authorize", params={"organization_id": "org_722dd7..."}, headers=headers, json={ "connector_type": "atlassian" } ) result = response.json() print(f"Authorization URL: {result['authorization_url']}") ``` ```javascript const response = await fetch( 'https://api.aitronos.com/v1/personal-connectors/authorize?organizationId=org_722dd7...', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.FREDDY_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ connector_type: 'atlassian' }) } ); const result = await response.json(); console.log(`Authorization URL: ${result.authorization_url}`); ``` GitHub ```bash curl -X POST "https://api.aitronos.com/v1/personal-connectors/authorize?organizationId=org_722dd7..." \ -H "X-API-Key: $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "connector_type": "github" }' ``` **Response:** 200 OK ```json { "authorization_url": "https://auth.atlassian.com/authorize?...", "state": "abc123def456" } ``` 400 Bad Request ```json { "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Invalid request parameters", "system_message": "Validation failed", "type": "validation_error", "status": 400, "trace_id": "req_xyz789", "timestamp": "2025-11-13T10:30:00Z" } } ``` 401 Unauthorized ```json { "success": false, "error": { "code": "UNAUTHORIZED", "message": "Authentication required. Please provide a valid API key.", "system_message": "Missing or invalid authorization header", "type": "authentication_error", "status": 401, "trace_id": "req_abc123", "timestamp": "2025-11-13T10:30:00Z" } } ``` 403 Forbidden ```json { "success": false, "error": { "code": "FORBIDDEN", "message": "You do not have permission to perform this action.", "system_message": "Insufficient permissions", "type": "authorization_error", "status": 403, "trace_id": "req_def456", "timestamp": "2025-11-13T10:30:00Z" } } ``` 429 Rate Limit ```json { "success": false, "error": { "code": "RATE_LIMIT_EXCEEDED", "message": "Too many requests. Please try again later.", "system_message": "Rate limit exceeded for endpoint", "type": "rate_limit_error", "status": 429, "details": { "retry_after": 60, "limit": 100, "remaining": 0, "reset_at": "2025-11-13T10:31:00Z" }, "trace_id": "req_ghi789", "timestamp": "2025-11-13T10:30:00Z" } } ``` 500 Server Error ```json { "success": false, "error": { "code": "INTERNAL_SERVER_ERROR", "message": "An unexpected error occurred. Please try again later.", "system_message": "Database connection timeout", "type": "server_error", "status": 500, "trace_id": "req_jkl012", "timestamp": "2025-11-13T10:30:00Z" } } ```