Skip to main content

How to Build an App That Connects to Yay! Forms

Register an app in Yay! Forms and let people connect their account with one click through OAuth 2.0: credentials, private and public apps, the authorization flow with PKCE, tokens, limits and webhooks.

This guide is for developers who want their product to connect to Yay! Forms with an Allow access button instead of asking people to paste an API key. You register an app, send people through the standard OAuth 2.0 authorization code flow with PKCE, and call the Yay! Forms API with the token you receive.

When to use an app

1. Create your app

Click your avatar in the side menu. Under Your account, select Developers, then click Create app and fill in:

  • Name: shown to people on the Allow access screen.
  • Website: your product’s address, https:// only.
  • Redirect URLs: where Yay! Forms sends people back after they answer. Add up to 10. Each one must match exactly what your app sends, character by character.
  • Privacy policy: an https:// link.
  • Support e-mail: where people can reach you.
  • Logo URL (optional) and Terms (optional): https:// links.
  • Who can connect: Private or Public (see the next section).

Each account can register up to 10 apps.

2. Save the client ID and client secret

After you create the app, its Credentials show the Client ID and the Client secret. The secret is shown only once: copy it to a safe place on your server before you close the window.

If you lose the secret, open the app and click New secret. The old secret stops working immediately, so update your app right away. Never put the secret in a browser, a mobile app or a public repository.

3. Choose private or public

  • Private: only your own Yay! Forms account can connect. It works right away, which makes it the right choice for internal tools and for building your integration.
  • Public: any Yay! Forms account can connect after our team approves the app. Until then the app is in Testing: up to 10 different accounts can connect, and the Allow access screen marks it Not verified.

When your public app is ready, open it in Developers and click Request review:

  1. Describe what the app does and how it uses Yay! Forms data, and add a link to a short video or screenshots of the app.
  2. Prove that you own your website’s host with a DNS record (a TXT record on that exact host) or a File (at https://<your host>/.well-known/yayforms-app-verification.txt). Both contain the value shown on the screen, yayforms-app-verification=....
  3. Click Send for review.

The app shows In review and stays in testing until our team approves it. You get an e-mail when it is approved, rejected (with the reason) or suspended. After a rejection, fix what was pointed out and request a review again.

After approval, these changes send the app back to review: changing its redirect URLs, or changing its name, logo or website domain. While it is in review it counts as testing again (new accounts are limited to 10 and see Not verified), but connections that already exist keep working.

Switching a public app to private cuts off every account except yours right away.

4. Send people to the authorization screen

Your app generates a PKCE pair for each attempt: a random code_verifier (43 to 128 characters) and its code_challenge, the Base64URL-encoded SHA-256 of the verifier. PKCE with S256 is required for every app, even with a client secret. Then open this address in the person’s browser:

GET https://api.yayforms.com/oauth/authorize
  ?response_type=code
  &client_id=YOUR_CLIENT_ID
  &redirect_uri=https://app.example.com/yayforms/callback
  &scope=api
  &state=RANDOM_VALUE
  &code_challenge=CODE_CHALLENGE
  &code_challenge_method=S256
ParameterRequiredValue
response_typeYescode
client_idYesYour app’s client ID
redirect_uriYesOne of your app’s redirect URLs, exactly as registered
scopeYesapi
stateRecommendedA random value you check when the person comes back
code_challengeYesThe Base64URL SHA-256 of your code_verifier
code_challenge_methodYesS256
promptNologin asks the person to sign in again; consent always shows the screen

The person signs in to Yay! Forms (if needed) and sees the Allow access screen with your app’s name, logo and website, and what it will be able to do: View and edit your forms, responses, integrations and workspaces.

If they click Allow access, Yay! Forms redirects to your redirect URL with a one-time code:

https://app.example.com/yayforms/callback?code=AUTHORIZATION_CODE&state=RANDOM_VALUE

If they click Deny, the redirect carries error=access_denied and your state instead. Always check that state matches the value you sent.

A person who already allowed your app is sent straight back with a new code, without the screen. Send prompt=consent to always show it. prompt=none is not supported and returns error=login_required.

5. Exchange the code for tokens

From your server, send the code together with your client credentials and the code_verifier:

curl -X POST https://api.yayforms.com/oauth/token \
  -H "Accept: application/json" \
  -d grant_type=authorization_code \
  -d client_id=YOUR_CLIENT_ID \
  -d client_secret=YOUR_CLIENT_SECRET \
  -d redirect_uri=https://app.example.com/yayforms/callback \
  -d code=AUTHORIZATION_CODE \
  -d code_verifier=CODE_VERIFIER

The response:

{
  "token_type": "Bearer",
  "expires_in": 3600,
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...",
  "refresh_token": "def50200a1b2c3..."
}
  • The access token lasts 1 hour.
  • The refresh token lasts 30 days.
  • The code can be used once and expires quickly. Store both tokens on your server, never in the browser.

You can also send the client ID and secret with HTTP Basic authentication instead of the request body.

6. Call the API

Send the access token in the Authorization header:

curl https://api.yayforms.com/workspaces \
  -H "Accept: application/json" \
  -H "Authorization: Bearer ACCESS_TOKEN"

The token acts as the person who connected your app, with the same access an API key of that account has.

What your app can do:

  • Read and manage forms, questions and logic.
  • Read and delete responses.
  • Create and manage integrations and webhooks.
  • List and manage workspaces.

What your app cannot do:

  • Change the plan, billing or payment details (403).
  • Change account settings, create API keys or get sign-in links (403).
  • Read or manage the credentials stored for integrations, such as Google or Meta connections (403). Your app can still use a connection the person already made, without seeing its secrets.
  • See the account’s API key: it is never included in responses to your app.

The account’s access and plan rules apply as they do in the app. For example, when the account has no active plan, calls that need one return 402.

7. Refresh the access token

When the access token expires (a 401 response), exchange the refresh token for a new pair:

curl -X POST https://api.yayforms.com/oauth/token \
  -H "Accept: application/json" \
  -d grant_type=refresh_token \
  -d client_id=YOUR_CLIENT_ID \
  -d client_secret=YOUR_CLIENT_SECRET \
  -d refresh_token=REFRESH_TOKEN

The response has the same format as in step 5. Each refresh token works once: save the new refresh token and discard the old one. If the refresh fails, send the person through step 4 again.

8. Disconnect

When someone disconnects your app inside your product, revoke the token:

curl -X POST https://api.yayforms.com/oauth/revoke \
  -d client_id=YOUR_CLIENT_ID \
  -d client_secret=YOUR_CLIENT_SECRET \
  -d token=REFRESH_TOKEN

With valid client credentials, the answer is always 200 with an empty body, even for a token that was unknown or already revoked. Wrong client credentials return 401 with invalid_client, and a missing token returns 400 with invalid_request. Revoking either token of a connection ends that whole connection (both tokens).

People can also disconnect your app themselves in Your account › Connected apps. Either way, your tokens stop working right away.

Webhooks created by your app

Webhooks and other integrations your app creates are linked to it. When the person disconnects your app (or you revoke their last connection), Yay! Forms deletes them, so responses stop going to you. Deleting your app, or our team suspending or rejecting it, has the same effect for every connected account. Integrations the person created, or later edited themselves, are kept. So are your app’s integrations when a refresh token simply expires or the person signs out of all devices.

Limits

  • Rate limit: 120 requests per minute for each app and person. Above it, the API answers 429; the X-RateLimit-Limit and X-RateLimit-Remaining headers show where you are.
  • Testing: a public app that is not approved yet connects up to 10 accounts. An eleventh account sees that the app has reached its limit. A slot is freed when an account disconnects.
  • Apps per account: 10.

Discovery

The OAuth server metadata is at https://api.yayforms.com/.well-known/oauth-authorization-server, with the authorization and token endpoints. It is shared with AI assistants, so keep these in mind:

  • Its scopes_supported lists the AI assistant scopes. Apps always use scope=api.
  • The revocation endpoint is https://api.yayforms.com/oauth/revoke (step 8).
  • The registration_endpoint is for AI assistants only: partner apps are always registered in Developers.

Support

Contact help@yayforms.com for help building your app or with its review.

Conclusion

With an app registered in Developers, people connect Yay! Forms to your product with one click, you call the API with a short-lived token, and they keep control in Connected apps.

Related articles: