---
title: "Issue a short-lived access token for a provider-hosted picker"
method: POST
path: "/api/integrations/{provider}/credentials/{cred_id}/picker-token"
tags: ["v1", "integrations"]
---

# Issue a short-lived access token for a provider-hosted picker

`POST /api/integrations/{provider}/credentials/{cred_id}/picker-token`

Return the raw access token for an OAuth2 credential so the frontend
can initialize a provider-hosted picker (e.g. Google Drive Picker).

`GET /{provider}/credentials/{cred_id}` deliberately strips secrets (see
`CredentialsMetaResponse` + `TestGetCredentialReturnsMetaOnly` in
`router_test.py`). That hardening broke the Drive picker, which needs the
raw access token to call `google.picker.Builder.setOAuthToken(...)`. This
endpoint carves a narrow, explicit hole: the caller must own the
credential, it must be OAuth2, and the endpoint returns only the access
token + its expiry — nothing else about the credential. SDK-default
credentials are excluded for the same reason as `get_credential`.

## Path parameters

- `provider` string, required — Provider name for integrations. Can be any string value, including custom provider names.
- `cred_id` string, required

## Response `200`

Successful Response

- PickerTokenResponse — Short-lived OAuth access token shipped to the browser for rendering a provider-hosted picker UI (e.g. Google Drive Picker). Deliberately narrow: only the fields the client needs to initialize the picker widget. Issued from the user's own stored credential so ownership and scope gating are enforced by the credential lookup.
  - `access_token` string, required — OAuth access token suitable for the picker SDK call.
  - `access_token_expires_at` integer, nullable — Unix timestamp at which the access token expires, if known.

## Other responses

- `401` — Authentication required
- `422` — Validation Error

---

[API](https://skmtc.net/significant-gravitas/apis/autogpt-agent-server.md) · [All operations](https://skmtc.net/significant-gravitas/apis/autogpt-agent-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/significant-gravitas/autogpt-agent-server/versions/382041c7ecb2/schema)
