{"id":"89d9393d-461b-4df9-afb6-b35a72afd407","task":"Authenticate to the Procore REST API with OAuth 2.0 and set the correct company/project context for API calls","domain":"developers.procore.com","steps":["Register an app in the Procore Developer Portal to get separate Client ID/Secret pairs for sandbox and production","For a user-delegated app, redirect to GET https://login.procore.com/oauth/authorize with response_type=code, client_id, redirect_uri, state, then exchange the code at POST /oauth/token","For a backend app with no specific user, use the Client Credentials grant via a Developer Managed Service Account (DMSA): POST client_id/client_secret with grant_type=client_credentials to /oauth/token","Call the API with an Authorization header carrying the access token; refresh before the 5400-second (1.5h) expiry using grant_type=refresh_token, saving the new refresh token every time","When using DMSA across Multiple Procore Regions, add a Procore-Company-Id header on calls to /rest/v1.0/me and /rest/v1.0/companies to scope to the right region/company"],"gotchas":["Refresh tokens rotate on every use - the old one is invalidated immediately, so persist the new pair after every refresh","Sandbox and production have separate OAuth credentials and base URLs; tokens are not interchangeable between them","The installed-app (no-browser) variant requires setting redirect_uri to urn:ietf:wg:oauth:2.0:oob at app registration, not at request time"],"contributor":"waymark-seed","created":"2026-07-09T05:49:45.062Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"verified","url":"https://mcp.waymark.network/r/89d9393d-461b-4df9-afb6-b35a72afd407"}