Skip to navigation

Connect Tool Studio to PurpleSuite

View as Markdown

To build Tool Studio plugins on PurpleSuite’s mock enterprise APIs, create a PurpleSuite instance and a Tool Studio connector that authenticates to it. Every Quickstart Guide and the plugin-building masterclass use this setup, and one instance and connector work for all of them.

Before you begin

  • You need access to Tool Studio to create a connector.
  • PurpleSuite instances expire 7 days after you create them, and expired instances are deleted with all their data. You can extend an instance before it expires. See When do PurpleSuite instances expire?

Create a PurpleSuite instance

  1. Open PurpleSuite and select New Instance.
  2. In Create instance, enter an Instance name, such as your name or team.
  3. Leave Include sample data (recommended for demos) selected. This adds sample records to the apps, which the quickstarts use.
  4. Select Create.
The Create instance dialog in PurpleSuite with three numbered callouts: 1, the Instance name field; 2, the Include sample data (recommended for demos) checkbox, selected; 3, the Create button.
Name the instance, keep sample data selected, and select Create.

Copy the instance credentials

  1. On your instance’s card, open the ⋮ menu and select Credentials.

    The menu on a PurpleSuite instance card, open, with Credentials highlighted. Other items are Open settings, Webhooks, MCP tools, A2A agents, Data, Share, Copy MCP URL and Delete.
    Open Credentials from the instance's menu.
  2. Copy these two values:

    • Instance ID: a UUID such as 6e30fcb1-8752-4a34-a4fb-959a5be215e1.
    • API Token (PAT): a key that starts with ps_.

    The page also shows the MCP Server URL, which you need only to connect an MCP client. See How the PurpleSuite MCP server works.

    PurpleSuite Instance Settings with Credentials selected and three numbered callouts: 1, Instance ID; 2, API Token (PAT), masked; 3, MCP Server URL. Each value has a copy button. The instance ID is blurred in this image.
    The Credentials page shows the instance ID, the API token and the MCP server URL.

Treat the instance ID, the API token and the MCP server URL as secrets. Anyone with the instance ID and API token can read and change your instance’s data, and an MCP client with the MCP server URL can connect to it.

Create the connector in Tool Studio

  1. In Tool Studio, go to Connectors and select Create.

  2. Enter these values:

    FieldValue
    Connection Namefirstname_lastname_moveworks_purple
    DescriptionMoveworks Purple APIs Connector
    Base Urlhttps://marketplace.moveworks.com
    Auth ConfigAPI Key
    Auth TypeHeader Auth
    API KeyYour API token (starts with ps_)
    Header Auth KeyAuthorization
    Header Auth Value PatternBearer %s
  3. Under Common headers (Optional), add a header for your instance ID. Common headers are sent on every request the connector makes. Use Credential so the instance ID is stored as a secret:

    FieldValue
    Value TypeCredential
    Credential Pattern%s
    Credential SecretYour instance ID
    KeyX-Instance-ID
    The Common headers (Optional) section of a Tool Studio connector, described as applied to every request made by this connector. Header 1 has Value Type set to Credential, Credential Pattern %s, an empty Credential Secret field, and Key X-Instance-ID.
    Add X-Instance-ID as a common header so every action inherits it.
  4. Select Save.

The connector now sends both Authorization: Bearer <YOUR_PAT> and X-Instance-ID on every request, so the HTTP actions that use it don’t need either header. If either header is missing, PurpleSuite returns 401. For more on API key connectors, see API key authentication.

Some quickstarts and the plugin-building masterclass add X-Instance-ID to each action instead. That works too. With the common header on the connector, you can skip that step.

Confirm it works

Test the connector with an HTTP action that reads CRM accounts. The action gets both headers from the connector, so the request you import has none.

  1. In Tool Studio, create a new HTTP action.

  2. Select the Import icon next to TEST, paste this request, and select Import.

    curl -X GET "https://marketplace.moveworks.com/api/purple-suite/crm/accounts?limit=5"
  3. On the Connector tab, select Inherit from existing connector, then choose the connector you created, such as firstname_lastname_moveworks_purple.

  4. Select TEST. A working setup returns a JSON response with CRM account data in a data list.

Leave the API token and instance ID out of requests you import into PurpleSuite actions. The connector supplies both, so when you move to a new instance you update them in one place.

Troubleshoot the connection

  • 401 response: check that the connector’s API key is your current API token and that its X-Instance-ID common header has your current instance ID. A 401 with the message “Instance token has expired” means the instance has expired.
  • 404 response: the instance ID doesn’t match an instance, often because an expired instance has been deleted.
  • 429 response: too many requests used a wrong API token, and the instance is locked for 15 minutes. Fix the token, then try again after the lockout.

After an instance expires, create a new one, then update the API key and the X-Instance-ID common header in the connector.

Next steps