---
name: aprimo-pm-api-quickstart
description: Quick-start guide and API reference for the Aprimo Productivity Management (PM) REST API, covering Aprimo Productivity and Aprimo Spend. Use when developers need authentication setup, code examples in their language, API endpoint details, getting started guidance, or troubleshooting PM API integration.
---

# Aprimo Productivity Management (PM) REST API – Quick Start

Get your first API call working in 5 minutes, then dive deeper into the full documentation.

This skill covers the **PM REST API**, which serves both **Aprimo Productivity** (activities, projects, tasks, work requests, reviews) and **Aprimo Spend** (budgets, forecasts, invoices, commitments, funding accounts). For the Digital Asset Management (DAM) REST API, use the `aprimo-dam-api-quickstart` skill instead.

## 60-Second Setup

### 1. Get an API Key

In your Aprimo environment:
1. Navigate to **Administration** → **Integration** → **Registrations**
2. Click **New** and fill out the form:
   - **OAuth Flow Type:** Client Credentials (recommended for integrations)
   - **User:** the user on whose behalf calls will be made (the only user for this registration)
   - **Access Token Lifetime:** 1–60 minutes
3. Save the **Client ID** and **Client Secret**

Registrations may take up to 15 minutes to become active.

### 2. Request an Access Token

```bash
curl -X POST 'https://<your-tenant>.aprimo.com/login/connect/token' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'grant_type=client_credentials' \
  -d 'scope=api' \
  -d 'client_id=YOUR_CLIENT_ID' \
  -d 'client_secret=YOUR_CLIENT_SECRET'
```

Save the `access_token` from the response. Add the `filestore-access` scope (space-separated, e.g. `scope=api filestore-access`) if your integration downloads attachments.

### 3. Make Your First API Call

**List activities:**

```bash
curl -X GET 'https://<your-tenant>.aprimo.com/api/activities?limit=5' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json'
```

**You now have your first API response.** See examples below for your preferred language.

---

## Code Examples by Language

### Python

```python
import requests

# Configuration
tenant = "your-tenant"
client_id = "YOUR_CLIENT_ID"
client_secret = "YOUR_CLIENT_SECRET"

# Step 1: Get access token
token_url = f"https://{tenant}.aprimo.com/login/connect/token"
token_response = requests.post(token_url, data={
    "grant_type": "client_credentials",
    "scope": "api",
    "client_id": client_id,
    "client_secret": client_secret
})
access_token = token_response.json()["access_token"]

# Step 2: List activities
activities_url = f"https://{tenant}.aprimo.com/api/activities"
headers = {
    "Authorization": f"Bearer {access_token}",
    "Content-Type": "application/json"
}

response = requests.get(activities_url, headers=headers, params={"limit": 5})
results = response.json()

# _embedded is keyed by the resource's singular, PascalCase type name — "Activity" here, not "activities"
print(f"Found {results['_total']} activities")
for item in results.get("_embedded", {}).get("Activity", []):
    print(f"  - {item['activityId']}: {item.get('name', 'No name')}")
```

### JavaScript / TypeScript

```javascript
const tenant = "your-tenant";
const clientId = "YOUR_CLIENT_ID";
const clientSecret = "YOUR_CLIENT_SECRET";

// Step 1: Get access token
async function getAccessToken() {
  const tokenUrl = `https://${tenant}.aprimo.com/login/connect/token`;
  const params = new URLSearchParams({
    grant_type: "client_credentials",
    scope: "api",
    client_id: clientId,
    client_secret: clientSecret
  });

  const response = await fetch(tokenUrl, {
    method: "POST",
    body: params
  });

  const data = await response.json();
  return data.access_token;
}

// Step 2: List activities
async function listActivities(accessToken) {
  const activitiesUrl = `https://${tenant}.aprimo.com/api/activities?limit=5`;

  const response = await fetch(activitiesUrl, {
    method: "GET",
    headers: {
      "Authorization": `Bearer ${accessToken}`,
      "Content-Type": "application/json"
    }
  });

  const results = await response.json();
  console.log(`Found ${results._total} activities`);

  // _embedded is keyed by the resource's singular, PascalCase type name — "Activity" here, not "activities"
  results._embedded?.Activity?.forEach(item => {
    console.log(`  - ${item.activityId}: ${item.name || "No name"}`);
  });
}

// Run it
(async () => {
  const token = await getAccessToken();
  await listActivities(token);
})();
```

### C#

```csharp
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;

class AprimoPmClient
{
    private string _tenant = "your-tenant";
    private string _clientId = "YOUR_CLIENT_ID";
    private string _clientSecret = "YOUR_CLIENT_SECRET";
    private HttpClient _httpClient = new HttpClient();

    // Step 1: Get access token
    async Task<string> GetAccessToken()
    {
        var tokenUrl = $"https://{_tenant}.aprimo.com/login/connect/token";
        var content = new FormUrlEncodedContent(new[]
        {
            new KeyValuePair<string, string>("grant_type", "client_credentials"),
            new KeyValuePair<string, string>("scope", "api"),
            new KeyValuePair<string, string>("client_id", _clientId),
            new KeyValuePair<string, string>("client_secret", _clientSecret)
        });

        var response = await _httpClient.PostAsync(tokenUrl, content);
        var json = await response.Content.ReadAsStringAsync();
        dynamic data = JsonConvert.DeserializeObject(json);

        return data.access_token;
    }

    // Step 2: List activities
    async Task ListActivities(string accessToken)
    {
        var activitiesUrl = $"https://{_tenant}.aprimo.com/api/activities?limit=5";

        var request = new HttpRequestMessage(HttpMethod.Get, activitiesUrl);
        request.Headers.Add("Authorization", $"Bearer {accessToken}");

        var response = await _httpClient.SendAsync(request);
        var json = await response.Content.ReadAsStringAsync();
        dynamic results = JsonConvert.DeserializeObject(json);

        Console.WriteLine($"Found {results._total} activities");
        // _embedded is keyed by the resource's singular, PascalCase type name — "Activity" here, not "activities"
        foreach (var item in results._embedded.Activity)
        {
            Console.WriteLine($"  - {item.activityId}: {item.name ?? "No name"}");
        }
    }

    static async Task Main()
    {
        var client = new AprimoPmClient();
        var token = await client.GetAccessToken();
        await client.ListActivities(token);
    }
}
```

---

## Essential Concepts

### Response Shape: Paged HAL Collections

List (`GET`) and search (`POST .../search`) responses are paged HAL collections, not flat arrays. Verified against a live `GET /api/activities?limit=2`:

```json
{
  "_total": 7140,
  "Activity": [
    { "href": "activities/501" },
    { "href": "activities/86001" }
  ],
  "_embedded": {
    "Activity": [ { "activityId": 501, "name": "<test> test", ... }, { "activityId": 86001, "name": "...", ... } ]
  },
  "_links": {
    "self": { "href": "activities", "type": "application/vnd.td-apps.operations.Activity" },
    "first": { "href": "activities?limit=2", "type": "..." },
    "last": { "href": "activities?offset=7138", "type": "..." },
    "next": { "href": "activities?offset=2&limit=2", "type": "..." }
  }
}
```

Three things worth being precise about:

- **`_embedded` is keyed by the resource's singular, PascalCase type name — not the plural route name.** `GET /activities` embeds under `Activity`; `GET /projects` embeds under `Project`. Don't assume the key matches the URL.
- **There's also a top-level array under that same key** (`Activity` here) containing lightweight `{ "href": "..." }` stubs — a second, minimal representation of the same page. The full objects you want are in `_embedded`, not this array.
- **A single resource fetched by ID (`GET /activities/{id}`) returns the flat object directly** — no `_embedded` or `_links` wrapper, unlike the collection routes.

Pagination links live under `_links` (`self`, `first`, `last`, `next`/`prev` as applicable).

### No Select-Headers

Unlike the DAM REST API, the PM REST API has **no `select-` header mechanism** for shaping which fields or related data come back. Resources return their full defined schema on every request — there's no way to request a lighter payload by omitting fields.

### CRUD Verbs

| Operation | HTTP Method | Notes |
|---|---|---|
| Create | `POST` | Returns `201 Created` with a resource link. |
| Read | `GET` | Retrieves a single resource or a paged collection. |
| Update | `PUT` | **Flush-and-fill** — overwrites the whole resource unless the field is marked for field-level updates. |
| Delete | `DELETE` | May be a soft or hard delete, depending on the resource. |
| Search | `POST .../search` | Runs a JSON query. `GET`/`PUT`/`DELETE` are not supported on search routes. |

### Pagination

- `offset` — number of records to skip.
- `limit` — max results per page (default 50, max 250).
- `sortField` & `sortAscending` — e.g. `?sortField=name,activityId&sortAscending=true`.

### Searching (`POST /{resource}/search`)

Search routes accept a JSON query body built from comparison operators (`equals`, `contains`, `greaterthan`, `lessthan`, `isNull`, ...), boolean operators (`and`, `or`, `not`, nestable), and collection/array matching.

```json
{
  "and": [
    { "contains": { "fieldName": "name", "fieldValue": "Q3 Launch" } },
    { "equals": { "fieldName": "ownerID", "fieldValue": 455 } }
  ]
}
```

```bash
curl -X POST 'https://<tenant>.aprimo.com/api/activities/search?limit=50' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"contains": {"fieldName": "name", "fieldValue": "Q3 Launch"}}'
```

### Extended Attributes (EAs)

Tenant-defined custom fields. Set them by ID rather than name:

```json
{ "extrAttr2701": "value" }
```

Multi-select EA collections:

```json
{ "extrAttr2701": [2701, 2702] }
```

**Gotcha:** on `PUT`/`POST`, omitting EA collections entirely can cause a `500` error. Always include empty arrays if you have no values to send:

```json
{ "extendedAttributes": [], "multipleValueExtendedAttributes": [] }
```

### Metadata Routes

Discover the fields a resource accepts and returns via `GET /api/metadata/{resource}` (e.g. `/api/metadata/activities`). The response includes field data type, validation rules, and whether a field is read-only — useful for building requests dynamically instead of guessing field names.

### Required Headers

```
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
```

---

## Rate Limiting

Aprimo's REST APIs enforce a **burst-based rate limit**. Each environment has a sustained
rate measured in requests per second, plus a burst buffer that absorbs short spikes. A
typical configuration is **15 requests per second with a burst buffer of 100 requests**,
but the exact figures are per-environment — confirm yours with your Aprimo Account
Executive, who can also discuss an increase.

Two properties of this model catch integrations out:

- **The budget is per environment, not per integration or per user.** Every application,
  script, and scheduled job pointed at the same tenant draws on the same allowance, so a
  bulk job can starve an interactive app running alongside it.
- **Excess requests are rejected, not queued.** Once both the sustained rate and the burst
  buffer are exhausted, further requests return `429 Too Many Requests` immediately. You
  get fast feedback rather than a silent delay, but your client has to handle it.

**Writing a well-behaved client:**

- **Retry a `429` with exponential backoff** — wait 1s, then 2s, 4s, 8s, and add a little
  random jitter so parallel workers don't all retry on the same beat.
- **Space out polling.** When waiting on a long-running operation, use progressive waits
  (1s, 3s, 5s…) rather than a tight loop.
- **Reuse access tokens** until they expire instead of requesting a fresh one per call.
- **Cache reference data** that rarely changes, and refresh it periodically.
- **Spread scheduled work out** rather than firing every request at the top of the hour.
- **Log every `429`** alongside the endpoint that caused it — the pattern usually points at
  a single hot loop.

---

## Common Tasks

### List Activities

```bash
curl -X GET "https://<tenant>.aprimo.com/api/activities?limit=50&sortField=name&sortAscending=true" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### Search Activities

```bash
curl -X POST "https://<tenant>.aprimo.com/api/activities/search" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"equals": {"fieldName": "ownerID", "fieldValue": 455}}'
```

### Get a Single Activity

```bash
ACTIVITY_ID="1234"

curl -X GET "https://<tenant>.aprimo.com/api/activities/$ACTIVITY_ID" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### Find Attachments for an Activity

```bash
curl -X POST "https://<tenant>.aprimo.com/api/attachments/search" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "and": [
      { "equals": { "fieldName": "objectTypeId", "fieldValue": "1" } },
      { "equals": { "fieldName": "objectId", "fieldValue": "1234" } }
    ]
  }'
```

`objectTypeId: 1` is Activities. See the full [Common Aprimo Object List](https://developers.aprimo.com/docs/rest-api/pm/common-aprimo-object-list) for other object and object type IDs (Projects, Tasks, Invoices, Users, and more).

### Create a Resource

`POST` to the resource's base route (e.g. `POST /api/activities`) with a JSON body matching the resource schema. Retrieve an existing resource via `GET` first to see the expected shape, and always include empty `extendedAttributes` / `multipleValueExtendedAttributes` arrays even when you have no EA values to set.

---

## Troubleshooting

### 401 Unauthorized / Null Response
- A null response body on a `401` usually means your access token expired — use the `refresh_token` (or request a new token via Client Credentials) rather than retrying the same token.
- Verify the Authorization header format: `Bearer YOUR_TOKEN`.

### 403 Forbidden / 404 Not Found on records the user should see
- Check the calling user has the relevant domain right (e.g. `Activity, View`).
- For service-style integrations, confirm the `Integration API, Access` domain right is granted — without it, the service user must be on each record's access list (applies to Activities, Programs, Funding Accounts, Markets, Plans, and Offers).

### 500 Error on PUT/POST
- Missing extended attribute collections is a common cause. Include `"extendedAttributes": []` and `"multipleValueExtendedAttributes": []` even when empty.
- Retrieve the resource via `GET` first, edit that JSON, and send it back — PM updates are flush-and-fill by default.

### 400 Bad Request on a Search
- Confirm you're using `POST` on a route ending in `/search` — `GET`, `PUT`, and `DELETE` are not supported on search routes.
- Multi-select Extended Attribute fields cannot be used as search criteria.

### 429 Too Many Requests
- You've exhausted the environment's sustained rate and its burst buffer.
- Back off exponentially (1s, 2s, 4s…) with jitter, then retry — the request was rejected
  outright, not queued.
- Remember the budget is shared tenant-wide: another integration may be the real cause.
- See the Rate Limiting section above.

---

## API Documentation

### Full OpenAPI Specification

The OpenAPI 3.x specification covering **Aprimo Productivity** and **Aprimo Spend**, both served through the PM REST API, is published on the PM OpenAPI Specification page, **https://developers.aprimo.com/docs/openapi-specifications/pm-openapi-spec**. It is not included in this file. Download it from that page and save it next to this file as `PMOpenAPI.json`. If it isn't there, ask the user to download it. You can:

- **Import into Postman/Insomnia:** Use `PMOpenAPI.json` to auto-generate API requests.
- **Generate SDK code:** Use [OpenAPI Generator](https://openapi-generator.tech/) to create client libraries in any language.
- **IDE integration:** TypeScript, Visual Studio Code, and other tools can use the spec for autocomplete.

The spec is broad — work management, planning, Spend (budgets, forecasts, invoices, commitments), documents & collaboration, and org/reference data. Consider trimming it to the endpoints your integration needs before importing into tools that generate a tool per operation.

### Static Documentation

The full Aprimo developer documentation (authentication flows, advanced patterns, error reference, and more) is available at:

**https://developers.aprimo.com**

**For AI/Claude:** The site uses dynamic rendering. To fetch static, AI-readable versions:

1. **Browse available docs:** https://developers.aprimo.com/llms.txt
2. **Fetch specific articles as plaintext:**
   - Authentication details: `https://developers.aprimo.com/doc-content/docs/OAuth2.txt`
   - PM intro & REST API guide: `https://developers.aprimo.com/doc-content/docs/rest-api/pm/pm-intro.txt`
   - Search syntax & operators: `https://developers.aprimo.com/doc-content/docs/rest-api/pm/searching.txt`
   - Metadata routes: `https://developers.aprimo.com/doc-content/docs/rest-api/pm/metadata.txt`
   - Common object & object type IDs: `https://developers.aprimo.com/doc-content/docs/rest-api/pm/common-aprimo-object-list.txt`
   - Tips & troubleshooting: `https://developers.aprimo.com/doc-content/docs/rest-api/pm/tips.txt`
   - Working with tasks: `https://developers.aprimo.com/doc-content/docs/rest-api/pm/working-with-tasks.txt`
   - Working with the Financials API: `https://developers.aprimo.com/doc-content/docs/rest-api/pm/working-with-financials-api.txt`
   - Rate limiting: `https://developers.aprimo.com/doc-content/docs/rate-limiting.txt`

Use these static `.txt` versions for comprehensive examples, advanced workflows, and detailed API behavior.

### Going Further: help.aprimo.com

Aprimo also publishes a product help site, **help.aprimo.com**, covering UI, configuration, and admin behavior that the REST API docs don't — reach for it when a question is about what a feature *is* or how it behaves on-screen, not about API syntax.

It requires an authenticated session, and there's no API key or service account for it — access rides on the user being logged into an Aprimo instance in the same browser. If your agent has browser tooling available:

1. **Ask the user to log in.** Have them sign in to their Aprimo instance in that browser, then load help.aprimo.com in the same session. Don't attempt to authenticate yourself and never ask for credentials.
2. **Search instead of guessing paths.** The site is built on MadCap Flare, so guessed URLs mostly 404. Use `https://help.aprimo.com/?q=<terms>` to find exact topic paths, then open the results from there.
3. **If you can run JavaScript in that browser**, fetching `/Content/<path>` with `credentials: 'include'` and reading the parsed body text is faster than clicking through topic by topic — topic bodies render into an iframe that plain text extraction can miss.

If access fails, tell the user plainly that the session is missing and ask them to log in again, rather than retrying the same request.

---

## Support & Next Steps

1. **Test your setup:** Verify you can get an access token and list activities.
2. **Pick your language:** Use the code examples above as a starting point.
3. **Explore the API:** Ask Claude questions like:
   - "Show me how to search activities by owner in Python."
   - "What does a flush-and-fill PUT mean for updating a task?"
   - "How do I search for attachments on a project?"
   - "Generate a Node.js client for creating an Aprimo Spend invoice."
4. **Build & integrate:** Use the OpenAPI spec and examples to build your application.

---

## OpenAPI Specification

The full API schema (endpoints, parameters, request/response models, authentication) is in `PMOpenAPI.json`, saved next to this file (see **Full OpenAPI Specification** above for where to download it). Claude can reference it directly for parameter details, error codes, and response shapes.

You can also use this file with:
- **Postman/Insomnia:** Import → Auto-generate API requests with examples.
- **Code generation:** `openapi-generator-cli generate -i PMOpenAPI.json -g python -o ./sdk`
- **IDE autocomplete:** VSCode, IntelliJ, etc. can provide autocomplete based on the spec.

---

**Ready to build?** Start with the examples above, ask Claude questions as you build, and refer to the full documentation at developers.aprimo.com for advanced patterns and reference.
