Skip to content
Dashboard
Theme
Theme

Retrieve the OAuth connection of a directory source

GET /v1/directories/{dir}/source/oauth: Retrieve the OAuth connection of a directory source.

View Markdown

GET /v1/directories/{dir}/source/oauth

The OAuth connection of a gusto directory made with POST /v1/directories/{dir}/source/oauth/start: its status (pending_company until a company is chosen, active, or credentials_invalid after Gusto refused the refresh token; connect again then), the companies the grant reaches and the chosen one. Tokens are never returned. Not found until a connection completes.

Scope
directories:read
Auth
Secret key (sk_…)
Since
1.0
  • dir string Required

  • OhAuthCat-Version string

    Minor version; defaults to the environment’s pin.

Errors share one shape; see the error code catalogue.

curl -X GET \
"https://api.ohauthcat.com/v1/directories/dir_01J9Z3K5V7W8X9Y0Z1A2B3C4D5/source/oauth" \
-H "Authorization: Bearer $OHAUTHCAT_API_KEY"
Response 200
{
"object": "directory_source_oauth",
"directory_id": "dir_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"provider": "gusto",
"status": "pending_company",
"companies": [
{
"id": "01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"name": "Acme Corp"
}
],
"company_id": "01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"created_at": "2026-01-15T09:30:00Z",
"updated_at": "2026-01-15T09:30:00Z"
}