# Build on Nifty

This page covers what the Nifty API supports, how to test an integration, what
the limits are, and where to get help.

If you already know what you are building, go straight to
[Getting started](/getting-started).

## What you can build

Everything runs against one host, `https://openapi.niftypm.com`, and there are
three shapes of integration.

**A script or automation for your own workspace.** You authenticate with a
[Personal Access Token](/authentication) and the API acts as you, with your team
membership and your role's permissions. This is the
right shape for a nightly export, an internal dashboard, a migration, or
anything else where you own both ends.

**An app that other teams connect to.** You register an OAuth 2.1 client and
take each team through the authorization-code flow with PKCE; a member approves
the access at a consent screen, picks the workspace, and you get an access
token that acts for that workspace. Two things to design around from the start:
the granted scope is **clamped to the approving member's role** and re-clamped
on every refresh, so ask for least privilege and treat a `403` as a normal
outcome rather than a bug; and refresh tokens rotate and are single-use, so
storing the newest one is a correctness requirement, not a nicety.
[Authorization (OAuth 2.1)](/authorization) has the whole flow.

**Something that reacts to changes.** Register a [webhook](/webhooks) over the
v3 API and Nifty posts events to an HTTPS endpoint you control. Deliveries are
signed, a webhook only ever fires for the workspace it was created in, and you
can pin its `apiVersion` to a dated value so the payload shape holds still
while the API moves on. The [event catalogue](/webhook-events) is the list of
what you can subscribe to, and `GET /api/v3/webhooks/{id}/deliveries` tells you
why one auto-disabled. There is no published streaming endpoint — webhooks are
how changes reach you without polling.

Two boundaries worth knowing before you commit to a design:

- **Some resources are legacy-only.** `templates`, `apps`, `users` and
  `invites` have no v3 counterpart; an integration that needs them stays on
  `/api/v1.0` for those calls. The rest of the mapping is in
  [Migrating from v1](/getting-started#migrating-from-v1).
- **An OAuth app cannot reach all of the legacy surface.** Some legacy routes
  answer `403` to a fine-grained token. The covered segments are listed on
  [Authentication](/authentication#scope-requirement-for-the-legacy-rest-api).

## Where to get help

- **[r/NiftyPM](https://www.reddit.com/r/NiftyPM/)** — the Nifty community, and
  the best place for "has anyone built…" and "is this supposed to…" questions.
- **[Help Center](https://help.niftypm.com/en/articles/6749505-nifty-api)** —
  product documentation, including how the API fits the rest of Nifty.
- **[team@niftypm.com](mailto:team@niftypm.com)** — for anything account- or
  workspace-specific, and for a bug you think is ours.

## Sandbox and testing

There is no separate sandbox host. The API has one host and one set of data:
what you write is written, and your colleagues will see it. There are two ways
to try things safely.

**Use your own token against the reference.** Create a token in Nifty under
**Settings → API Tokens → New token**, then save it on the
[API tokens](/settings/tokens) page here. Every **Test** panel in the reference
then calls the real API as you, so you can read a live response before you write
a line of code. The token stays in your browser and is sent nowhere except the
request you trigger.

**Sign up a second Nifty workspace and point your integration at that.** A
workspace is the isolation boundary that already exists: it has its own data,
its own tokens, and its own webhooks, and none of them reach across. Testing
writes against a workspace you created for the purpose is how you exercise
`POST`, `PATCH` and `DELETE` without touching anything real.

## Building a connector

If you are building for an automation platform such as Make, n8n, Power
Automate, Activepieces or Pipedream, these are the three things to settle first.

**Import the spec from a fixed address.** The full OpenAPI description of each
API is served at an address that does not change between releases:

- v3: <https://developers.niftypm.com/docs/openapi/v3.json>
- v1.0 (frozen): <https://developers.niftypm.com/docs/openapi/v1.json>

Both always describe the production API.

**Use one base URL.** Send every v3 request to `https://openapi.niftypm.com/api/v3`.
The path selects the version, so no version header is needed; see
[Versioning](/versioning). Of the request headers you send, only
`Authorization`, `Idempotency-Key`, `Content-Type` and `Accept` reach the API.

**Send an `Idempotency-Key` with every create.** Send the same key again within
**10 minutes** of the first request, with the same body, and you get the
original response back instead of a second record. The details that matter for a
connector:

- A key is scoped to the token's workspace and user, and to the request path, so
  the same key on a different path is a different request.
- Only a successful response is remembered. If the first attempt failed, the
  same key tries again.
- Use a key for one request only. The same key with a different body can be
  refused with [`idempotency_key_reuse`](/errors#idempotency_key_reuse) or can
  return the earlier request's response; do not rely on either.
- The same key sent while the first request is still running waits up to 5
  seconds for it and then gets its response. If the first request is still
  running after that, it is refused with
  [`idempotency_in_progress`](/errors#idempotency_in_progress); wait and retry.
- A key is at most 250 characters.
- **After 10 minutes the key is forgotten.** The same key then runs the request
  again, and if the first attempt had succeeded, that creates a second record.

What this means for the key you choose depends on how your platform retries:

- The key must stay the same across every retry of **one action**. A random
  UUID generated for each HTTP call only protects against your own client
  retrying immediately; if the platform re-runs the action itself, the new run
  would carry a new key and create a duplicate.
- Platforms that replay a failed run minutes or hours later should derive the
  key from the operation, the connection and the input, for example a hash of
  the three. The same run then produces the same key every time.
- A derived key does not extend the 10-minute window. A retry that arrives after
  the window runs again, so for creates where a duplicate would matter, look the
  record up first (for example by name within its project) rather than relying
  on the key alone.

## Limits and higher limits

Every request passes two sliding-window limiters, and the numbers — per method,
per bucket — are on [Rate limits](/rate-limits). One thing about **which**
limit you are spending matters more than the numbers if you are building for
other people's workspaces:

- **Reads and most writes are charged to your token.** Both `GET`, `POST` and
  `PATCH` buckets are keyed on the access token. An OAuth grant issues one
  token per authorisation, so one customer's requests never spend another
  customer's allowance, or yours.
- **`DELETE` also spends a bucket keyed on the client IP.** For a hosted
  integration the client IP is your own server's address — shared by every
  workspace you serve from it — so size delete traffic against all of your
  customers at once, not one at a time.

The published limits apply to every API token. If they block a legitimate
integration, write to [team@niftypm.com](mailto:team@niftypm.com) and describe
the traffic.

## Listing your app

An OAuth client works as soon as you register it and a team authorises it. The
integrations catalogue in Nifty (**Settings → App Center**) is maintained by
Nifty and is not open to submissions.

To tell people what you built, post it on
[r/NiftyPM](https://www.reddit.com/r/NiftyPM/) or write to
[team@niftypm.com](mailto:team@niftypm.com).

## Staying informed

- **[Changelog](/changelog)** — every v3 release.
- **[Versioning](/versioning)** — what can change under `/api/v3` without
  warning, what cannot, and the date v1.0 stops serving requests.
- **[r/NiftyPM](https://www.reddit.com/r/NiftyPM/)** — where changes worth
  interrupting you for get announced.
