How does REST API authentication work in Marketing Cloud? What is the access token lifetime?
Suggested answer
Marketing Cloud uses OAuth 2.0 client credentials flow for server-to-server authentication. Steps:
1. Create an Installed Package in Setup with a Server-to-Server component and assign required API scopes.
2. Obtain client_id and client_secret from the package.
3. POST to https://YOUR_SUBDOMAIN.auth.marketingcloudapis.com/v2/token with body: {"grant_type":"client_credentials","client_id":"...","client_secret":"..."}.
4. The response includes access_token, token_type":"Bearer", expires_in (default 1080 seconds — 18 minutes), and rest_instance_url.
5. Include the token as Authorization: Bearer ACCESS_TOKEN on all subsequent API requests.
Cache and reuse the token until near expiry; do not request a new token for every API call.
Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.
Community comments (0)
No comments yet.
Sign in or create a free account to add a comment. Comments are moderated before they appear.