How to connect Google Photos to Composio

4 min read

Composio connects AI agents to Google Photos so they can view and manage photos and albums created through your OAuth app.

Use your own Google OAuth app to control its credentials and the permissions your workflow requests.

Use a Google account with Google Photos and a Google Cloud project you can manage. To see media in the Library API, use items created by the same app.

Part 1. Set up your Google OAuth app

Step 1. Select a project and enable the API

Open Google Cloud Console and select the project that will own your OAuth client.

Choose the Google Cloud project that owns your OAuth app

In APIs & Services → Library, find the service for your workflow. Enable the Photos Library API (photoslibrary.googleapis.com) in your Google Cloud project.

Step 2. Configure branding and audience

Open Google Auth Platform → Branding. Enter an app name, support email, and developer contact details.

Set up app branding and contact information

Under Audience, choose the audience that matches your users. For an external app in Testing, add the accounts you will use under Test users.

Choose the audience and add test users when needed

Step 3. Choose permissions for your workflow

Open Google Auth Platform → Data Access and select Add or remove scopes. Add the scopes your workflow needs and save.

Use photoslibrary.readonly.appcreateddata for the example that lists app-created albums. Add the applicable append or edit scope when your workflow creates or updates media. Google removed the old library-wide read and sharing scopes in March 2025.

The example requests https://www.googleapis.com/auth/photoslibrary.readonly.appcreateddata. Choose scopes for the actions you plan to use.

Current Photos API scopes · Google Photos API changes

Step 4. Create the OAuth client

Open Google Auth Platform → Clients, select Create client, and choose Web application.

Choose Web application for the OAuth client

Under Authorized redirect URIs, add the production callback used by the Composio auth form.

https://backend.composio.dev/api/v1/auth-apps/add

Submitting this app for Google verification? Use a callback URL on your own domain instead.

Google makes you verify every domain on your OAuth client in Search Console, and you can’t verify composio.dev. Set it up like this:

  1. Pick a URL on a domain you own, for example https://auth.yourapp.com/oauth/callback.

  2. Make that URL send a 302 redirect to https://backend.composio.dev/api/v3/toolkits/auth/callback and keep everything after the ? exactly as it is. The example below does this in Next.js.

  3. Add your URL here under Authorized redirect URIs. Keep the Composio URL too until your test connection works, then remove it.

  4. In Composio, enter the same URL in the auth config’s Redirect URI field, then connect one test account and confirm it shows Active.

// app/oauth/callback/route.ts (Next.js)
const COMPOSIO_CALLBACK = 'https://backend.composio.dev/api/v3/toolkits/auth/callback';

export function GET(request: Request) {
  const { search } = new URL(request.url);
  return new Response(null, {
    status: 302,
    headers: {
      Location: COMPOSIO_CALLBACK + search,
      'Cache-Control': 'no-store',
      'Referrer-Policy': 'no-referrer',
    },
  });
}

Express and Cloudflare Worker versions, a test command, and the full Google order are in Use a callback URL on your own domain.


Register the Composio production redirect URI

Select Create. Save the client ID and copy or download the client secret before you close the dialog. Google shows the full secret once. Store it privately.

Find the OAuth client settings after creation

Part 2. Connect Google Photos in Composio

Step 1. Create an auth config

In the Composio dashboard, open Auth Configs → Create and select Google Photos. Enter a config name and choose Next.

Select OAuth 2.0 if prompted. Choose Your Own Credentials when that option appears. Enter your client ID and client secret, verify the redirect URI, and select the scopes your workflow requires. Then select Create Auth Config.

Step 2. Authorize the account

Open the auth config and select Connect Account. Sign in with a Google account that meets the prerequisites above and review the permissions before you continue.

Review the Google OAuth permissions for Google Photos

An empty album list can be expected with a new OAuth app. The Library API limits access to app-created content. User selection from the broader library uses Google’s separate Photos Picker API. Complete Google Photos OAuth verification before releasing the app to production users.

Step 3. Verify the connection

Return to the auth config and check that the connected account shows Active in Accounts.

Confirm the Google Photos connection is Active in Composio

Before using the app in production

Verifying your domain. Google requires you to verify every domain on your OAuth client in Search Console. The Composio callback puts composio.dev on the client, and you can’t verify a domain you don’t own. If you plan to submit the app for verification, register a callback URL on your own domain that forwards to Composio instead, and leave Authorized JavaScript origins empty. See Use a callback URL on your own domain.

Review Google’s verification requirements for the audience and scopes you chose. External apps in Testing can receive refresh tokens that expire after seven days. Check the requirements for your app before inviting production users.

Google OAuth verification



Share