Sync App Marketplace Data with the Core API

Use the Core API to create App Marketplace customer accounts, users and integration statuses from your backend, with no user signed in.

The Core API (Admin API v2) lets your backend keep App Marketplace data in sync, server to server, with no user signed in: customer accounts, the users in them, and each account's integration statuses. Use it for bulk syncs, backend jobs and webhook handlers, and as the main way to send install status to a gated marketplace.

📘

Available with App Marketplace

The customer account, user and integration endpoints are available when App Marketplace is enabled for your account. Until then they return 404 Not Found. Contact [email protected] to turn it on.

When should I use the Core API?

There are four ways App Marketplace data reaches Partner Fleet. Pick by where your code runs and whether a user is signed in:

WayRuns inSendsUse it when
Embed script integrations arrayYour web page, when the embedded marketplace loadsThe signed-in user's integration statusesYour page already knows the user's statuses. Embedded delivery only.
JWT sign-inYour backend signs a token for the signed-in userThat user and their account, with custom field valuesEvery embedded sign-in. It never carries integration status.
In-App APIYour backend, with the signed-in user's JWTThat user's installsYou record an install as a user completes it.
Core APIYour backend, with an API keyAny account, its users and its integrationsNo user is signed in: nightly syncs, backfills, webhook handlers, or a gated marketplace.

The Core API complements JWT sign-in rather than replacing it. You can create an account through the Core API before anyone signs in, and the first user to sign in through JWT or SSO with a matching account ID joins that same account.

How do I get an API key?

  1. Go to Settings › Advanced › API Keys and click Generate Key.
  2. Enter a Name, such as "Production sync".
  3. Under Permissions, tick only what this key needs. The rows for App Marketplace are Customer Accounts, Attached Integrations and Customer Users, each with read, create, update and delete.
  4. Click Generate Key, then click Copy and store the key in your secrets manager. The full key is shown only once.

Each key's Activity link shows every request it made, with filters for domain, action, status, endpoint and date. To stop a key working, click Revoke.

How do I check that the key works?

Send every request to your marketplace's domain, either its Partner Fleet subdomain or your custom domain, followed by /admin_api/v2. The domain decides which marketplace you reach, so a key works only on the marketplace it was created in. Send the key as a Bearer token; no other scheme is accepted.

curl https://your-marketplace.partnerfleet.app/admin_api/v2/ping \
  -H "Authorization: Bearer $PARTNERFLEET_API_KEY"

A valid key returns the first eight characters of the key, so you can tell which key answered:

{ "ok": true, "key": "3f9a2c1b" }

What does a typical sync look like?

This example records that Acme turned on a user-level integration for one of its users.

1. Create the customer account. Use your own ID as external_id. Custom fields are keyed by each field's internal name.

curl -X POST https://your-marketplace.partnerfleet.app/admin_api/v2/customer_accounts \
  -H "Authorization: Bearer $PARTNERFLEET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "external_id": "acme-corp",
    "name": "Acme Corporation",
    "domain": "acme.com",
    "custom_fields": { "tier_customer_account": "Enterprise" }
  }'

If the account already exists you get 409 Conflict. Send the same body as a PATCH to /customer_accounts/acme-corp instead.

2. Add the user (user-level listings only). The email is how Partner Fleet recognizes the same person when they later sign in through JWT or SSO.

curl -X POST https://your-marketplace.partnerfleet.app/admin_api/v2/customer_accounts/acme-corp/users \
  -H "Authorization: Bearer $PARTNERFLEET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "email": "[email protected]", "first_name": "Dana", "external_id": "user-881" }'

No email is sent to the user. Users sign in through your product, never with a Partner Fleet password.

3. Record the integration. Give it your own external_id, the partner's partner_id and a status name.

curl -X POST https://your-marketplace.partnerfleet.app/admin_api/v2/customer_accounts/acme-corp/integrations \
  -H "Authorization: Bearer $PARTNERFLEET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "external_id": "acme-calendar-user-881",
    "partner_id": 42,
    "status": "Active",
    "user_external_id": "user-881"
  }'

4. Update the status when it changes. Each change is added to the integration's status_history.

curl -X PATCH https://your-marketplace.partnerfleet.app/admin_api/v2/customer_accounts/acme-corp/integrations/acme-calendar-user-881 \
  -H "Authorization: Bearer $PARTNERFLEET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "status": "Disabled" }'

5. Remove it when the account disconnects for good: DELETE /customer_accounts/acme-corp/integrations/acme-calendar-user-881.

How do user-level integrations work in the Core API?

The listing decides the level, and every integration in a response carries it as level (account or user). See User-level vs. account-level integrations.

  • User-level listing: name the user who owns the install, with user_id (Partner Fleet's ID for the user) or user_external_id (your ID for the user on that account). Without one, the request returns 422.
  • Account-level listing: send no user. A user returns 422.
  • One install each. An account holds one install per account-level listing, and each user holds one per user-level listing. A second one returns 409, naming the existing integration's id and external_id. The external_id is null when the install was made in the marketplace rather than through the API.
  • Find a user's integrations: GET /customer_accounts/acme-corp/integrations?user_external_id=user-881&level=user.
  • One account per user. Creating a user whose email already belongs to another customer account returns 409.
  • Removing a user from an account: DELETE /customer_accounts/acme-corp/users/USER_ID unlinks the user but never deletes them. It returns 409 while the user still owns user-level integrations on that account, so delete those first. If your sign-in still names that account for the user, their next sign-in links them again.

What rules should my sync follow?

  • You own the IDs. Accounts, users and integrations are addressed by the external_id you choose. IDs may contain dots, such as acme.com. Don't add a .json suffix to a path: it's read as part of the ID. An ID containing / can't be used in a path, so find it with the external_id filter on the list endpoint instead.
  • Status names must match exactly. Use the names configured on Buttons & Actions, such as Active, Pending, Disabled or Error. Matching is case-sensitive, and an unknown status returns 422.
  • partner_id is Partner Fleet's numeric partner ID. It is not the partner External ID or listing slug you can use in the embed script's integrations array.
  • Custom fields are all-or-nothing. An unknown field, or a menu value that isn't one of the field's options, returns 422 and nothing in the request is saved. A multi-select field accepts an array or a ;-separated string, and is always returned as a ;-separated string.
  • There is no upsert. To make a write safe to retry, POST first and PATCH on 409.
  • Deleting an account needs it empty. An account with attached integrations returns 409; delete its integrations first. A deleted account's external_id can be used again.
  • Lists have no total count. They return newest first, 25 per page by default and up to 100 with per_page. Keep requesting the next page until one comes back with fewer than per_page items.
  • Rate limit. Each key can make up to 120 requests per minute. Over that you get 429 Too Many Requests; wait for the next minute and retry with a backoff.

What do the error codes mean?

Errors return JSON with either one error message or an errors array.

StatusMeaning
400A parameter is missing or has the wrong type.
401The key is missing, invalid or revoked, or the header isn't Authorization: Bearer.
403The key doesn't have the permission this endpoint needs, for example Forbidden: missing integrations_create permission.
404The record doesn't exist, or the endpoints aren't enabled for your marketplace.
409A duplicate external ID or install, or a delete that's blocked.
422Validation failed: unknown status, partner, user or custom field, or the wrong level.
429The key went over its rate limit.

Where is the full endpoint reference?

The Core API reference documents each endpoint, parameter and response. The interactive reference in your admin, at https://your-marketplace.partnerfleet.app/admin/documentation/admin_v2, always lists every endpoint your marketplace has. Click Authorize and paste your key to try requests.

Common questions

Which API key does the Core API use?

A key from Settings › Advanced › API Keys. The CMS API uses a different key, made under Account Management › API Keys, and that key doesn't work here. Partner Fleet MCP uses OAuth instead of keys.

Can I set user-level integration status from my backend?

Yes. Add the user to the account, then create or update the integration with user_external_id or user_id.

Why does every request return 404?

Check three things: the domain is your marketplace's domain, the path has no .json suffix, and App Marketplace is enabled for your account.

Do accounts I create through the API show in the admin?

Yes. They appear under In-App Marketplace › Customer Accounts with the source API. See Customer Accounts.

Related pages


Did this page help you?