# Handle OAuth Callback Process the OAuth callback and create the personal connector. This endpoint is called automatically by the OAuth provider after user authorization. #### Query Parameters **`code`** string required Authorization code from OAuth provider. **`state`** string optional State token for CSRF protection (from authorize endpoint). Note: ClickUp doesn't return this parameter. **`error`** string optional Error from OAuth provider if auth failed. ## Returns The created personal connector configuration object. Request ```bash curl "https://api.aitronos.com/v1/personal-connectors/callback?code=abc123&state=abc123def456..." ``` ```python import requests response = requests.get( "https://api.aitronos.com/v1/personal-connectors/callback", params={ "code": "abc123", "state": "abc123def456..." } ) connector = response.json() print(f"Connector created: {connector['connectorId']}") ``` ```javascript const response = await fetch( 'https://api.aitronos.com/v1/personal-connectors/callback?code=abc123&state=abc123def456...' ); const connector = await response.json(); console.log(`Connector created: ${connector.connectorId}`); ``` **Response:** 200 OK ```json { "success": true, "data": {} } ``` 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" } } ```