Skip to content
Dashboard
Theme
Theme

Choose the company a directory source syncs

POST /v1/directories/{dir}/source/oauth/company: Choose the company a directory source syncs.

View Markdown

POST /v1/directories/{dir}/source/oauth/company

Chooses one of the connection’s companies, makes the connection active and schedules a sync now. A company the grant does not reach answers parameter_invalid; a connection in credentials_invalid answers not found (connect again).

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

  • OhAuthCat-Version string

    Minor version; defaults to the environment’s pin.

  • company_id string Required

    min length 1 · max length 64

Errors share one shape; see the error code catalogue.

curl -X POST \
"https://api.ohauthcat.com/v1/directories/dir_01J9Z3K5V7W8X9Y0Z1A2B3C4D5/source/oauth/company" \
-H "Authorization: Bearer $OHAUTHCAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"company_id": "01J9Z3K5V7W8X9Y0Z1A2B3C4D5"
}'
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"
}