Skip to main content

Authorization

Authentication Overview​

Aprimo supports OAuth 2.0 with the following flows:

  • Authorization Code with PKCE: Interactive web authorization.
  • Client Credentials Flow: Authorize a service as a specified user.
  • Resource Owner Password Flow: Users authorize with their Aprimo username and token.

These OAuth 2.0 tokens are used across the Productivity Management REST API, DAM REST API, Upload Service, Reporting API, Analytics API, and all other Aprimo APIs.

To use an OAuth 2.0 token, include it in the {Authorization: Bearer [token]} header for these APIs.

Tokens have a 5-minute clock skew to prevent validity issues.

Authorization Flows Use Case Guidance
  • Client Credentials: Use for API calls as a service user, with no need for changes.
    • If your purpose is to learn the Aprimo REST API, this is the recommended flow.
  • Resource Owner Password: Use for multiple users when a browser login flow is not possible.
  • Authorization Code with PKCE: Use for individual user authorization with a browser-based login flow to get access and refresh tokens.
warning

If you receive a 401 error with a null response, your token likely expired. Use the refreshToken to get a new one.

OAuth 2.0 - Scopes​

Available Scopes:

  • api: Access to the REST API.
  • reporting-api: Access to the Reporting API.
  • mcp: Access to the Aprimo MCP Server. Available only to integrations registered with the Model Context Protocol (MCP) flow type.
  • offline_access: Obtain a refresh token so your application can get new access tokens without prompting the user to sign in again. See offline_access and Refresh Tokens.
  • filestore-access: Download attachments and digital assets.

Scopes should be space-separated, e.g., {"scope": "api offline_access" }.

filestore-access

The filestore-access scope only applies to Aprimo Productivity Management. Downloading content from Aprimo DAM is included in the api scope and is handled by user permissions.

The mcp Scope​

The mcp scope authorizes a client to connect to the Aprimo MCP Server. It is the only scope an MCP integration can request.

  • Only for MCP registrations. An integration registered with the Model Context Protocol (MCP) OAuth flow type receives mcp. Scopes such as api and reporting-api cannot be requested by an MCP integration.
  • Only for the MCP Server. A token with the mcp scope is accepted by the MCP Server and nowhere else. It cannot be used to call the Productivity Management REST API, DAM REST API, or any other Aprimo API directly. Those APIs require a token with the api scope.
  • Calls run as the signed-in user. When a tool needs to read or change Aprimo data, the MCP Server calls the Aprimo APIs on behalf of the user who signed in. The tool can only do what that user is permitted to do.
  • Usually automatic. The MCP Server tells MCP clients which scope to request when they connect, so most clients (such as Copilot Studio or VS Code) request mcp for you. You normally don't set it yourself.

If a request to the MCP Server returns 403 Forbidden after the user signs in successfully, the token doesn't contain the mcp scope.

For registration steps, see Aprimo MCP Server.

offline_access and Refresh Tokens​

By default, an access token is short-lived. When it expires, the user has to sign in again. The offline_access scope lets your application avoid that: when you request it, Aprimo also issues a refresh token, which your application can exchange for a new access token without prompting the user. See Getting an Access Token with a Refresh Token.

Request offline_access when your application keeps working after the user has stepped away, such as an orchestration platform running scheduled flows, or any application where asking the user to sign in every time the access token expires isn't acceptable.

You need both of these to get a refresh token:

  1. Enable Refresh Token is checked on the integration registration.
  2. Your application includes offline_access in the scope of the authorization request.
Enable Refresh Tokenoffline_access requestedResult
✅ Checked✅ YesYou receive an access token and a refresh token.
✅ Checked❌ NoYou receive an access token only.
❌ Unchecked❌ NoYou receive an access token only.
❌ Unchecked✅ YesFor MCP registrations, the sign-in is refused with invalid_scope. Check Enable Refresh Token on the registration, or stop requesting offline_access.

Things to know:

  • Authorization code flows only. Refresh tokens are issued by the authorization code flows, including the MCP flow. The Resource Owner Password flow does not return one.
  • Refresh Token Lifetime. The registration's Refresh Token Lifetime sets how long the refresh token lasts, counted from when the user signed in. It is not extended each time you use the refresh token. Once it ends, the refresh fails with invalid_grant and the user must sign in again. For MCP registrations, the minimum is 60 minutes, and leaving it blank uses 24 hours.
  • Refresh tokens for MCP registrations are reusable. The same refresh token keeps working until its lifetime ends. It isn't replaced each time you refresh, unlike the refresh flow described below.
  • Deactivated users. A refresh fails with invalid_grant if the user has been deactivated or deleted.
  • Protect the refresh token. It can be used to get new access tokens for as long as it is valid, so a leaked refresh token is more dangerous than a leaked access token. Store it securely.
  • Registration changes take time. Changes to a registration can take up to 15 minutes to apply.
tip

If you want users to sign in frequently, leave Enable Refresh Token unchecked, or set a short Refresh Token Lifetime. A client that doesn't request offline_access never receives a refresh token, so the lifetime has no effect on it.

Integration Registrations​

To get an access token, register an Aprimo Client in Administration > Integration > Registrations. During registration, you'll need to make the following decisions:

  • Client Name: Name of the client registration.
  • Description: Purpose of the registration.
  • Client Secret: A secret that cannot be changed; store securely.
  • Redirect URL: Required if using the Authorization Code flow.
  • OAuth Flow Type
    • Authorization Code (PKCE): Recommended for interactive auth flows.
    • Client Credentials: Use for service-based API calls.
    • Resource Owner Password: Use for multiple users without a browser-based login.
    • Model Context Protocol (MCP): Use for MCP clients connecting to the Aprimo MCP Server. Tokens carry the mcp scope.

The fields for the Client Registration

Permission Requirements

Integration registration requires Security or System Administration domain rights.

OAuth 2.0 Flow - Client Credentials​

The Client Credentials flow retrieves an API token for backend service calls. The token is used in the context of the user specified during integration registration.

Step 1: Register the Client Application​

In Productivity Management, go to Administration > Integration > Registrations.

  • Click New and set the OAuth Flow Type to Client Credentials.
  • Set the User field to the user on behalf of whom calls will be made (this is the only user for this registration).
  • Store the Client Secret securely, as it cannot be retrieved later.
  • Set the Access Token Lifetime (1 to 60 minutes).
  • Click Save. Note: Registrations may take up to 15 minutes to update.

Step 2: Retrieve an Access Token​

Make an HTTP POST request to the login/connect/token endpoint and include authorization parameters in the request body.

curl --location 'https://[aprimoEnvironment].aprimo.com/login/connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=api' \
--data-urlencode 'client_id=[clientid]' \
--data-urlencode 'client_secret=[clientsecret]'

OAuth 2.0 Flow - Resource Owner Password​

Step 1: Register the Client Application​

In Productivty Management, go to Administration > Integration > Registrations.

  • Click New and set the OAuth Flow Type to Resource Owner Password.
  • Set the Access Token Lifetime (1 to 60 minutes).
  • Store the Client Secret securely, as it cannot be retrieved later.
  • Click Save. Note: Registrations may take up to 15 minutes to update.

Step 2: Retrieve an Access Token​

Make an HTTP POST request to the login/connect/token endpoint and include authorization parameters in the request body.

The UserToken attribute is not the user's password, but their Aprimo unique user token. Retrieve a user token by navigating to My Profile > 3-Dot Menu > User Token.

curl --location 'https://[aprimoEnvironment].aprimo.com/login/connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'username=[Username]' \
--data-urlencode 'password=[UserToken]' \
--data-urlencode 'scope=api' \
--data-urlencode 'client_id=[clientid]' \
--data-urlencode 'client_secret=[clientsecret]'
info

The Resource Owner Password flow does not return a refresh_token. If the returned access_token expires a new one must be requested.

OAuth 2.0 Flow - Authorization Code with PKCE​

The Authorization Code with PKCE flow enables user-level mapping between your app and Aprimo via an interactive web login. To receive a refresh token, check Enable Refresh Token when registering your integration.

For more details on PKCE, refer to this blog post and RFC7636. To request an access token, you must generate a code verifier (a random string of 43-128 characters using specific characters) and create a code challenge (Base64-URL-encoded SHA256 hash of the verifier).

Step 1: Register the Client Application​

In Productivty Management, go to Administration > Integration > Registrations.

  • Click New and set the OAuth Flow Type to Authorization Code with PKCE.
  • Store the Client Secret securely as it cannot be retrieved later.
  • Optionally, enable the refresh token and set its life (60 minutes to 10 days).
  • Click Save. Note: Changes may take up to 15 minutes to take effect.

Step 2: Prompt the User To Login to Aprimo​

Make a HTTP GET request to the login/connect/authorize endpoint:

https://[aprimoEnvironment].aprimo.com/login/connect/authorize?
response_type=code
&state=[yourState]
&client_id=[yourClientId]
&redirect_uri=[yourRedirectURI]
&scope=[yourScopes]
&code_challenge=[yourCodeChallenge]
&code_challenge_method=S256

Set state to a value you store on your end to validate on the callback to your redirect uri. Your redirect URI must match the redirect URI supplied in the integration registration exactly.

Note that the scope parameter will not be returned in the callback URL.

Example Authoriztion URL

https://[aprimoDomain].aprimo.com/login/connect/authorize?response_type=code&state=1234560&client_id=ABCD-EFG1&redirect_uri=https://www.aprimo.com&scope=api&code_challenge=123456qwertyy789&code_challenge_method=S256

Step 3: Retrieve an Access Token​

After user authorization (via Aprimo login or SSO), your redirect URI will be called with the following parameters:

https://your_redirect_uri?code=[onetimeuseCode]&scope=[yourScope]&state=[yourState]

Use the state value to match the flow to your application.

Next, make this HTTP POST request to the login/connect/token endpoint:

curl --location 'https://[aprimoEnvironment].aprimo.com/login/connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'code=[code]' \
--data-urlencode 'redirect_uri=[redirect_uri]' \
--data-urlencode 'code_verifier=[code_verifier]' \
--data-urlencode 'client_id=[client_id]' \
--data-urlencode 'client_secret=[client_secret]'

You will receive an access token and optionally a refresh token.

OAuth 2.0 - Getting an Access Token with a Refresh Token​

Use your refresh token to obtain a new access token.

Make an HTTP POST request to:

https://[aprimoEnvironment].aprimo.com/login/connect/token
Authorization: Basic [base64encodedYourClientId:YourClientSecret]
Content-Type: application/x-www-form-urlencoded

grant_type=refresh_token
&refresh_token=[yourRefreshToken]

This will return a new access token, a new refresh token, and invalidate the previous refresh token.

note

This applies to refresh tokens issued to integrations registered with the Authorization Code with PKCE flow. Refresh tokens for MCP registrations are reusable and aren't replaced when you refresh. See offline_access and Refresh Tokens.

Integration API - Access Domain Right​

important

The Integration API - Access domain right only applies to REST API calls made to Aprimo Productivity Management.

When using the REST API, you can only access records the authenticated user has permissions for. For security, users with System Administration, Access rights cannot read or edit any record via the API, unlike in the UI. Integrations using a service user shouldn’t require system admin access.

To limit REST API access without adding the service user to every record's access list, we’ve introduced the Integration API, Access domain right. With this right, a user can access records without being on the access list, but they still need the appropriate domain right (e.g., Activity, View). For example, a user with both Integration API, Access and Activity, View rights can view all activity records in Aprimo, even if they’re not on each record's access list.

Without the Integration API, Access right, the user must be on the access list to view records via the API. This domain right allows service-style integrations to bypass the access list requirement.

Resources with Access Lists:

  • Activities
  • Programs
  • Funding Accounts
  • Markets
  • Plans
  • Offers