# Build with AppGram.
Add feedback, roadmaps, help centers, changelogs, surveys, and status pages to your app in minutes. Pick a platform below and start shipping.
## Sections
- [Overview](/docs)
- [Guides](/docs/guides/getting-started)
- [API authentication](/docs/guides/api-authentication)
- [Pagination and errors](/docs/guides/api-requests)
- [Customer identity and client credentials](/docs/guides/client-identity)
- [Receive webhooks](/docs/guides/webhooks)
- [Troubleshooting](/docs/guides/troubleshooting)
- [Going to production](/docs/guides/going-to-production)
- [Build with AI agents](/docs/guides/ai-agents)
- [React](/docs/react-sdk)
- [Getting started](/docs/guides/sdks/react)
- [Components](/docs/react-sdk#functions)
- [Hooks](/docs/react-sdk#hooks)
- [API client](/docs/react-sdk#classes)
- [Types and models](/docs/react-sdk#interfaces)
- [React Native](/docs/react-native-sdk)
- [Getting started](/docs/guides/sdks/react-native)
- [Components](/docs/react-native-sdk#functions)
- [Hooks](/docs/react-native-sdk#hooks)
- [API client](/docs/react-native-sdk#classes)
- [Types and models](/docs/react-native-sdk#interfaces)
- [Flutter](/docs/flutter-sdk)
- [Getting started](/docs/guides/sdks/flutter)
- [Widgets](/docs/flutter-sdk#classes)
- [State and providers](/docs/flutter-sdk#state-and-providers)
- [API client](/docs/flutter-sdk#api-client)
- [Types and models](/docs/flutter-sdk#types-and-models)
- [Enums](/docs/flutter-sdk#enums)
- [Swift](/docs/ios-sdk)
- [Getting started](/docs/guides/sdks/swift)
- [Views](/docs/ios-sdk#ui)
- [Client and services](/docs/ios-sdk#client-and-services)
- [Core types](/docs/ios-sdk#core)
- [Theming](/docs/ios-sdk#theme)
- [JavaScript embed](/docs/embed-sdk)
- [Getting started](/docs/guides/sdks/embed)
- [Lifecycle and methods](/docs/embed-sdk#appgram)
- [Settings](/docs/embed-sdk#appgramsettings)
- [Theming](/docs/embed-sdk#appgramtheme)
- [User identity](/docs/embed-sdk#appgramuser)
- [Types and events](/docs/embed-sdk#types)
- [API overview](/docs/guides/public-api)
- [Feature requests](/docs/api/wishes)
- [Support](/docs/api/support)
- [Help Center](/docs/api/help)
- [Roadmaps](/docs/api/roadmaps)
- [Surveys](/docs/api/surveys)
- [Blog](/docs/api/blog)
- [Monitors and status](/docs/api/monitors)
- [Forms](/docs/api/forms)
- [Waitlist](/docs/api/waitlist)
- [Releases](/docs/api/releases)
- [Analytics](/docs/api/analytics)
- [Webhooks](/docs/api/webhooks)
- [AI answers](/docs/api/ai)
- [Portal](/docs/api/portal)
---
# Getting started
Create an account and project, show feedback in your app, and verify your first saved vote.
Create an account, add a sample feature request, and display it in your application. Finish by casting a vote and confirming it in the dashboard. You need access to an email inbox and either a website or an application on one of the supported platforms.
The first feedback integration uses a public project ID. You do not need a management API key, a custom domain, or a webhook to complete it.
## 1. Create your account
1. Open [Create an account](https://app.appgram.dev/auth/register). If you already have an account, [sign in](https://app.appgram.dev/auth/login).
2. Enter your full name, email, and a password of at least eight characters, or use an available Google or GitHub sign-in option.
3. If AppGram asks you to confirm your email, open the confirmation message and complete that step before signing in. If it does not arrive, check spam and the email address you entered. Use the sign-in screen's confirmation controls when offered.
If a teammate invited you, open the invitation link and sign in with the invited email. Join that organization instead of creating a duplicate workspace. Ask its owner or administrator for project access if you cannot see the intended project.
**Check:** you can enter the dashboard or its workspace setup flow without a sign-in or email-confirmation error.
## 2. Create or select a project
For a new workspace, complete the onboarding **Setup** step with an organization name and a project name, such as `Feedback sandbox`. The organization holds your team and projects; the project selects the product whose feedback you will collect.
Choose the **SaaS product** use case for this walkthrough. It provides a feedback-oriented starting setup. Continue through the Brand, Team, and Launch steps; you can leave optional branding and invitations for later. Completing onboarding does not deploy your application.
If you already belong to an organization, select it and open [Projects](https://app.appgram.dev/projects). Choose **New project**, enter the name, and select **Create project**, or select an existing test project. Project creation requires project-management permission; ask an administrator if the control is unavailable.
> Use test content
>
> Use a separate development project and synthetic feedback for this walkthrough. Its portal data can be public to someone who has the project context. A project named “sandbox” still uses the real AppGram service. See [Going to production](/guides/going-to-production) for environment separation and plan checks.
**Check:** the intended organization and project are selected in the dashboard. Keep this selection when you create feedback and copy identifiers.
## 3. Add one visible feature request
1. Open the project's [feedback requests](https://app.appgram.dev/wishes).
2. Choose **New request**, enter the title `Feedback integration check`, and add a description such as `A sample request for verifying our AppGram integration.` Select a category if you need one, then choose **Create request**.
3. Open the new request. If it shows **Awaiting approval · approve**, approve this sample request with an account that has permission to manage feedback. An **Approved** request is visible on the public portal.
Feedback settings include **Require approval**. When it is enabled, a new submission can be stored successfully while remaining hidden from public lists. Keep the moderation policy you intend to use; approve the sample instead of disabling moderation just to pass this walkthrough.
**Check:** you can find the request by title in the dashboard and its approval indicator shows **Approved**.
## 4. Copy the matching project details
With the same project selected, open [Developer tools → Overview](https://app.appgram.dev/developer). Under **Identifiers**, copy **Project ID**. Use that value for every `YOUR_PROJECT_ID` placeholder below. **Organization ID** identifies the workspace and is a different value.
React, React Native, and Flutter examples also show organization and project slugs for features such as releases. On **Projects**, open the project's actions menu and select **View public page**. On the standard portal, its path has the form `/p/ORGANIZATION_SLUG/PROJECT_SLUG/`. Copy those two path segments, not the display names or IDs. If a custom domain hides that path, get the standard portal slugs from your workspace administrator. The organization slug is also shown under **Settings → Organization → URL slug**.
If Developer tools is unavailable, ask an administrator for access or for the project's public identifiers. Public identifiers are safe to configure in a client; management API keys belong on your backend. See [API authentication](/guides/api-authentication).
**Check:** your copied project ID belongs to the project containing `Feedback integration check`.
## 5. Show feedback in your application
Choose one route. The website demo is a complete page; SDK examples assume an existing application on that platform.
> > Website / JavaScript embed
> >
> > Create a folder containing `index.html` with this complete page. Replace `YOUR_PROJECT_ID`:
> >
> > ```html
> >
> >
> >
> >
> >
> > AppGram feedback demo
> >
> >
> > Feedback
> >
> >
> >
> >
> >
> > ```
> >
> > Serve that folder with your normal local web server. For example, if Python 3 is installed, run this from the folder and open the [local demo](http://localhost\:8000):
> >
> > ```bash
> > python3 -m http.server 8000 --bind 127.0.0.1
> > ```
> >
> > The feedback widget should appear inside the page. The script needs network access to AppGram's CDN and portal. Continue with [embed setup](/guides/sdks/embed) for floating mode, lifecycle, and script-policy details.
>
> > React / Next.js
> >
> > In an existing React application with React and React DOM 18 or newer:
> >
> > ```bash
> > npm install @appgram/react@0.2.5
> > ```
> >
> > Replace the project values and render this component from your application. For Vite, it can be `src/App.tsx`; for Next.js App Router, put it in a client component and render it from a page.
> >
> > ```tsx
> > 'use client';
> >
> > import { AppgramProvider, useAppgramContext, useVote, useWishes, type Wish } from '@appgram/react';
> >
> > function FeedbackVote({ wish }: { wish: Wish }) {
> > const { fingerprint } = useAppgramContext();
> > const { hasVoted, voteCount, isLoading, error, vote } = useVote({
> > wishId: wish.id,
> > initialVoteCount: wish.vote_count,
> > initialHasVoted: wish.has_voted,
> > });
> >
> > return (
> >
> >
> onClick={() => void vote()}
> > disabled={!fingerprint || isLoading || hasVoted}
> > aria-pressed={hasVoted}
> > >
> > {hasVoted ? 'Voted' : isLoading ? 'Saving…' : 'Vote'} ({voteCount})
> >
> > {!fingerprint &&
Preparing anonymous voting… }
> > {error &&
{error}
}
> >
> > );
> > }
> >
> > function Feedback() {
> > const { wishes, isLoading, error, refetch } = useWishes();
> >
> > if (isLoading) return Loading feedback…
;
> > if (error) return (
> >
> >
{error}
> >
void refetch()}>Try again
> >
> > );
> > if (wishes.length === 0) return No feature requests yet.
;
> >
> > return (
> > {wishes.map((wish) => (
> >
> > {wish.title}
> >
> >
> > ))}
> > );
> > }
> >
> > export default function App() {
> > return (
> > > projectId: 'YOUR_PROJECT_ID',
> > orgSlug: 'your-org',
> > projectSlug: 'your-project',
> > }}>
> >
> >
> > );
> > }
> > ```
> >
> > This example uses HTML and your own application styles, so it does not need the prebuilt component styling setup. Anonymous voting waits for the provider's fingerprint to initialize. Read [customer identity](/guides/client-identity) before changing that behavior, and [React setup](/guides/sdks/react) for prebuilt components and styling.
>
> > React Native
> >
> > Install the SDK and its native peer dependencies:
> >
> > ```bash
> > npm install @appgram/react-native@0.1.2
> > npm install @react-native-async-storage/async-storage lucide-react-native react-native-svg react-native-markdown-display react-native-render-html
> > ```
> >
> > Use versions compatible with your native application and complete their platform installation steps. Follow [React Native setup](/guides/sdks/react-native), replace the project values, and render its `WishList` screen under `AppgramProvider`.
>
> > Flutter
> >
> > ```bash
> > flutter pub add appgram_flutter:^1.0.0
> > ```
> >
> > Follow [Flutter setup](/guides/sdks/flutter), replace the project values in its complete `lib/main.dart` example, and run the application. Its `WishList` belongs inside `AppgramProvider`.
>
> > Swift
> >
> > Add the package with Swift Package Manager:
> >
> > ```swift
> > .package(url: "https://github.com/AppGram/apple-sdk.git", from: "1.0.1")
> > ```
> >
> > The package supports iOS 17+ and macOS 14+. Follow [Swift setup](/guides/sdks/swift) to add the `AppGramSDK` product, configure your public project ID, and display the feedback view.
**Check:** `Feedback integration check` appears in your page or application. A successful empty list means the connection worked but no matching public request was returned; it does not complete this sample-content check.
You can isolate the data request from the interface with:
```bash
curl --get --include 'https://api.appgram.dev/portal/wishes' \
--data-urlencode 'project_id=YOUR_PROJECT_ID' \
--data-urlencode 'search=Feedback integration check' \
--data-urlencode 'page=1' \
--data-urlencode 'per_page=20'
```
Expect HTTP **200** and the sample title in the response's `data` list. If the list is empty, check project selection and approval. If the request fails, inspect its HTTP status and body using [pagination and errors](/guides/api-requests) and [troubleshooting](/guides/troubleshooting).
## 6. Cast a vote and confirm it in the dashboard
1. Find `Feedback integration check` in your application and note its vote count.
2. Cast one vote using the widget's vote control, the native feedback interface, or the React example's **Vote** button. Wait for the request to finish; check any error shown by the interface.
3. Refresh the same request in the dashboard. Its vote count should include your vote. Reload your application and confirm the count is still present.
If this customer identity has already voted, another click may remove the vote in interfaces with toggle controls; the React example instead shows **Voted** and disables its button. A local count change alone is not confirmation that the server saved it. Refresh the dashboard and check the network response when the two disagree.
**Check:** the sample request is visible in the application and the dashboard reflects the saved vote. You now have a working feedback integration.
## 7. Verify submissions and prepare for production
If your chosen interface includes a submission form, submit a second synthetic request with a distinct title. Confirm it arrives in the dashboard. With **Require approval** enabled, approve it there before expecting it in the public list. Complete any customer verification or bot-protection challenge the form presents. The React example above covers reading and voting; adding a submission form is a separate step using the documented [React components and client APIs](/react-sdk).
Before exposing the integration to customers, follow [Going to production](/guides/going-to-production) for project separation, team permissions, plan restrictions, credentials, identity, and launch checks. Add [webhooks](/guides/webhooks) only when your integration needs server notifications.
Use the [public API reference](/guides/public-api) for HTTP workflows, or [Build with AI agents](/guides/ai-agents) to give your coding assistant the same documentation.
---
# API authentication
Use project identifiers for portal requests and API keys for management operations.
AppGram has two request surfaces. Management operations use an API key on your server. Portal operations identify the project and are designed for your customer-facing application. Each operation in the reference shows whether authentication is required.
## API base URL
```text
https://api.appgram.dev
```
Use the complete path shown in the reference. Management paths start with `/api/v1`; portal paths start with `/portal`.
Follow the operation's authentication badge rather than relying only on its path prefix. Some public status and submission operations also live under `/api/v1`.
## Management requests
### Create a management key
1. Select the intended organization in the [AppGram dashboard](https://app.appgram.dev).
2. Open [Developer tools → API keys](https://app.appgram.dev/developer/api-keys) and select **Create API key**. The key manager is also available in **Settings → Organization → Developer**.
3. Enter a recognizable name, such as `feedback-production-backend`. Under **Access**, select the project your backend serves. Select **Organization-wide** only when it needs access across that organization's projects.
4. Select the permissions needed by your documented operations and choose **Expiration**. An organization-wide key still needs the appropriate operation scopes.
5. Create the key and save the full value immediately in your server's secret storage. The full key is shown only once; the prefix displayed later is not a usable credential. Select **I've saved it** when finished.
API-key administration is restricted to accounts with the appropriate capability; organization owners and administrators have it by default. Access to the Developer tools area is also required. Ask your administrator if the page or creation control is unavailable. A dashboard session and a public project ID do not authorize management requests.
### Verify a server request
Send the key in the `x-api-key` header:
```bash
curl --request GET \
--url 'https://api.appgram.dev/api/v1/monitors?status_page_id=YOUR_STATUS_PAGE_ID' \
--header 'x-api-key: YOUR_API_KEY'
```
This operation requires the `status:view` scope. Use a status page your key can access. The monitor list accepts `status_page_id`; it does not use a `project_id` query filter.
> Keep API keys on your server
>
> Do not ship a management API key in a browser bundle, mobile application, public repository, or embed configuration. Use a server endpoint for management operations.
API keys are limited by their organization or project and granted permissions. A key does not grant access to another organization's resources. Follow the operation's required path, query parameters, and request body.
## Rotate or revoke a key
To replace a key before it expires:
1. Create a replacement with the intended project access, scopes, and expiration. Give it a name that distinguishes it from the old key.
2. Update the secret in every backend that uses the old key, and deploy or restart those consumers as required.
3. Make a documented read request with the replacement against a resource it can access. Confirm a successful HTTP response and check for authentication failures in your application logs.
4. In **Developer tools → API keys**, open the old key's actions and select **Revoke**. Confirm the action after its consumers have switched.
Revocation cannot be undone and requests using the revoked key stop working. If a key is exposed, revoke it promptly and replace the affected consumers; do not wait for normal expiry. If you lose the full value, create a replacement rather than trying to authenticate with its displayed prefix. Use separate keys for development and production.
For environment and deployment checks, see [Going to production](/guides/going-to-production).
## Operation scopes
The reference includes required scopes in the operation description when the public contract declares them. Examples include:
| Scope | Example operation |
| --- | --- |
| `status:view` | List monitors |
| `status:manage` | Create or update a monitor |
| `surveys:view` | List or read surveys |
| `surveys:manage` | Create or update surveys |
| `analytics:view` | Read form or survey analytics |
| `forms:view` | Read form overview or submissions |
| `forms:manage` | Read a contact form's management configuration |
| `settings:view` | Read a support form's configuration |
| `settings:manage` | Create or update contact and support forms |
| `wishlist:view` | Read a project's waitlist |
| `releases:view` | Read release recipients |
| `releases:manage` | Send a release demonstration |
These are examples from the published operations, not a substitute for checking the operation you call. A read-looking HTTP method can still require a management scope for sensitive configuration.
## Portal requests
Portal requests do not require a management API key. Pass your public project identifier in `project_id` where the operation requires it; configured custom domains can also provide project context.
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/wishes?project_id=YOUR_PROJECT_ID'
```
Public access still follows the operation's requirements. Some customer workflows use their own identity, ticket token, or verification step. Read the parameters for the specific operation rather than adding a management key to the client.
## SDK configuration
Use the public project ID for client SDK setup. React, React Native, and Flutter can also use your organization and project slugs for features such as releases. Follow the [getting started guide](/guides/getting-started) and your platform reference for the exact configuration shape.
## Handle errors
* **400**: check required fields, parameter types, and validation errors.
* **401**: check that a required API key or customer credential is present and valid.
* **403**: check the key's permissions and access to the requested project.
* **404**: check the complete path and resource identifier.
* **429**: pause requests and respect `Retry-After` when the response provides it. Use bounded retries with backoff.
The published OpenAPI contract describes each operation's documented responses. Do not assume a fixed rate limit or that every response includes rate-limit headers.
Continue with the [public API coverage guide](/guides/public-api) or [monitor reference](/api/monitors).
---
# Public API coverage
Download the public OpenAPI contract and choose a documented operation.
The API reference is generated from AppGram's reviewed public OpenAPI contract. It covers published customer operations and their public request and response fields.
## Download the contract
[Download the public OpenAPI JSON](/openapi.json) to import it into your API client or generate an HTTP client. The reference and download use the same committed contract.
The base URL is `https://api.appgram.dev`. Read [API authentication](/guides/api-authentication) before calling a management operation.
## Choose a surface
| Reference | Use it for |
| --- | --- |
| [Feature requests](/api/wishes) | Public ideas, categories, and voting |
| [Support](/api/support) | Customer support requests and conversations |
| [Help Center](/api/help) | Published help content and decision flows |
| [Roadmaps](/api/roadmaps) | Your public product roadmap |
| [Surveys](/api/surveys) | Survey management and customer responses |
| [Blog](/api/blog) | Published posts, categories, tags, and feeds |
| [Monitors and status](/api/monitors) | Monitoring, maintenance, and public status |
| [Forms](/api/forms) | Contact forms and submissions |
| [Waitlist](/api/waitlist) | Project waitlist membership |
| [Releases](/api/releases) | Release recipients and demonstration delivery |
| [Analytics](/api/analytics) | Comprehensive, form, and survey analytics |
| [Webhooks](/api/webhooks) | Sample webhook event payloads |
| [AI answers](/api/ai) | Questions against published project content |
| [Portal](/api/portal) | Project resolution, page data, and CAPTCHA challenges |
## Request examples
Each operation includes HTTP examples in cURL, TypeScript, Python, Go, Swift, Kotlin, Dart, and C#. These examples follow the operation's authentication and required parameters. Replace placeholder values with your own project and resource identifiers.
For platform components and native library methods, use the SDK references: [Swift](/ios-sdk), [React](/react-sdk), [React Native](/react-native-sdk), [Flutter](/flutter-sdk), and [JavaScript embed](/embed-sdk).
## Availability
The published contract defines the supported public API surface. Dashboard capabilities and SDK features can have a different surface. An operation absent from this reference, including license-key management, is not part of this published contract. [Contact AppGram](https://appgram.dev/contact) if your integration needs additional API coverage.
---
# Build with AI agents
Give your coding agent the current AppGram guides, SDK references, and API contract.
Give your coding agent the current documentation before asking it to build an AppGram integration. AppGram provides SDK references for client applications and a public REST API for customer-facing and server workflows.
## Documentation for agents
* [Documentation index](/llms.txt): Markdown URLs for every guide, SDK, and API section.
* [Complete Markdown reference](/llms-full.txt): the entire public documentation corpus.
* [Structured JSON index](/agent/index.json): searchable entries with links to Markdown and per-page JSON.
* [Public OpenAPI contract](/openapi.json): the published HTTP operations and schemas.
Each documentation page also has a **Markdown** link in the header. Use the focused guide or SDK page when you already know the platform.
## Start an integration
Copy this prompt into your coding agent:
```text
Integrate this project with AppGram (https://appgram.dev).
First read https://appgram.dev/docs/llms.txt and the getting started guide:
https://appgram.dev/docs/format-md/guides/getting-started.md
Read the reference for my platform before writing SDK calls. For REST, read:
https://appgram.dev/docs/format-md/guides/api-authentication.md
https://appgram.dev/docs/openapi.json
Use only documented endpoint paths, method names, and fields. Cite the page
you used. If the needed operation is absent, explain the gap.
REST base URL: https://api.appgram.dev
Management requests: /api/v1 paths, with an x-api-key header on the server.
Portal requests: /portal paths, with public project context where required.
Keep management API keys out of browser and mobile bundles.
```
## Connect AppGram MCP
For managing AppGram content from an editor, open [Developer tools → Overview](https://app.appgram.dev/developer) and use **Connect an AI assistant** to obtain the MCP server URL and client configuration. Use the connection instructions shown for your account, then list the available tools to verify the connection.
Use the REST API or an SDK for your application's runtime integration. MCP credentials and management API keys belong in the appropriate client or server environment.
---
# React setup
React and Next.js setup with loading, errors, styling, and project context.
Use `@appgram/react` for React and Next.js applications. Start with the headless hook below, then choose the prebuilt components when you want AppGram's interface.
## Install
React 18+ and React DOM 18+ are peer dependencies. In an existing React application:
```bash
npm install @appgram/react@0.2.5
```
## Show feedback and cast a vote
Copy this into a component file and replace the project values. The provider supplies configuration to every AppGram hook and component below it. This example uses your application's HTML and styles.
```tsx
'use client';
import { AppgramProvider, useAppgramContext, useVote, useWishes, type Wish } from '@appgram/react';
function FeedbackVote({ wish }: { wish: Wish }) {
const { fingerprint } = useAppgramContext();
const { hasVoted, voteCount, isLoading, error, vote } = useVote({
wishId: wish.id,
initialVoteCount: wish.vote_count,
initialHasVoted: wish.has_voted,
});
return (
void vote()}
disabled={!fingerprint || isLoading || hasVoted}
aria-pressed={hasVoted}
>
{hasVoted ? 'Voted' : isLoading ? 'Saving…' : 'Vote'} ({voteCount})
{!fingerprint &&
Preparing anonymous voting… }
{error &&
{error}
}
);
}
function Feedback() {
const { wishes, isLoading, error, refetch } = useWishes();
if (isLoading) return Loading feedback…
;
if (error) return (
{error}
void refetch()}>Try again
);
if (wishes.length === 0) return No feature requests yet.
;
return (
{wishes.map((wish) => (
{wish.title}
))}
);
}
export default function App() {
return (
);
}
```
First create and approve `Feedback integration check` using [Getting started](/guides/getting-started#3-add-one-visible-feature-request). Replace the project values, then confirm that request appears in the list. Cast a vote and refresh the dashboard to verify the saved count.
The button waits for the provider's anonymous fingerprint, shows vote errors, and disables after a successful vote. If you disable fingerprint initialization, this example cannot cast anonymous votes. Read [customer identity](/guides/client-identity) before choosing another identification workflow.
A successful empty list is different from a failed request. Check the selected project, approval, and filters if your sample is missing. Follow the complete [signup-to-feedback walkthrough](/guides/getting-started) when setting up a new workspace.
## Next.js App Router
Keep `'use client'` at the top of the file that uses the provider and hooks. Render this client component from your page or layout. Do not add a management API key to a `NEXT_PUBLIC_` variable or to provider configuration.
## Prebuilt components and styles
The package also exports `WishList`, `RoadmapBoard`, `HelpCenter`, `Releases`, `SupportForm`, and other components. They use Tailwind utility classes; the package does not ship a standalone stylesheet.
If your application uses Tailwind CSS 3, preserve your existing configuration and include the package's compiled files and preset:
```js
// tailwind.config.cjs — merge these entries into your existing config
module.exports = {
presets: [require('@appgram/react/tailwind-preset')],
content: [
'./src/**/*.{js,ts,jsx,tsx}',
'./node_modules/@appgram/react/dist/**/*.{js,mjs}',
],
};
```
The preset supplies AppGram color and animation tokens; content scanning supplies the utility styles. If your build uses a different Tailwind version, use that version's package-source registration rules. The headless hooks let you keep your own styling system.
## Project configuration
`projectId` is required. Supply `orgSlug` and `projectSlug` for public URL and release routing. `apiUrl` can select your own API deployment; it defaults to `https://api.appgram.dev`.
Anonymous fingerprinting is enabled by default and can be disabled with `enableFingerprinting: false`. Read [Customer identity and client credentials](/guides/client-identity) before choosing that behavior.
Continue with the [React reference](/react-sdk), [pagination and errors](/guides/api-requests), or [troubleshooting guide](/guides/troubleshooting).
---
# React Native setup
Install native peers and render your first AppGram screen.
Use `@appgram/react-native` inside a React Native application. The package requires React 18+ and React Native 0.70+.
## Install the SDK and peers
```bash
npm install @appgram/react-native@0.1.2
npm install @react-native-async-storage/async-storage lucide-react-native react-native-svg react-native-markdown-display react-native-render-html
```
These five packages are peer dependencies, not optional extras. Use versions compatible with your application's React Native or Expo version, and complete the native dependency setup required by those packages. Adding a JavaScript dependency alone does not update an already installed native application.
## Show a feedback screen
Replace the project values and render the provider above the screens that use AppGram:
```tsx
import React from 'react';
import { SafeAreaView } from 'react-native';
import { AppgramProvider, WishList } from '@appgram/react-native';
export default function App() {
return (
);
}
```
`WishList` includes the feature-request interface. For a custom native screen, use the documented `useWishes` hook and its loading, error, and pagination state.
Use [Getting started](/guides/getting-started) to create and approve a sample request before testing this screen. Confirm it appears, cast a vote, and refresh the dashboard to check the saved count. An empty successful response is not a native setup error.
## Add other surfaces
The SDK exports `RoadmapBoard`, `Releases`, `HelpCenter`, `SupportForm`, `SurveyForm`, and `StatusBoard`. Keep their screens under the same provider. Supply organization and project slugs for release and public URL routing.
Configuration accepts `apiUrl` for an API deployment override, `theme` for native colors, and `enableFingerprinting` for anonymous identification. See [Customer identity and client credentials](/guides/client-identity).
## If native modules cannot be found
Check that every peer dependency is installed in the application workspace, with a version supported by your platform. Complete that package's platform installation steps, then restart the JavaScript bundler and install an updated native application. Reloading JavaScript cannot add a missing native module.
Continue with the [React Native reference](/react-native-sdk) and [troubleshooting guide](/guides/troubleshooting).
---
# Flutter setup
Configure the Flutter provider and render a feedback screen.
Use `appgram_flutter` for Flutter applications. Version 1.0.0 declares Dart 3+ and Flutter 3.10+ requirements.
## Install
```bash
flutter pub add appgram_flutter:^1.0.0
```
The package declares its Riverpod and HTTP dependencies. Keep the resolved package versions in your application's lockfile.
## Show a feedback screen
Replace the project details in `lib/main.dart`:
```dart
import 'package:flutter/material.dart';
import 'package:appgram_flutter/appgram_flutter.dart';
void main() {
runApp(
const AppgramProvider(
config: AppgramConfig(
projectId: 'YOUR_PROJECT_ID',
orgSlug: 'your-org',
projectSlug: 'your-project',
),
child: MaterialApp(
home: Scaffold(
body: SafeArea(child: WishList()),
),
),
),
);
}
```
`AppgramProvider` creates the SDK's Riverpod scope and configuration. Keep AppGram widgets inside that provider. `WishList` displays your project's requests with its built-in loading, error, filtering, and pagination controls.
Create and approve the sample request from [Getting started](/guides/getting-started), confirm it appears in `WishList`, then cast a vote and refresh the dashboard to verify persistence. Check project selection and approval if the screen receives an empty successful response.
## Configure other surfaces
Supply `orgSlug` and `projectSlug` for release routing. The API origin override is `apiUrl`; its default is `https://api.appgram.dev`. Do not add `/api/v1` to that origin.
The package also exports roadmap, help, support, status, survey, contact-form, and blog widgets and providers. Read the specific symbol before wiring callbacks or request models.
Device fingerprinting is enabled by default. Set `enableFingerprinting: false` when your integration should not initialize it. Read [Customer identity and client credentials](/guides/client-identity).
## Reference coverage
The [Flutter reference](/flutter-sdk) currently imports the package's existing Dartdoc symbol index. It lists public classes and functions, but has less signature detail than a full Dartdoc HTML archive. This setup guide supplies a complete first screen; consult the linked package source when a symbol needs details absent from the index.
[Published package and source](https://pub.dev/packages/appgram_flutter) · [Troubleshooting](/guides/troubleshooting)
---
# Swift setup
Add the tagged Swift package, configure it, and show native feedback.
Use the native SwiftUI SDK for iOS 17+ and macOS 14+. The package uses Swift tools 5.9 or newer.
## Add the package
Add the public package with Swift Package Manager. Version 1.0.1 is a tagged release:
```swift
.package(url: "https://github.com/AppGram/apple-sdk.git", from: "1.0.1")
```
Add the `AppGramSDK` library product to your application target. The imported module is `AppGramSDK`, with that capitalization.
## Configure and open feedback
Configure the singleton on the main actor before requesting a view. Replace the project ID:
```swift
import SwiftUI
import AppGramSDK
@main
@MainActor
struct FeedbackApp: App {
init() {
AppGramSDK.shared.configure(projectId: "YOUR_PROJECT_ID")
}
var body: some Scene {
WindowGroup {
NavigationStack {
if let feedback = try? AppGramSDK.shared.feedbackView() {
feedback
} else {
Text("Configure AppGram before opening feedback.")
}
}
}
}
}
```
The view factory throws when the SDK is not configured. The example handles that failure instead of force-unwrapping the result.
Before testing the view, create and approve the sample request in [Getting started](/guides/getting-started). Confirm it appears, cast a vote, and refresh the same request in the dashboard to check the saved count. An empty successful response can mean the project has no approved feedback.
> Client configuration uses a public project ID
>
> Leave the optional `apiKey` argument unset in a distributed application. A management API key belongs on your server. Some older generated reference examples include that argument; it is not required for this client setup.
## Identify the current customer
After sign-in, you can supply customer context:
```swift
AppGramSDK.shared.setUser(
userId: "customer-123",
email: "customer@example.com",
name: "Alex"
)
// When the customer signs out:
AppGramSDK.shared.clearUser()
```
Customer context associates feedback and support activity; it does not grant management permissions. Send only the fields your application needs.
## Other views and configuration
The [Swift reference](/ios-sdk) documents the available view factories, services, configuration types, and models. For releases and announcements, consult `AnnouncementConfiguration` and its organization and project slugs. `baseURL` accepts the API origin and defaults to `https://api.appgram.dev`.
[Public package source](https://github.com/AppGram/apple-sdk) · [Troubleshooting](/guides/troubleshooting)
---
# JavaScript embed setup
Add floating or inline widgets to any website.
Use the JavaScript embed to add AppGram to a website without installing a framework package. The script runs in the browser and loads your project's portal in a widget.
## Add a floating widget
Place this in your page and replace the project ID. A public `organization-slug/project-slug` project key is also supported.
```html
```
The script initializes from `data-project`. Load it once per page. A management API key is not part of embed configuration.
For a complete `index.html` page and local-server command, follow [Show feedback in your application](/guides/getting-started#5-show-feedback-in-your-application). Create and approve the walkthrough's sample request first, then cast a vote in the widget and confirm the saved count in the dashboard.
## Inline mode
Create the container before loading the script. Define settings before the script tag:
```html
```
The widget needs an existing container with visible dimensions. If your site uses a strict Content Security Policy, authorize the script and the portal iframe origin your project uses; an inline settings script also needs your application's approved nonce or hash.
## Open a page from your own button
After the script has loaded and initialized:
```javascript
window.AppGram.open('feedback');
window.AppGram.close();
```
Do not call these methods from a script that runs before the external SDK has loaded. For a custom initialization flow, use the documented `onReady` callback and instance API.
## Customer context and cleanup
The embed supports `user` in its initial settings and `setUser` for an active customer. For single-page applications, tear down the widget with `destroy()` when its owning screen is removed. Treat account changes and sign-out as a widget lifecycle change; do not assume passing an empty user object clears previous identity.
Continue with the [embed reference](/embed-sdk), [customer identity guide](/guides/client-identity), and [troubleshooting guide](/guides/troubleshooting).
---
# Pagination and errors
Send requests, handle response envelopes, and retry safely.
Use the complete operation path from the reference. The API origin is `https://api.appgram.dev`; each operation defines its own parameters, authentication, and response shape.
## Project context
For portal requests, include your public project ID when the operation declares `project_id`. A configured custom domain can supply project context in other flows. The generated portal examples include a project-ID placeholder so you can make a request without configuring a domain first.
Path identifiers are resource-specific. A `status_page_id` is not a project ID, and a survey ID is not its public slug. Replace every placeholder in an example with the matching identifier.
## Paginate feature requests
The public wish list accepts `page` and `per_page`:
```bash
curl --get 'https://api.appgram.dev/portal/wishes' \
--data-urlencode 'project_id=YOUR_PROJECT_ID' \
--data-urlencode 'page=1' \
--data-urlencode 'per_page=20'
```
Its documented response contains `success`, `data`, `page`, `per_page`, `total`, and `total_pages`. Treat a nullable `data` value as an empty list. Use the returned pagination metadata instead of assuming another page exists.
```javascript
const url = new URL('https://api.appgram.dev/portal/wishes');
url.searchParams.set('project_id', 'YOUR_PROJECT_ID');
url.searchParams.set('page', '1');
url.searchParams.set('per_page', '20');
const response = await fetch(url);
const body = await response.json();
if (!response.ok || body.success === false) {
throw new Error(body.error?.message ?? `HTTP ${response.status}`);
}
const wishes = body.data ?? [];
const nextPage = body.page < body.total_pages ? body.page + 1 : null;
console.log({ wishes, nextPage });
```
Other operations can return a plain array, a single object, or a different envelope. In particular, the monitor list returns an array. Do not apply the wish-list envelope to every endpoint. Blog feed endpoints return XML; read their declared media type before parsing.
## Handle documented errors
The common JSON error schema is:
```json
{
"success": false,
"error": {
"code": "ERROR_CODE_FROM_THE_RESPONSE",
"message": "A description of the failure"
}
}
```
`error.details` may also be present. The code above is a placeholder for the actual response code, not a complete error-code catalog. Check both the HTTP status and the documented error body. A proxy or network failure can return a non-JSON response, so production clients should handle parsing failures too.
For **401**, check credentials. For **403**, check project access and the scope named in the operation description. For **400**, check identifiers, required fields, and validation constraints. See [API authentication](/guides/api-authentication).
## Retries and mutations
Use bounded backoff for transient read failures and respect `Retry-After` when supplied. Do not immediately retry every failed request.
A timeout on a mutation does not tell you whether the server completed it. Check the resulting resource before retrying creation or sending another message. Only use an idempotency header when the operation explicitly documents one.
## Generated examples
Request and response examples illustrate the contract. Replace IDs, slugs, and credentials, and choose values that meet the operation's validation rules. They are not records from your project. HTTP examples in Swift or Dart are separate from the native [Swift](/ios-sdk) and [Flutter](/flutter-sdk) SDK APIs.
---
# Customer identity and client credentials
Configure public project context, anonymous identification, and account changes.
Your project identifier selects the AppGram project. Customer identity associates activity with a person. A management API key authorizes server operations. Keep those responsibilities separate when configuring an integration.
## Public client configuration
Use a public project ID in React, React Native, Flutter, and Swift. The embed accepts a public project ID or an `organization/project` key. Organization and project slugs help route public pages and releases; they do not act as passwords.
Keep management keys on your backend. Do not place them in provider props, frontend environment variables, mobile bundles, HTML attributes, or customer identity fields. The [authentication guide](/guides/api-authentication) explains server requests.
## Anonymous identification
The React, React Native, and Flutter providers enable fingerprinting by default for anonymous identification. Set `enableFingerprinting: false` in their configuration to avoid initializing it:
```tsx
```
The Flutter setting uses the same name in `AppgramConfig`. This option controls the SDK's fingerprint initialization; it does not remove identity your application explicitly supplies in a request. Decide which identification behavior your product needs before initializing the SDK.
## Signed-in customers
The platforms expose different APIs. Do not assume every SDK has an `identify` or `setUser` method.
| Platform | Customer context |
| --- | --- |
| Swift | `AppGramSDK.shared.setUser(...)`; call `clearUser()` on sign-out |
| JavaScript embed | Initial `user` settings or the documented `setUser` method; reset the widget lifecycle on account changes |
| React and React Native | Use the documented identity fields for the particular submission, vote, or support workflow |
| Flutter | Use the documented input models for the particular workflow |
Only send the customer fields needed by that workflow. Customer context is not proof of management access. Support conversations can require their own ticket token or verification step; a display name or email field does not replace that credential.
## Sign-out and account changes
Clear Swift customer context when the account signs out. For embeds, do not assume `setUser({})` clears all previous fields; remove the old widget and initialize a fresh customer session, or reload the owning page. Remove account-specific data from your own state and cached screens too.
If two projects share an application, supply the correct project configuration for the active surface. Avoid keeping a previous account's private support content on screen after changing users.
Continue with the [platform setup guides](/guides/getting-started) or [troubleshooting](/guides/troubleshooting).
---
# Receive webhooks
Verify HMAC signatures, deduplicate events, and handle delivery retries.
Receive AppGram events on your server when feedback, support, or other subscribed activity changes. Configure endpoints and event subscriptions in the dashboard's [Developer tools → Webhooks](https://app.appgram.dev/developer/webhooks) area.
## Configure an endpoint
1. Select your project or organization in the [dashboard](https://app.appgram.dev).
2. Open Webhooks and add the endpoint at the appropriate project or organization scope.
3. Enter a reachable HTTPS receiver URL and select the event types you need.
4. Save the signing secret securely when it is shown. Keep it on the receiving server.
5. Use the endpoint's delivery history or **Developer tools → Logs → Webhook deliveries** to inspect success and failure responses.
The published REST contract currently exposes a sample-payload operation. Endpoint registration and subscription management are dashboard workflows; they are not additional public API operations implied by that sample endpoint.
## Inspect a sample payload
Copy an exact event type from the dashboard's event catalog:
```bash
curl --request GET \
--url 'https://api.appgram.dev/api/v1/webhooks/events/YOUR_EVENT_TYPE/sample' \
--header 'x-api-key: YOUR_API_KEY'
```
The sample is synthetic and does not deliver a webhook. The [sample-payload reference](/api/webhooks) describes its response.
## Verify delivery signatures
AppGram posts JSON with these headers:
| Header | Meaning |
| --- | --- |
| `X-Webhook-ID` | Identifier for this delivery attempt |
| `X-Webhook-Timestamp` | Attempt time as Unix seconds |
| `X-Webhook-Signature` | `t=,v1=` |
The signature is the lowercase hexadecimal HMAC-SHA256 of **`timestamp + "." + raw HTTP body`**, using your endpoint's signing secret. Verify the original request bytes before parsing JSON. Re-serializing JSON changes the bytes and can invalidate a legitimate signature.
This Node.js verifier rejects malformed signatures and uses a five-minute clock tolerance:
```javascript
import { createHmac, timingSafeEqual } from 'node:crypto';
export function verifyAppGramWebhook(rawBody, signatureHeader, secret, now = Date.now()) {
if (!Buffer.isBuffer(rawBody) || typeof signatureHeader !== 'string' || !secret) return false;
const match = /^t=(\d+),v1=([a-f0-9]{64})$/i.exec(signatureHeader);
if (!match) return false;
const timestamp = Number(match[1]);
if (!Number.isSafeInteger(timestamp) || Math.abs(now - timestamp * 1000) > 300_000) return false;
const expected = createHmac('sha256', secret)
.update(`${match[1]}.`)
.update(rawBody)
.digest();
return timingSafeEqual(expected, Buffer.from(match[2], 'hex'));
}
```
Pass the raw request buffer, the `X-Webhook-Signature` value, and your endpoint secret. Reject the request if verification fails. Configure a request-body size limit in your HTTP server. Keep its clock synchronized and choose a tolerance appropriate to your deployment.
Only parse the JSON after verification succeeds. In frameworks with JSON middleware, preserve the raw body for this route rather than signing `JSON.stringify(parsedBody)`.
## Process once and acknowledge promptly
The payload includes `id`, `event`, `timestamp`, and event-specific `data`; it can also contain metadata. Use the signed payload's **`id`** for durable deduplication. `X-Webhook-ID` identifies an attempt and changes between retries.
Store accepted events or enqueue them durably, then return a **2xx** response promptly. Return a success response for an already processed event without repeating its side effects. Do not assume delivery order.
## Retries and failures
Failed deliveries can be attempted up to eight times in total. Retry delays increase approximately through 30 seconds, 2 minutes, 10 minutes, 30 minutes, 2 hours, 6 hours, and 24 hours; scheduling and endpoint state affect actual timing. Retries use a fresh attempt timestamp and signature while retaining the event ID.
Inspect delivery history when your receiver is unreachable or returns a non-2xx status. Changing a signing secret requires updating the receiving server too. The local signature example does not test your deployed endpoint; verify one actual delivery with your own configured endpoint before relying on the integration.
---
# Troubleshooting
Resolve setup, identity, styling, dependency, and request problems.
Start with one documented read request and one SDK screen. Check the project, identifiers, and HTTP response before adding more features.
## Account or workspace setup is blocked
If sign-in asks for email confirmation, complete the confirmation message for the email you registered. Check spam and the address you entered if it is missing. An invitation must be accepted with the intended account; registering a different email does not grant access to that organization.
If your organization appears but its project or Developer tools does not, ask the owner or administrator to check your membership and permissions. Creating projects, approving feedback, opening Developer tools, and managing API keys can require different access. See [Getting started](/guides/getting-started) and [team access](/guides/going-to-production#give-teammates-the-access-they-need).
## No data appears
1. Confirm the SDK uses your public project ID, not a project slug or API key.
2. Check that the content exists and is visible on public surfaces. For feedback, open the sample request in the dashboard and check **Approved**. If it shows **Awaiting approval · approve**, a teammate with feedback-management permission must approve it.
3. Inspect the actual network response. A successful empty list is different from an error.
4. Compare the request path and query names with the [public reference](/guides/public-api).
Use this read request to isolate project context from UI configuration:
```bash
curl --get 'https://api.appgram.dev/portal/wishes' \
--data-urlencode 'project_id=YOUR_PROJECT_ID' \
--data-urlencode 'page=1' \
--data-urlencode 'per_page=1'
```
A request can be saved in the dashboard while remaining hidden from public lists when **Require approval** is enabled. Compare the project selected when you created it with the **Project ID** copied from **Developer tools → Overview**, then remove search or status filters that exclude it.
## Voting does not save
The React walkthrough waits for the provider's fingerprint before enabling **Vote**. If it remains on **Preparing anonymous voting…**, check the browser console, provider initialization, and whether you set `enableFingerprinting: false`. That example needs a fingerprint to cast an anonymous vote.
Check the vote request's response and any UI error. A local count change is not proof that the server saved it; refresh the dashboard and reload the application. One customer identity cannot add repeated votes to the same request. Some interfaces toggle an existing vote off, while the React walkthrough disables its button after voting.
## Provider or configuration errors
React and React Native hooks must render below `AppgramProvider`, not in the component that is still constructing the provider. Flutter widgets need the scope supplied by `AppgramProvider`. Swift view factories require `configure(projectId:)` first.
See the complete startup examples for [React](/guides/sdks/react), [React Native](/guides/sdks/react-native), [Flutter](/guides/sdks/flutter), and [Swift](/guides/sdks/swift).
## React UI is unstyled
The prebuilt React components use Tailwind classes. Include the package's compiled files in content scanning and use its preset when configuring Tailwind CSS 3. There is no separate SDK stylesheet to import. The [React setup guide](/guides/sdks/react) includes the configuration; headless hooks work with your own UI.
## A React Native module cannot be resolved
Install all five peer packages listed in the [React Native setup guide](/guides/sdks/react-native). Use versions compatible with your platform and complete their native installation steps. Restarting the JavaScript bundle alone cannot install a native dependency.
## Release pages are empty
Check both `orgSlug` and `projectSlug` as well as the project ID. For Swift announcements, inspect `AnnouncementConfiguration` in the [Swift reference](/ios-sdk). Confirm that the release is published for the selected project.
## The embed does not initialize
Load the script once, provide `data-project` or define `window.appgramSettings` before the script, and wait for loading before calling `window.AppGram` methods. Inline mode needs an existing container with a visible height. Check browser errors and your site's script and iframe policy.
See [Embed setup](/guides/sdks/embed). A blocked script, a hidden container, and a failed portal request have different fixes.
## Authentication fails
Management operations use `x-api-key` on your server. Check the operation's scope and the key's access to the resource. A status page ID, project ID, survey ID, and public slug are not interchangeable. Portal workflows can use a separate customer token; do not replace it with a management key in the browser.
See [API authentication](/guides/api-authentication) and [pagination and errors](/guides/api-requests).
## A production-only feature or request fails
Compare production project IDs and slugs with the environment you tested. Check the organization's subscription, resource access, and team role when an action is unavailable. If browser requests fail while cURL succeeds, inspect the actual HTTP response, CORS or origin restrictions, and script or iframe policy on the deployed origin.
Do not add a management key to a browser or mobile application to work around an access error. Use [Going to production](/guides/going-to-production) to check environment separation and [key rotation](/guides/api-authentication#rotate-or-revoke-a-key) for expired, lost, or revoked server credentials.
## Report an integration problem
[Contact AppGram](https://appgram.dev/contact) with your platform, SDK version, operation path, HTTP status, and a minimal reproduction. Include a request identifier if the response supplies one. Remove API keys, webhook secrets, customer tokens, and personal data before sharing logs.
---
# Going to production
Separate environments, set team access, manage credentials, and verify your deployed integration.
Complete [Getting started](/guides/getting-started) in a development project first. This guide covers the choices that change when real customers, production data, and server credentials are involved.
## Separate development and production
Use separate AppGram projects for development and production where your plan allows. Give each a clear name, and keep its project ID, slugs, content, customer context, and webhook endpoints together. A development project still calls the real service; it does not create an isolated sandbox API or disable delivery, billing rules, or public access.
| Setting | Development | Production |
| --- | --- | --- |
| Project context | Development project ID and matching slugs | Production project ID and matching slugs |
| Feedback | Synthetic requests and test customer identities | Reviewed requests intended for customers |
| Management keys, if needed | Separate key limited to development resources | Separate key limited to production resources |
| Webhooks, if needed | Test receiver and its own secret | Deployed receiver and its own secret |
Keep project context in your application's environment configuration so promoting a build selects the matching values together. Public project IDs can appear in frontend configuration. Management keys and webhook signing secrets must stay in server-side secret storage. A variable prefix such as `NEXT_PUBLIC_` or `VITE_` is not a place for a management key.
If your plan does not allow another project, check the current limits before creating one. Avoid testing notifications, submissions, or destructive actions against a customer project just to reuse its credentials.
## Give teammates the access they need
Dashboard access, API-key permissions, and customer identity serve different purposes:
| Task | Access to check |
| --- | --- |
| Open Projects or create a project | Project-view or project-management permission for the selected organization |
| Read or approve feedback | Feedback-view or feedback-management permission for the selected project |
| Open Developer tools | Developer-area access, such as `dev_logs:view` |
| Create or revoke management keys | API-key administration capability; organization owners and administrators have this by default |
| Use the public feedback interface | Public project context and any customer verification required by that workflow; a dashboard seat is not an API credential |
Invite teammates with the role appropriate to their work. A member who can view feedback may still be unable to approve it or manage keys. Ask the organization owner or administrator to adjust access when a control is hidden or disabled. Do not share a personal dashboard login or grant broad key access to work around a missing permission.
## Confirm plan and feature access
Check your organization's current subscription and usage in the dashboard, and compare the available plans on [Pricing](https://appgram.dev/pricing). Confirm that it supports the project count and features you intend to ship, including any custom-domain or origin-restriction settings you need.
Installing an SDK does not grant every dashboard capability. The public API reference describes supported operations; it does not override your resource access, permissions, or subscription. If an action is unavailable, check the organization, project, team role, and plan before changing code. Contact [AppGram support](https://appgram.dev/contact) when the dashboard does not explain the restriction.
## Protect server credentials
Public feedback setup does not require a management API key. If your backend needs management operations, follow [Create a management key](/guides/api-authentication#create-a-management-key) and grant only the operation scopes it needs. Use a project-limited key when the integration serves one project, give it a recognizable environment-specific name, and choose an appropriate expiration.
Follow [Rotate or revoke a key](/guides/api-authentication#rotate-or-revoke-a-key) before expiry or when ownership changes. Replace a key by creating another, updating your backend, verifying a request, and then revoking the old key. Revoke an exposed key promptly. Removing it from a repository does not invalidate copies already obtained by someone else.
## Review public content and customer identity
Confirm which feedback is approved for public display. Test **Require approval** with a new synthetic submission so your team knows where a hidden-but-saved request will appear. Publishing a help article, release, form, or other surface has its own workflow; a working feedback screen does not validate every module.
Use your application's real sign-in and sign-out lifecycle when testing customer identity. Read [Customer identity and client credentials](/guides/client-identity), decide whether anonymous fingerprinting fits your product, and clear account-specific data when switching accounts. Customer names and emails do not replace ticket credentials or verification. Keep secrets and unnecessary personal information out of feedback and diagnostic logs.
## Verify the deployed application
Run these checks with the production project after deploying your application:
1. Confirm the selected project ID and slugs belong to production. Render one approved request and compare it with the dashboard.
2. Cast a test vote, refresh the dashboard, and reload the application to verify persistence. If you offer submissions, submit a synthetic request and check its moderation behavior too.
3. Exercise loading, empty, and error states. Verify sign-out and account switching do not leave the previous customer's private content on screen.
4. For a website or embed, test from the actual deployed origin. Check script and iframe policy, mixed-content errors, and any configured origin restrictions. A successful cURL request does not verify browser policy. Resolve origin configuration in the dashboard rather than moving a management key into the browser.
5. If your backend uses a management key, make a documented read request against a resource that key can access. Check its HTTP status, scope, and resource identifier. Do not infer success from the public feedback request alone.
6. If you use webhooks, trigger one relevant test event in the intended project and confirm a real, signature-verified delivery reaches your receiver. A sample-payload request does not deliver an event. Inspect **Developer tools → Logs → Webhook deliveries** and your receiver logs. See [Receive webhooks](/guides/webhooks).
Pin and record the SDK versions you tested, and keep your application's dependency lockfile. Test each platform you ship on its supported runtime. Use [Troubleshooting](/guides/troubleshooting) to collect a minimal reproduction, HTTP status, and request identifier for support without sharing credentials or customer data.
---
# Feature requests
Read feature requests, submit ideas, and vote from your portal.
> Source: https://appgram.dev/docs/api/wishes
> Endpoints: 5
> API version: v1.0
See [Authentication](/docs/guides/api-authentication) for the base setup.
### List feature request categories
Get all categories available for wishes in a project
**`GET`** `/portal/categories`
**Authentication:** None
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 500 | Internal Server Error |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/categories?project_id='
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/categories?project_id=", {
method: "GET",
headers: {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/portal/categories?project_id=",
headers={},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/categories?project_id="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/categories?project_id=")!)
request.httpMethod = "GET"
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/categories?project_id=")
.method("GET", null)
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/portal/categories?project_id="));
request.headers.addAll({
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/portal/categories?project_id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": [
{
"color": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"icon": "string",
"id": "string",
"name": "string",
"project_id": "string",
"slug": "string",
"sort_order": 0,
"updated_at": "1970-01-01T00:00:00.000Z",
"wish_count": 0
}
],
"success": true
}
```
---
### Vote on a feature request
Cast a vote on an existing wish/feature request
**`POST`** `/portal/votes`
**Authentication:** None
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organization_id` | `string` | | |
| `organization_slug` | `string` | | |
**Body**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `_hp` | `string` | | |
| `_timestamp` | `integer` | | |
| `_token` | `string` | | |
| `fingerprint` | `string` | | |
| `wish_id` | `string` | ✓ | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
**Request**
**cURL**
```bash
curl --request POST \
--url 'https://api.appgram.dev/portal/votes' \
--header 'Content-Type: application/json' \
--data '{
"_hp": "string",
"_timestamp": 0,
"_token": "string",
"fingerprint": "string",
"wish_id": "string"
}'
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/votes", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: "{\n \"_hp\": \"string\",\n \"_timestamp\": 0,\n \"_token\": \"string\",\n \"fingerprint\": \"string\",\n \"wish_id\": \"string\"\n}",
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"POST",
"https://api.appgram.dev/portal/votes",
headers={"Content-Type": "application/json"},
data="{\n \"_hp\": \"string\",\n \"_timestamp\": 0,\n \"_token\": \"string\",\n \"fingerprint\": \"string\",\n \"wish_id\": \"string\"\n}".encode("utf-8"),
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/votes"
payload := strings.NewReader("{\n \"_hp\": \"string\",\n \"_timestamp\": 0,\n \"_token\": \"string\",\n \"fingerprint\": \"string\",\n \"wish_id\": \"string\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/votes")!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = Data("{\n \"_hp\": \"string\",\n \"_timestamp\": 0,\n \"_token\": \"string\",\n \"fingerprint\": \"string\",\n \"wish_id\": \"string\"\n}".utf8)
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/votes")
.method("POST", "{\n \"_hp\": \"string\",\n \"_timestamp\": 0,\n \"_token\": \"string\",\n \"fingerprint\": \"string\",\n \"wish_id\": \"string\"\n}".toRequestBody("application/json".toMediaType()))
.addHeader("Content-Type", "application/json")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("POST", Uri.parse("https://api.appgram.dev/portal/votes"));
request.headers.addAll({
"Content-Type": "application/json",
});
request.body = "{\n \"_hp\": \"string\",\n \"_timestamp\": 0,\n \"_token\": \"string\",\n \"fingerprint\": \"string\",\n \"wish_id\": \"string\"\n}";
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.appgram.dev/portal/votes"),
Content = new StringContent("{\n \"_hp\": \"string\",\n \"_timestamp\": 0,\n \"_token\": \"string\",\n \"fingerprint\": \"string\",\n \"wish_id\": \"string\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"action": "string",
"message": "string",
"vote": {
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"user": {},
"wish_id": "string"
}
},
"success": true
}
```
---
### List feature requests
Get paginated list of public wishes for a project with optional filtering
**`GET`** `/portal/wishes`
**Authentication:** None
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `category_id` | `string` | | |
| `fingerprint` | `string` | | |
| `page` | `string` | | |
| `per_page` | `string` | | |
| `project_id` | `string` | | |
| `search` | `string` | | |
| `sort_by` | `string` | | |
| `sort_order` | `string` | | |
| `status` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 500 | Internal Server Error |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/wishes?project_id='
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/wishes?project_id=", {
method: "GET",
headers: {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/portal/wishes?project_id=",
headers={},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/wishes?project_id="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/wishes?project_id=")!)
request.httpMethod = "GET"
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/wishes?project_id=")
.method("GET", null)
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/portal/wishes?project_id="));
request.headers.addAll({
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/portal/wishes?project_id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": [
{
"author_type": "anonymous",
"category": {
"color": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"icon": "string",
"id": "string",
"name": "string",
"project_id": "string",
"slug": "string",
"sort_order": 0,
"updated_at": "1970-01-01T00:00:00.000Z",
"wish_count": 0
},
"category_id": "string",
"comment_count": 0,
"completed_at": "1970-01-01T00:00:00.000Z",
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"has_voted": true,
"id": "string",
"is_merged": true,
"is_pinned": true,
"merged_into_id": "string",
"project_id": "string",
"slug": "string",
"source": "api",
"status": "completed",
"title": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"vote_count": 0
}
],
"page": 0,
"per_page": 0,
"success": true,
"total": 0,
"total_pages": 0
}
```
---
### Submit a feature request
Create a new wish/feature request from the public portal
**`POST`** `/portal/wishes`
**Authentication:** None
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organization_id` | `string` | | |
| `organization_slug` | `string` | | |
**Body**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `_hp` | `string` | | |
| `_timestamp` | `integer` | | |
| `_token` | `string` | | |
| `author_email` | `string` | | |
| `author_name` | `string` | | |
| `category_id` | `string` | | |
| `description` | `string` | ✓ | |
| `project_id` | `string` | ✓ | |
| `title` | `string` | ✓ | |
| `user_metadata` | `object` | | |
**Responses**
| Status | Description |
| --- | --- |
| 201 | Created |
| 400 | Bad Request |
**Request**
**cURL**
```bash
curl --request POST \
--url 'https://api.appgram.dev/portal/wishes' \
--header 'Content-Type: application/json' \
--data '{
"_hp": "string",
"_timestamp": 0,
"_token": "string",
"author_email": "string",
"author_name": "string",
"category_id": "string",
"description": "string",
"project_id": "string",
"title": "string",
"user_metadata": {}
}'
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/wishes", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: "{\n \"_hp\": \"string\",\n \"_timestamp\": 0,\n \"_token\": \"string\",\n \"author_email\": \"string\",\n \"author_name\": \"string\",\n \"category_id\": \"string\",\n \"description\": \"string\",\n \"project_id\": \"string\",\n \"title\": \"string\",\n \"user_metadata\": {}\n}",
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"POST",
"https://api.appgram.dev/portal/wishes",
headers={"Content-Type": "application/json"},
data="{\n \"_hp\": \"string\",\n \"_timestamp\": 0,\n \"_token\": \"string\",\n \"author_email\": \"string\",\n \"author_name\": \"string\",\n \"category_id\": \"string\",\n \"description\": \"string\",\n \"project_id\": \"string\",\n \"title\": \"string\",\n \"user_metadata\": {}\n}".encode("utf-8"),
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/wishes"
payload := strings.NewReader("{\n \"_hp\": \"string\",\n \"_timestamp\": 0,\n \"_token\": \"string\",\n \"author_email\": \"string\",\n \"author_name\": \"string\",\n \"category_id\": \"string\",\n \"description\": \"string\",\n \"project_id\": \"string\",\n \"title\": \"string\",\n \"user_metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/wishes")!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = Data("{\n \"_hp\": \"string\",\n \"_timestamp\": 0,\n \"_token\": \"string\",\n \"author_email\": \"string\",\n \"author_name\": \"string\",\n \"category_id\": \"string\",\n \"description\": \"string\",\n \"project_id\": \"string\",\n \"title\": \"string\",\n \"user_metadata\": {}\n}".utf8)
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/wishes")
.method("POST", "{\n \"_hp\": \"string\",\n \"_timestamp\": 0,\n \"_token\": \"string\",\n \"author_email\": \"string\",\n \"author_name\": \"string\",\n \"category_id\": \"string\",\n \"description\": \"string\",\n \"project_id\": \"string\",\n \"title\": \"string\",\n \"user_metadata\": {}\n}".toRequestBody("application/json".toMediaType()))
.addHeader("Content-Type", "application/json")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("POST", Uri.parse("https://api.appgram.dev/portal/wishes"));
request.headers.addAll({
"Content-Type": "application/json",
});
request.body = "{\n \"_hp\": \"string\",\n \"_timestamp\": 0,\n \"_token\": \"string\",\n \"author_email\": \"string\",\n \"author_name\": \"string\",\n \"category_id\": \"string\",\n \"description\": \"string\",\n \"project_id\": \"string\",\n \"title\": \"string\",\n \"user_metadata\": {}\n}";
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.appgram.dev/portal/wishes"),
Content = new StringContent("{\n \"_hp\": \"string\",\n \"_timestamp\": 0,\n \"_token\": \"string\",\n \"author_email\": \"string\",\n \"author_name\": \"string\",\n \"category_id\": \"string\",\n \"description\": \"string\",\n \"project_id\": \"string\",\n \"title\": \"string\",\n \"user_metadata\": {}\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `201`
```json
{
"data": {
"author_type": "anonymous",
"category": {
"color": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"icon": "string",
"id": "string",
"name": "string",
"project_id": "string",
"slug": "string",
"sort_order": 0,
"updated_at": "1970-01-01T00:00:00.000Z",
"wish_count": 0
},
"category_id": "string",
"comment_count": 0,
"completed_at": "1970-01-01T00:00:00.000Z",
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"has_voted": true,
"id": "string",
"is_merged": true,
"is_pinned": true,
"merged_into_id": "string",
"project_id": "string",
"slug": "string",
"source": "api",
"status": "completed",
"title": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"vote_count": 0
},
"success": true
}
```
---
### Get a feature request
Get detailed information about a specific wish
**`GET`** `/portal/wishes/{id}`
**Authentication:** None
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `fingerprint` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/wishes/{id}'
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/wishes/{id}", {
method: "GET",
headers: {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/portal/wishes/{id}",
headers={},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/wishes/%7Bid%7D"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/wishes/{id}")!)
request.httpMethod = "GET"
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/wishes/{id}")
.method("GET", null)
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/portal/wishes/{id}"));
request.headers.addAll({
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/portal/wishes/%7Bid%7D"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"author_type": "anonymous",
"category": {
"color": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"icon": "string",
"id": "string",
"name": "string",
"project_id": "string",
"slug": "string",
"sort_order": 0,
"updated_at": "1970-01-01T00:00:00.000Z",
"wish_count": 0
},
"category_id": "string",
"comment_count": 0,
"completed_at": "1970-01-01T00:00:00.000Z",
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"has_voted": true,
"id": "string",
"is_merged": true,
"is_pinned": true,
"merged_into_id": "string",
"project_id": "string",
"slug": "string",
"source": "api",
"status": "completed",
"title": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"vote_count": 0
},
"success": true
}
```
---
# Support
Create support requests and manage customer conversations.
> Source: https://appgram.dev/docs/api/support
> Endpoints: 7
> API version: v1.0
See [Authentication](/docs/guides/api-authentication) for the base setup.
### Add a message as an end user
Add a message to a support request, verifying the ticket belongs to the external user
**`POST`** `/api/v1/support-requests/{id}/messages/user/{externalUserId}`
**Authentication:** x-api-key (header)
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
| `externalUserId` | `string` | ✓ | |
**Body**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `attachments` | `array` | | |
| `content` | `string` | ✓ | |
| `help_article_ids` | `array` | | |
**Responses**
| Status | Description |
| --- | --- |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 500 | Internal Server Error |
**Request**
**cURL**
```bash
curl --request POST \
--url 'https://api.appgram.dev/api/v1/support-requests/{id}/messages/user/{externalUserId}' \
--header 'x-api-key: ' \
--header 'Content-Type: application/json' \
--data '{
"attachments": [
{
"mime_type": "string",
"name": "string",
"size": 0,
"url": "string"
}
],
"content": "string",
"help_article_ids": [
"string"
]
}'
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/api/v1/support-requests/{id}/messages/user/{externalUserId}", {
method: "POST",
headers: {
"x-api-key": "",
"Content-Type": "application/json"
},
body: "{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}",
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"POST",
"https://api.appgram.dev/api/v1/support-requests/{id}/messages/user/{externalUserId}",
headers={"x-api-key": "", "Content-Type": "application/json"},
data="{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}".encode("utf-8"),
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/api/v1/support-requests/%7Bid%7D/messages/user/%7BexternalUserId%7D"
payload := strings.NewReader("{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/api/v1/support-requests/{id}/messages/user/{externalUserId}")!)
request.httpMethod = "POST"
request.setValue("", forHTTPHeaderField: "x-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = Data("{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}".utf8)
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/api/v1/support-requests/{id}/messages/user/{externalUserId}")
.method("POST", "{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}".toRequestBody("application/json".toMediaType()))
.addHeader("x-api-key", "")
.addHeader("Content-Type", "application/json")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("POST", Uri.parse("https://api.appgram.dev/api/v1/support-requests/{id}/messages/user/{externalUserId}"));
request.headers.addAll({
"x-api-key": "",
"Content-Type": "application/json",
});
request.body = "{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}";
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.appgram.dev/api/v1/support-requests/%7Bid%7D/messages/user/%7BexternalUserId%7D"),
Headers =
{
{ "x-api-key", "" },
},
Content = new StringContent("{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `201`
```json
{
"data": {
"attachments": [
{
"mime_type": "string",
"name": "string",
"size": 0,
"url": "string"
}
],
"author": {
"avatar_url": "string",
"id": "string"
},
"author_name": "string",
"content": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"help_articles": [
{
"article_type": "faq",
"author": {},
"author_user_id": "string",
"content": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"excerpt": "string",
"flow": {},
"flow_id": "string",
"id": "string",
"is_published": true,
"locale": "string",
"published_at": "1970-01-01T00:00:00.000Z",
"seo_description": "string",
"seo_noindex": true,
"seo_og_image_url": "string",
"seo_title": "string",
"slug": "string",
"sort_order": 0,
"tags": [],
"title": "string",
"translation_group_id": "string",
"translations": [],
"updated_at": "1970-01-01T00:00:00.000Z",
"url": "string"
}
],
"id": "string",
"is_from_user": true,
"support_request_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"success": true
}
```
---
### Create support request
Create a new customer support request from the public portal
**`POST`** `/portal/support-requests`
**Authentication:** None
**Body**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `anon_id` | `string` | | |
| `attachments` | `array` | | |
| `description` | `string` | ✓ | |
| `external_user_id` | `string` | | |
| `form_data` | `object` | | |
| `form_id` | `string` | | |
| `project_id` | `string` | ✓ | |
| `subject` | `string` | | |
| `user_email` | `string` | | |
| `user_metadata` | `object` | | |
| `user_name` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 201 | Created |
| 400 | Bad Request |
**Request**
**cURL**
```bash
curl --request POST \
--url 'https://api.appgram.dev/portal/support-requests' \
--header 'Content-Type: application/json' \
--data '{
"anon_id": "string",
"attachments": [
{
"mime_type": "string",
"name": "string",
"size": 0,
"url": "string"
}
],
"description": "string",
"external_user_id": "string",
"form_data": {},
"form_id": "string",
"project_id": "string",
"subject": "string",
"user_email": "string",
"user_metadata": {},
"user_name": "string"
}'
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/support-requests", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: "{\n \"anon_id\": \"string\",\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"description\": \"string\",\n \"external_user_id\": \"string\",\n \"form_data\": {},\n \"form_id\": \"string\",\n \"project_id\": \"string\",\n \"subject\": \"string\",\n \"user_email\": \"string\",\n \"user_metadata\": {},\n \"user_name\": \"string\"\n}",
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"POST",
"https://api.appgram.dev/portal/support-requests",
headers={"Content-Type": "application/json"},
data="{\n \"anon_id\": \"string\",\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"description\": \"string\",\n \"external_user_id\": \"string\",\n \"form_data\": {},\n \"form_id\": \"string\",\n \"project_id\": \"string\",\n \"subject\": \"string\",\n \"user_email\": \"string\",\n \"user_metadata\": {},\n \"user_name\": \"string\"\n}".encode("utf-8"),
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/support-requests"
payload := strings.NewReader("{\n \"anon_id\": \"string\",\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"description\": \"string\",\n \"external_user_id\": \"string\",\n \"form_data\": {},\n \"form_id\": \"string\",\n \"project_id\": \"string\",\n \"subject\": \"string\",\n \"user_email\": \"string\",\n \"user_metadata\": {},\n \"user_name\": \"string\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/support-requests")!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = Data("{\n \"anon_id\": \"string\",\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"description\": \"string\",\n \"external_user_id\": \"string\",\n \"form_data\": {},\n \"form_id\": \"string\",\n \"project_id\": \"string\",\n \"subject\": \"string\",\n \"user_email\": \"string\",\n \"user_metadata\": {},\n \"user_name\": \"string\"\n}".utf8)
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/support-requests")
.method("POST", "{\n \"anon_id\": \"string\",\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"description\": \"string\",\n \"external_user_id\": \"string\",\n \"form_data\": {},\n \"form_id\": \"string\",\n \"project_id\": \"string\",\n \"subject\": \"string\",\n \"user_email\": \"string\",\n \"user_metadata\": {},\n \"user_name\": \"string\"\n}".toRequestBody("application/json".toMediaType()))
.addHeader("Content-Type", "application/json")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("POST", Uri.parse("https://api.appgram.dev/portal/support-requests"));
request.headers.addAll({
"Content-Type": "application/json",
});
request.body = "{\n \"anon_id\": \"string\",\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"description\": \"string\",\n \"external_user_id\": \"string\",\n \"form_data\": {},\n \"form_id\": \"string\",\n \"project_id\": \"string\",\n \"subject\": \"string\",\n \"user_email\": \"string\",\n \"user_metadata\": {},\n \"user_name\": \"string\"\n}";
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.appgram.dev/portal/support-requests"),
Content = new StringContent("{\n \"anon_id\": \"string\",\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"description\": \"string\",\n \"external_user_id\": \"string\",\n \"form_data\": {},\n \"form_id\": \"string\",\n \"project_id\": \"string\",\n \"subject\": \"string\",\n \"user_email\": \"string\",\n \"user_metadata\": {},\n \"user_name\": \"string\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `201`
```json
{
"data": {
"access_token": "string",
"attachments": [
{
"mime_type": "string",
"name": "string",
"size": 0,
"url": "string"
}
],
"category": "account_issue",
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"magic_link": "string",
"message_count": 0,
"messages": [
{
"attachments": [],
"author": {},
"author_name": "string",
"content": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"help_articles": [],
"id": "string",
"is_from_user": true,
"support_request_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
}
],
"project_id": "string",
"resolved_at": "1970-01-01T00:00:00.000Z",
"source": "string",
"status": "closed",
"subject": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"user_email": "string",
"user_name": "string"
},
"success": true
}
```
---
### List the requester's support requests
Get all support requests for the authenticated user (requires session token)
**`GET`** `/portal/support-requests/my-requests`
**Authentication:** None
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 401 | Unauthorized |
| 500 | Internal Server Error |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/support-requests/my-requests'
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/support-requests/my-requests", {
method: "GET",
headers: {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/portal/support-requests/my-requests",
headers={},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/support-requests/my-requests"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/support-requests/my-requests")!)
request.httpMethod = "GET"
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/support-requests/my-requests")
.method("GET", null)
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/portal/support-requests/my-requests"));
request.headers.addAll({
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/portal/support-requests/my-requests"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": [
{
"attachments": [
{}
],
"category": "account_issue",
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"message_count": 0,
"messages": [
{}
],
"project_id": "string",
"resolved_at": "1970-01-01T00:00:00.000Z",
"source": "string",
"status": "closed",
"subject": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"user_email": "string",
"user_name": "string"
}
],
"success": true
}
```
---
### Send a support sign-in link
Send an email with a magic link to access a support request
**`POST`** `/portal/support-requests/send-magic-link`
**Authentication:** None
**Body**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | `string` | ✓ | |
| `user_email` | `string` | ✓ | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
**Request**
**cURL**
```bash
curl --request POST \
--url 'https://api.appgram.dev/portal/support-requests/send-magic-link' \
--header 'Content-Type: application/json' \
--data '{
"project_id": "string",
"user_email": "string"
}'
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/support-requests/send-magic-link", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: "{\n \"project_id\": \"string\",\n \"user_email\": \"string\"\n}",
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"POST",
"https://api.appgram.dev/portal/support-requests/send-magic-link",
headers={"Content-Type": "application/json"},
data="{\n \"project_id\": \"string\",\n \"user_email\": \"string\"\n}".encode("utf-8"),
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/support-requests/send-magic-link"
payload := strings.NewReader("{\n \"project_id\": \"string\",\n \"user_email\": \"string\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/support-requests/send-magic-link")!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = Data("{\n \"project_id\": \"string\",\n \"user_email\": \"string\"\n}".utf8)
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/support-requests/send-magic-link")
.method("POST", "{\n \"project_id\": \"string\",\n \"user_email\": \"string\"\n}".toRequestBody("application/json".toMediaType()))
.addHeader("Content-Type", "application/json")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("POST", Uri.parse("https://api.appgram.dev/portal/support-requests/send-magic-link"));
request.headers.addAll({
"Content-Type": "application/json",
});
request.body = "{\n \"project_id\": \"string\",\n \"user_email\": \"string\"\n}";
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.appgram.dev/portal/support-requests/send-magic-link"),
Content = new StringContent("{\n \"project_id\": \"string\",\n \"user_email\": \"string\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"message": "string"
},
"success": true
}
```
---
### Get support request
Get a specific support request by ID using access token
**`GET`** `/portal/support-requests/{id}`
**Authentication:** None
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `token` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 401 | Unauthorized |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/support-requests/{id}'
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/support-requests/{id}", {
method: "GET",
headers: {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/portal/support-requests/{id}",
headers={},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/support-requests/%7Bid%7D"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/support-requests/{id}")!)
request.httpMethod = "GET"
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/support-requests/{id}")
.method("GET", null)
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/portal/support-requests/{id}"));
request.headers.addAll({
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/portal/support-requests/%7Bid%7D"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"attachments": [
{
"mime_type": "string",
"name": "string",
"size": 0,
"url": "string"
}
],
"category": "account_issue",
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"message_count": 0,
"messages": [
{
"attachments": [],
"author": {},
"author_name": "string",
"content": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"help_articles": [],
"id": "string",
"is_from_user": true,
"support_request_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
}
],
"project_id": "string",
"resolved_at": "1970-01-01T00:00:00.000Z",
"source": "string",
"status": "closed",
"subject": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"user_email": "string",
"user_name": "string"
},
"success": true
}
```
---
### Get support request messages
Get all messages for a specific support request
**`GET`** `/portal/support-requests/{id}/messages`
**Authentication:** None
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `token` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 401 | Unauthorized |
| 500 | Internal Server Error |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/support-requests/{id}/messages'
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/support-requests/{id}/messages", {
method: "GET",
headers: {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/portal/support-requests/{id}/messages",
headers={},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/support-requests/%7Bid%7D/messages"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/support-requests/{id}/messages")!)
request.httpMethod = "GET"
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/support-requests/{id}/messages")
.method("GET", null)
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/portal/support-requests/{id}/messages"));
request.headers.addAll({
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/portal/support-requests/%7Bid%7D/messages"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": [
{
"attachments": [
{}
],
"author": {
"avatar_url": "string",
"id": "string"
},
"author_name": "string",
"content": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"help_articles": [
{}
],
"id": "string",
"is_from_user": true,
"support_request_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
}
],
"success": true
}
```
---
### Add message to support request
Add a new message to an existing support request
**`POST`** `/portal/support-requests/{id}/messages`
**Authentication:** None
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `token` | `string` | | |
**Body**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `attachments` | `array` | | |
| `content` | `string` | ✓ | |
| `help_article_ids` | `array` | | |
**Responses**
| Status | Description |
| --- | --- |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 500 | Internal Server Error |
**Request**
**cURL**
```bash
curl --request POST \
--url 'https://api.appgram.dev/portal/support-requests/{id}/messages' \
--header 'Content-Type: application/json' \
--data '{
"attachments": [
{
"mime_type": "string",
"name": "string",
"size": 0,
"url": "string"
}
],
"content": "string",
"help_article_ids": [
"string"
]
}'
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/support-requests/{id}/messages", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: "{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}",
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"POST",
"https://api.appgram.dev/portal/support-requests/{id}/messages",
headers={"Content-Type": "application/json"},
data="{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}".encode("utf-8"),
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/support-requests/%7Bid%7D/messages"
payload := strings.NewReader("{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/support-requests/{id}/messages")!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = Data("{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}".utf8)
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/support-requests/{id}/messages")
.method("POST", "{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}".toRequestBody("application/json".toMediaType()))
.addHeader("Content-Type", "application/json")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("POST", Uri.parse("https://api.appgram.dev/portal/support-requests/{id}/messages"));
request.headers.addAll({
"Content-Type": "application/json",
});
request.body = "{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}";
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.appgram.dev/portal/support-requests/%7Bid%7D/messages"),
Content = new StringContent("{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `201`
```json
{
"data": {
"attachments": [
{
"mime_type": "string",
"name": "string",
"size": 0,
"url": "string"
}
],
"author": {
"avatar_url": "string",
"id": "string"
},
"author_name": "string",
"content": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"help_articles": [
{
"article_type": "faq",
"author": {},
"author_user_id": "string",
"content": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"excerpt": "string",
"flow": {},
"flow_id": "string",
"id": "string",
"is_published": true,
"locale": "string",
"published_at": "1970-01-01T00:00:00.000Z",
"seo_description": "string",
"seo_noindex": true,
"seo_og_image_url": "string",
"seo_title": "string",
"slug": "string",
"sort_order": 0,
"tags": [],
"title": "string",
"translation_group_id": "string",
"translations": [],
"updated_at": "1970-01-01T00:00:00.000Z",
"url": "string"
}
],
"id": "string",
"is_from_user": true,
"support_request_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"success": true
}
```
---
# Help Center
Read published help articles, flows, and collections.
> Source: https://appgram.dev/docs/api/help
> Endpoints: 5
> API version: v1.0
See [Authentication](/docs/guides/api-authentication) for the base setup.
### Get help center
Get the live help collection and flows for a project (public endpoint)
**`GET`** `/portal/help`
**Authentication:** None
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/help?project_id='
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/help?project_id=", {
method: "GET",
headers: {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/portal/help?project_id=",
headers={},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/help?project_id="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/help?project_id=")!)
request.httpMethod = "GET"
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/help?project_id=")
.method("GET", null)
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/portal/help?project_id="));
request.headers.addAll({
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/portal/help?project_id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"flows": [
{
"articles": [],
"collection": {},
"collection_id": "string",
"color": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"decision_nodes": [],
"description": "string",
"display_type": "accordion",
"icon": "string",
"id": "string",
"name": "string",
"slug": "string",
"sort_order": 0,
"updated_at": "1970-01-01T00:00:00.000Z",
"wizard_steps": []
}
],
"id": "string",
"is_live": true,
"name": "string",
"project_id": "string",
"rag_enabled": true,
"updated_at": "1970-01-01T00:00:00.000Z",
"version": "string"
},
"success": true
}
```
---
### Get help article
Get a specific help article by slug (public endpoint)
**`GET`** `/portal/help/articles/{slug}`
**Authentication:** None
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `slug` | `string` | ✓ | |
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `flow_id` | `string` | | |
| `project_id` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/help/articles/{slug}?project_id='
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/help/articles/{slug}?project_id=", {
method: "GET",
headers: {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/portal/help/articles/{slug}?project_id=",
headers={},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/help/articles/%7Bslug%7D?project_id="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/help/articles/{slug}?project_id=")!)
request.httpMethod = "GET"
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/help/articles/{slug}?project_id=")
.method("GET", null)
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/portal/help/articles/{slug}?project_id="));
request.headers.addAll({
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/portal/help/articles/%7Bslug%7D?project_id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"article_type": "faq",
"content": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"excerpt": "string",
"flow": {
"articles": [],
"collection": {},
"collection_id": "string",
"color": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"decision_nodes": [],
"description": "string",
"display_type": "accordion",
"icon": "string",
"id": "string",
"name": "string",
"slug": "string",
"sort_order": 0,
"updated_at": "1970-01-01T00:00:00.000Z",
"wizard_steps": []
},
"flow_id": "string",
"id": "string",
"is_published": true,
"published_at": "1970-01-01T00:00:00.000Z",
"seo": {
"description": "string",
"noindex": true,
"ogImageUrl": "string",
"resolved": {},
"title": "string"
},
"slug": "string",
"sort_order": 0,
"tags": [
"string"
],
"title": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"success": true
}
```
---
### Get decision node
Get a specific decision node by ID for navigation in decision tree flows (public endpoint)
**`GET`** `/portal/help/decision-nodes/{id}`
**Authentication:** None
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/help/decision-nodes/{id}?project_id='
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/help/decision-nodes/{id}?project_id=", {
method: "GET",
headers: {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/portal/help/decision-nodes/{id}?project_id=",
headers={},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/help/decision-nodes/%7Bid%7D?project_id="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/help/decision-nodes/{id}?project_id=")!)
request.httpMethod = "GET"
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/help/decision-nodes/{id}?project_id=")
.method("GET", null)
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/portal/help/decision-nodes/{id}?project_id="));
request.headers.addAll({
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/portal/help/decision-nodes/%7Bid%7D?project_id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"article": {
"article_type": "faq",
"author": {},
"author_user_id": "string",
"content": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"excerpt": "string",
"flow": {},
"flow_id": "string",
"id": "string",
"is_published": true,
"locale": "string",
"published_at": "1970-01-01T00:00:00.000Z",
"seo_description": "string",
"seo_noindex": true,
"seo_og_image_url": "string",
"seo_title": "string",
"slug": "string",
"sort_order": 0,
"tags": [],
"title": "string",
"translation_group_id": "string",
"translations": [],
"updated_at": "1970-01-01T00:00:00.000Z",
"url": "string"
},
"node": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"article": {},
"article_id": "string",
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"flow": {},
"flow_id": "string",
"id": "string",
"no_node": {},
"parent_id": "string",
"question": "string",
"sort_order": 0,
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
}
},
"success": true
}
```
---
### Get help flow
Get a specific help flow by slug (public endpoint)
**`GET`** `/portal/help/flows/{slug}`
**Authentication:** None
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `slug` | `string` | ✓ | |
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/help/flows/{slug}?project_id='
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/help/flows/{slug}?project_id=", {
method: "GET",
headers: {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/portal/help/flows/{slug}?project_id=",
headers={},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/help/flows/%7Bslug%7D?project_id="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/help/flows/{slug}?project_id=")!)
request.httpMethod = "GET"
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/help/flows/{slug}?project_id=")
.method("GET", null)
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/portal/help/flows/{slug}?project_id="));
request.headers.addAll({
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/portal/help/flows/%7Bslug%7D?project_id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"articles": [
{
"article_type": "faq",
"author": {},
"author_user_id": "string",
"content": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"excerpt": "string",
"flow": {},
"flow_id": "string",
"id": "string",
"is_published": true,
"locale": "string",
"published_at": "1970-01-01T00:00:00.000Z",
"seo_description": "string",
"seo_noindex": true,
"seo_og_image_url": "string",
"seo_title": "string",
"slug": "string",
"sort_order": 0,
"tags": [],
"title": "string",
"translation_group_id": "string",
"translations": [],
"updated_at": "1970-01-01T00:00:00.000Z",
"url": "string"
}
],
"collection": {
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"flows": [
{}
],
"id": "string",
"is_live": true,
"name": "string",
"project": {
"captcha_enabled": true,
"color": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"custom_domain": "string",
"description": "string",
"icon_url": "string",
"id": "string",
"is_launched": true,
"name": "string",
"organization_id": "string",
"slug": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"project_id": "string",
"rag_enabled": true,
"updated_at": "1970-01-01T00:00:00.000Z",
"version": "string"
},
"collection_id": "string",
"color": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"decision_nodes": [
{
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"article": {},
"article_id": "string",
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"flow": {},
"flow_id": "string",
"id": "string",
"no_node": {},
"parent_id": "string",
"question": "string",
"sort_order": 0,
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
}
],
"description": "string",
"display_type": "accordion",
"icon": "string",
"id": "string",
"name": "string",
"slug": "string",
"sort_order": 0,
"updated_at": "1970-01-01T00:00:00.000Z",
"wizard_steps": [
{
"article": {},
"article_id": "string",
"content": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"flow": {},
"flow_id": "string",
"id": "string",
"step_number": 0,
"title": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
}
]
},
"success": true
}
```
---
### Search help center
Search articles in the help center (public endpoint)
**`GET`** `/portal/help/search`
**Authentication:** None
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | `string` | | |
| `q` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/help/search?project_id='
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/help/search?project_id=", {
method: "GET",
headers: {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/portal/help/search?project_id=",
headers={},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/help/search?project_id="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/help/search?project_id=")!)
request.httpMethod = "GET"
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/help/search?project_id=")
.method("GET", null)
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/portal/help/search?project_id="));
request.headers.addAll({
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/portal/help/search?project_id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"query": "string",
"results": []
},
"success": true
}
```
---
# Roadmaps
Display the public roadmap for your project.
> Source: https://appgram.dev/docs/api/roadmaps
> Endpoints: 1
> API version: v1.0
See [Authentication](/docs/guides/api-authentication) for the base setup.
### Get project roadmap
Get the public roadmap for a project
**`GET`** `/portal/roadmap`
**Authentication:** None
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
| 500 | Internal Server Error |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/roadmap?project_id='
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/roadmap?project_id=", {
method: "GET",
headers: {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/portal/roadmap?project_id=",
headers={},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/roadmap?project_id="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/roadmap?project_id=")!)
request.httpMethod = "GET"
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/roadmap?project_id=")
.method("GET", null)
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/portal/roadmap?project_id="));
request.headers.addAll({
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/portal/roadmap?project_id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"columns": [
{
"color": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"items": [],
"name": "string",
"roadmap_id": "string",
"sort_order": 0,
"updated_at": "1970-01-01T00:00:00.000Z",
"wip_limit": 0
}
],
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"is_default": true,
"name": "string",
"project_id": "string",
"show_comments": true,
"show_vote_counts": true,
"updated_at": "1970-01-01T00:00:00.000Z",
"visibility": "private"
},
"success": true
}
```
---
# Surveys
Manage surveys and collect responses.
> Source: https://appgram.dev/docs/api/surveys
> Endpoints: 16
> API version: v1.0
See [Authentication](/docs/guides/api-authentication) for the base setup.
### Get available surveys for user
Get active surveys that the user hasn't responded to yet
Required API key scope: `surveys:view`.
**`GET`** `/api/v1/projects/{id}/surveys/available/{externalUserId}`
**Authentication:** x-api-key (header)
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
| `externalUserId` | `string` | ✓ | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 500 | Internal Server Error |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/api/v1/projects/{id}/surveys/available/{externalUserId}' \
--header 'x-api-key: '
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/api/v1/projects/{id}/surveys/available/{externalUserId}", {
method: "GET",
headers: {
"x-api-key": ""
},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/api/v1/projects/{id}/surveys/available/{externalUserId}",
headers={"x-api-key": ""},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/api/v1/projects/%7Bid%7D/surveys/available/%7BexternalUserId%7D"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/api/v1/projects/{id}/surveys/available/{externalUserId}")!)
request.httpMethod = "GET"
request.setValue("", forHTTPHeaderField: "x-api-key")
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/api/v1/projects/{id}/surveys/available/{externalUserId}")
.method("GET", null)
.addHeader("x-api-key", "")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/api/v1/projects/{id}/surveys/available/{externalUserId}"));
request.headers.addAll({
"x-api-key": "",
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/api/v1/projects/%7Bid%7D/surveys/available/%7BexternalUserId%7D"),
Headers =
{
{ "x-api-key", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": [
{
"description": "string",
"id": "string",
"name": "string",
"number_of_questions": 0,
"slug": "string"
}
],
"success": true
}
```
---
### List surveys
Get list of surveys for a project with optional filtering by active status
Required API key scope: `surveys:view`.
**`GET`** `/api/v1/surveys`
**Authentication:** x-api-key (header)
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `is_active` | `string` | | |
| `project_id` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/api/v1/surveys' \
--header 'x-api-key: '
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/api/v1/surveys", {
method: "GET",
headers: {
"x-api-key": ""
},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/api/v1/surveys",
headers={"x-api-key": ""},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/api/v1/surveys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/api/v1/surveys")!)
request.httpMethod = "GET"
request.setValue("", forHTTPHeaderField: "x-api-key")
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/api/v1/surveys")
.method("GET", null)
.addHeader("x-api-key", "")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/api/v1/surveys"));
request.headers.addAll({
"x-api-key": "",
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/api/v1/surveys"),
Headers =
{
{ "x-api-key", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": [
{
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"is_active": true,
"name": "string",
"nodes": [
{}
],
"number_of_questions": 0,
"number_of_responses": 0,
"project_id": "string",
"slug": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
}
],
"success": true
}
```
---
### Create survey
Create a new survey for a project
Required API key scope: `surveys:manage`.
**`POST`** `/api/v1/surveys`
**Authentication:** x-api-key (header)
**Body**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | `string` | | |
| `name` | `string` | ✓ | |
| `project_id` | `string` | ✓ | |
| `slug` | `string` | ✓ | |
**Responses**
| Status | Description |
| --- | --- |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
**Request**
**cURL**
```bash
curl --request POST \
--url 'https://api.appgram.dev/api/v1/surveys' \
--header 'x-api-key: ' \
--header 'Content-Type: application/json' \
--data '{
"description": "string",
"name": "string",
"project_id": "string",
"slug": "string"
}'
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/api/v1/surveys", {
method: "POST",
headers: {
"x-api-key": "",
"Content-Type": "application/json"
},
body: "{\n \"description\": \"string\",\n \"name\": \"string\",\n \"project_id\": \"string\",\n \"slug\": \"string\"\n}",
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"POST",
"https://api.appgram.dev/api/v1/surveys",
headers={"x-api-key": "", "Content-Type": "application/json"},
data="{\n \"description\": \"string\",\n \"name\": \"string\",\n \"project_id\": \"string\",\n \"slug\": \"string\"\n}".encode("utf-8"),
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/api/v1/surveys"
payload := strings.NewReader("{\n \"description\": \"string\",\n \"name\": \"string\",\n \"project_id\": \"string\",\n \"slug\": \"string\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/api/v1/surveys")!)
request.httpMethod = "POST"
request.setValue("", forHTTPHeaderField: "x-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = Data("{\n \"description\": \"string\",\n \"name\": \"string\",\n \"project_id\": \"string\",\n \"slug\": \"string\"\n}".utf8)
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/api/v1/surveys")
.method("POST", "{\n \"description\": \"string\",\n \"name\": \"string\",\n \"project_id\": \"string\",\n \"slug\": \"string\"\n}".toRequestBody("application/json".toMediaType()))
.addHeader("x-api-key", "")
.addHeader("Content-Type", "application/json")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("POST", Uri.parse("https://api.appgram.dev/api/v1/surveys"));
request.headers.addAll({
"x-api-key": "",
"Content-Type": "application/json",
});
request.body = "{\n \"description\": \"string\",\n \"name\": \"string\",\n \"project_id\": \"string\",\n \"slug\": \"string\"\n}";
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.appgram.dev/api/v1/surveys"),
Headers =
{
{ "x-api-key", "" },
},
Content = new StringContent("{\n \"description\": \"string\",\n \"name\": \"string\",\n \"project_id\": \"string\",\n \"slug\": \"string\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `201`
```json
{
"data": {
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"is_active": true,
"name": "string",
"nodes": [
{
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [],
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {},
"options": [],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
}
],
"number_of_questions": 0,
"project_id": "string",
"slug": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"success": true
}
```
---
### Delete survey node
Delete a survey node/question
Required API key scope: `surveys:manage`.
**`DELETE`** `/api/v1/surveys/nodes/{nodeId}`
**Authentication:** x-api-key (header)
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `nodeId` | `string` | ✓ | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request DELETE \
--url 'https://api.appgram.dev/api/v1/surveys/nodes/{nodeId}' \
--header 'x-api-key: '
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/api/v1/surveys/nodes/{nodeId}", {
method: "DELETE",
headers: {
"x-api-key": ""
},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"DELETE",
"https://api.appgram.dev/api/v1/surveys/nodes/{nodeId}",
headers={"x-api-key": ""},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/api/v1/surveys/nodes/%7BnodeId%7D"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/api/v1/surveys/nodes/{nodeId}")!)
request.httpMethod = "DELETE"
request.setValue("", forHTTPHeaderField: "x-api-key")
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/api/v1/surveys/nodes/{nodeId}")
.method("DELETE", null)
.addHeader("x-api-key", "")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("DELETE", Uri.parse("https://api.appgram.dev/api/v1/surveys/nodes/{nodeId}"));
request.headers.addAll({
"x-api-key": "",
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("https://api.appgram.dev/api/v1/surveys/nodes/%7BnodeId%7D"),
Headers =
{
{ "x-api-key", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"success": true
},
"success": true
}
```
---
### Update survey node
Update an existing survey node/question
Required API key scope: `surveys:manage`.
**`PATCH`** `/api/v1/surveys/nodes/{nodeId}`
**Authentication:** x-api-key (header)
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `nodeId` | `string` | ✓ | |
**Body**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `answer_no_node_id` | `string` | | |
| `answer_yes_node_id` | `string` | | |
| `branches` | `array` | | Conditional branches evaluated in order; each next_node_id must belong to the same survey. |
| `is_required` | `boolean` | | |
| `max_rating` | `integer` | | |
| `min_rating` | `integer` | | |
| `next_node_id` | `string` | | |
| `options` | `array` | | Choices for multiple_choice and checkboxes questions (validate_survey_node_options requires value and label); null for other types. |
| `parent_id` | `string` | | |
| `question` | `string` | | |
| `question_type` | `string` | | |
| `result_message` | `string` | | |
| `sort_order` | `integer` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request PATCH \
--url 'https://api.appgram.dev/api/v1/surveys/nodes/{nodeId}' \
--header 'x-api-key: ' \
--header 'Content-Type: application/json' \
--data '{
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [
{
"condition": {
"type": "equals"
},
"next_node_id": "string"
}
],
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"options": [
{
"label": "string",
"value": "string"
}
],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0
}'
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/api/v1/surveys/nodes/{nodeId}", {
method: "PATCH",
headers: {
"x-api-key": "",
"Content-Type": "application/json"
},
body: "{\n \"answer_no_node_id\": \"string\",\n \"answer_yes_node_id\": \"string\",\n \"branches\": [\n {\n \"condition\": {\n \"type\": \"equals\"\n },\n \"next_node_id\": \"string\"\n }\n ],\n \"is_required\": true,\n \"max_rating\": 0,\n \"min_rating\": 0,\n \"next_node_id\": \"string\",\n \"options\": [\n {\n \"label\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"parent_id\": \"string\",\n \"question\": \"string\",\n \"question_type\": \"checkboxes\",\n \"result_message\": \"string\",\n \"sort_order\": 0\n}",
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"PATCH",
"https://api.appgram.dev/api/v1/surveys/nodes/{nodeId}",
headers={"x-api-key": "", "Content-Type": "application/json"},
data="{\n \"answer_no_node_id\": \"string\",\n \"answer_yes_node_id\": \"string\",\n \"branches\": [\n {\n \"condition\": {\n \"type\": \"equals\"\n },\n \"next_node_id\": \"string\"\n }\n ],\n \"is_required\": true,\n \"max_rating\": 0,\n \"min_rating\": 0,\n \"next_node_id\": \"string\",\n \"options\": [\n {\n \"label\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"parent_id\": \"string\",\n \"question\": \"string\",\n \"question_type\": \"checkboxes\",\n \"result_message\": \"string\",\n \"sort_order\": 0\n}".encode("utf-8"),
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/api/v1/surveys/nodes/%7BnodeId%7D"
payload := strings.NewReader("{\n \"answer_no_node_id\": \"string\",\n \"answer_yes_node_id\": \"string\",\n \"branches\": [\n {\n \"condition\": {\n \"type\": \"equals\"\n },\n \"next_node_id\": \"string\"\n }\n ],\n \"is_required\": true,\n \"max_rating\": 0,\n \"min_rating\": 0,\n \"next_node_id\": \"string\",\n \"options\": [\n {\n \"label\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"parent_id\": \"string\",\n \"question\": \"string\",\n \"question_type\": \"checkboxes\",\n \"result_message\": \"string\",\n \"sort_order\": 0\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/api/v1/surveys/nodes/{nodeId}")!)
request.httpMethod = "PATCH"
request.setValue("", forHTTPHeaderField: "x-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = Data("{\n \"answer_no_node_id\": \"string\",\n \"answer_yes_node_id\": \"string\",\n \"branches\": [\n {\n \"condition\": {\n \"type\": \"equals\"\n },\n \"next_node_id\": \"string\"\n }\n ],\n \"is_required\": true,\n \"max_rating\": 0,\n \"min_rating\": 0,\n \"next_node_id\": \"string\",\n \"options\": [\n {\n \"label\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"parent_id\": \"string\",\n \"question\": \"string\",\n \"question_type\": \"checkboxes\",\n \"result_message\": \"string\",\n \"sort_order\": 0\n}".utf8)
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/api/v1/surveys/nodes/{nodeId}")
.method("PATCH", "{\n \"answer_no_node_id\": \"string\",\n \"answer_yes_node_id\": \"string\",\n \"branches\": [\n {\n \"condition\": {\n \"type\": \"equals\"\n },\n \"next_node_id\": \"string\"\n }\n ],\n \"is_required\": true,\n \"max_rating\": 0,\n \"min_rating\": 0,\n \"next_node_id\": \"string\",\n \"options\": [\n {\n \"label\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"parent_id\": \"string\",\n \"question\": \"string\",\n \"question_type\": \"checkboxes\",\n \"result_message\": \"string\",\n \"sort_order\": 0\n}".toRequestBody("application/json".toMediaType()))
.addHeader("x-api-key", "")
.addHeader("Content-Type", "application/json")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("PATCH", Uri.parse("https://api.appgram.dev/api/v1/surveys/nodes/{nodeId}"));
request.headers.addAll({
"x-api-key": "",
"Content-Type": "application/json",
});
request.body = "{\n \"answer_no_node_id\": \"string\",\n \"answer_yes_node_id\": \"string\",\n \"branches\": [\n {\n \"condition\": {\n \"type\": \"equals\"\n },\n \"next_node_id\": \"string\"\n }\n ],\n \"is_required\": true,\n \"max_rating\": 0,\n \"min_rating\": 0,\n \"next_node_id\": \"string\",\n \"options\": [\n {\n \"label\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"parent_id\": \"string\",\n \"question\": \"string\",\n \"question_type\": \"checkboxes\",\n \"result_message\": \"string\",\n \"sort_order\": 0\n}";
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("https://api.appgram.dev/api/v1/surveys/nodes/%7BnodeId%7D"),
Headers =
{
{ "x-api-key", "" },
},
Content = new StringContent("{\n \"answer_no_node_id\": \"string\",\n \"answer_yes_node_id\": \"string\",\n \"branches\": [\n {\n \"condition\": {\n \"type\": \"equals\"\n },\n \"next_node_id\": \"string\"\n }\n ],\n \"is_required\": true,\n \"max_rating\": 0,\n \"min_rating\": 0,\n \"next_node_id\": \"string\",\n \"options\": [\n {\n \"label\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"parent_id\": \"string\",\n \"question\": \"string\",\n \"question_type\": \"checkboxes\",\n \"result_message\": \"string\",\n \"sort_order\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [
{
"condition": {},
"next_node_id": "string"
}
],
"children": [
{
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [],
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {},
"options": [],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
}
],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [
{}
],
"children": [
{}
],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [],
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {},
"options": [],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
},
"options": [
{}
],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"is_active": true,
"name": "string",
"nodes": [],
"number_of_questions": 0,
"number_of_responses": 0,
"project": {},
"project_id": "string",
"slug": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [],
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {},
"options": [],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
}
},
"options": [
{
"label": "string",
"value": "string"
}
],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"is_active": true,
"name": "string",
"nodes": [
{}
],
"number_of_questions": 0,
"number_of_responses": 0,
"project": {
"captcha_enabled": true,
"color": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"custom_domain": "string",
"description": "string",
"icon_url": "string",
"id": "string",
"is_launched": true,
"name": "string",
"organization_id": "string",
"slug": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"project_id": "string",
"slug": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [
{}
],
"children": [
{}
],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [],
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {},
"options": [],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
},
"options": [
{}
],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"is_active": true,
"name": "string",
"nodes": [],
"number_of_questions": 0,
"number_of_responses": 0,
"project": {},
"project_id": "string",
"slug": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [],
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {},
"options": [],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
}
}
},
"success": true
}
```
---
### Get survey response
Get a specific survey response with all its answers (admin only)
Required API key scope: `surveys:view`.
**`GET`** `/api/v1/surveys/responses/{id}`
**Authentication:** x-api-key (header)
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/api/v1/surveys/responses/{id}' \
--header 'x-api-key: '
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/api/v1/surveys/responses/{id}", {
method: "GET",
headers: {
"x-api-key": ""
},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/api/v1/surveys/responses/{id}",
headers={"x-api-key": ""},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/api/v1/surveys/responses/%7Bid%7D"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/api/v1/surveys/responses/{id}")!)
request.httpMethod = "GET"
request.setValue("", forHTTPHeaderField: "x-api-key")
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/api/v1/surveys/responses/{id}")
.method("GET", null)
.addHeader("x-api-key", "")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/api/v1/surveys/responses/{id}"));
request.headers.addAll({
"x-api-key": "",
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/api/v1/surveys/responses/%7Bid%7D"),
Headers =
{
{ "x-api-key", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"answers": [
{
"answer": "string",
"answer_options": [],
"answer_text": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"node": {},
"node_id": "string",
"response_id": "string"
}
],
"created_at": "1970-01-01T00:00:00.000Z",
"external_user_id": "string",
"fingerprint": "string",
"id": "string",
"metadata": {},
"survey_id": "string"
},
"success": true
}
```
---
### Get survey
Get a specific survey with all its nodes
Required API key scope: `surveys:view`.
**`GET`** `/api/v1/surveys/{id}`
**Authentication:** x-api-key (header)
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/api/v1/surveys/{id}' \
--header 'x-api-key: '
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/api/v1/surveys/{id}", {
method: "GET",
headers: {
"x-api-key": ""
},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/api/v1/surveys/{id}",
headers={"x-api-key": ""},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/api/v1/surveys/%7Bid%7D"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/api/v1/surveys/{id}")!)
request.httpMethod = "GET"
request.setValue("", forHTTPHeaderField: "x-api-key")
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/api/v1/surveys/{id}")
.method("GET", null)
.addHeader("x-api-key", "")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/api/v1/surveys/{id}"));
request.headers.addAll({
"x-api-key": "",
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/api/v1/surveys/%7Bid%7D"),
Headers =
{
{ "x-api-key", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"is_active": true,
"name": "string",
"nodes": [
{
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [],
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {},
"options": [],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
}
],
"number_of_questions": 0,
"number_of_responses": 0,
"project_id": "string",
"slug": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"success": true
}
```
---
### Delete survey
Delete a survey and all its associated nodes and responses
Required API key scope: `surveys:manage`.
**`DELETE`** `/api/v1/surveys/{id}`
**Authentication:** x-api-key (header)
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request DELETE \
--url 'https://api.appgram.dev/api/v1/surveys/{id}' \
--header 'x-api-key: '
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/api/v1/surveys/{id}", {
method: "DELETE",
headers: {
"x-api-key": ""
},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"DELETE",
"https://api.appgram.dev/api/v1/surveys/{id}",
headers={"x-api-key": ""},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/api/v1/surveys/%7Bid%7D"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/api/v1/surveys/{id}")!)
request.httpMethod = "DELETE"
request.setValue("", forHTTPHeaderField: "x-api-key")
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/api/v1/surveys/{id}")
.method("DELETE", null)
.addHeader("x-api-key", "")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("DELETE", Uri.parse("https://api.appgram.dev/api/v1/surveys/{id}"));
request.headers.addAll({
"x-api-key": "",
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("https://api.appgram.dev/api/v1/surveys/%7Bid%7D"),
Headers =
{
{ "x-api-key", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"success": true
},
"success": true
}
```
---
### Update survey
Update an existing survey's configuration
Required API key scope: `surveys:manage`.
**`PATCH`** `/api/v1/surveys/{id}`
**Authentication:** x-api-key (header)
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
**Body**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | `string` | | |
| `is_active` | `boolean` | | |
| `name` | `string` | | |
| `slug` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request PATCH \
--url 'https://api.appgram.dev/api/v1/surveys/{id}' \
--header 'x-api-key: ' \
--header 'Content-Type: application/json' \
--data '{
"description": "string",
"is_active": true,
"name": "string",
"slug": "string"
}'
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/api/v1/surveys/{id}", {
method: "PATCH",
headers: {
"x-api-key": "",
"Content-Type": "application/json"
},
body: "{\n \"description\": \"string\",\n \"is_active\": true,\n \"name\": \"string\",\n \"slug\": \"string\"\n}",
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"PATCH",
"https://api.appgram.dev/api/v1/surveys/{id}",
headers={"x-api-key": "", "Content-Type": "application/json"},
data="{\n \"description\": \"string\",\n \"is_active\": true,\n \"name\": \"string\",\n \"slug\": \"string\"\n}".encode("utf-8"),
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/api/v1/surveys/%7Bid%7D"
payload := strings.NewReader("{\n \"description\": \"string\",\n \"is_active\": true,\n \"name\": \"string\",\n \"slug\": \"string\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/api/v1/surveys/{id}")!)
request.httpMethod = "PATCH"
request.setValue("", forHTTPHeaderField: "x-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = Data("{\n \"description\": \"string\",\n \"is_active\": true,\n \"name\": \"string\",\n \"slug\": \"string\"\n}".utf8)
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/api/v1/surveys/{id}")
.method("PATCH", "{\n \"description\": \"string\",\n \"is_active\": true,\n \"name\": \"string\",\n \"slug\": \"string\"\n}".toRequestBody("application/json".toMediaType()))
.addHeader("x-api-key", "")
.addHeader("Content-Type", "application/json")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("PATCH", Uri.parse("https://api.appgram.dev/api/v1/surveys/{id}"));
request.headers.addAll({
"x-api-key": "",
"Content-Type": "application/json",
});
request.body = "{\n \"description\": \"string\",\n \"is_active\": true,\n \"name\": \"string\",\n \"slug\": \"string\"\n}";
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("https://api.appgram.dev/api/v1/surveys/%7Bid%7D"),
Headers =
{
{ "x-api-key", "" },
},
Content = new StringContent("{\n \"description\": \"string\",\n \"is_active\": true,\n \"name\": \"string\",\n \"slug\": \"string\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"is_active": true,
"name": "string",
"nodes": [
{
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [],
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {},
"options": [],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
}
],
"number_of_questions": 0,
"project_id": "string",
"slug": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"success": true
}
```
---
### Get survey analytics
Get analytics and statistics for a survey (admin only)
Required API key scope: `surveys:view`.
**`GET`** `/api/v1/surveys/{id}/analytics`
**Authentication:** x-api-key (header)
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/api/v1/surveys/{id}/analytics' \
--header 'x-api-key: '
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/api/v1/surveys/{id}/analytics", {
method: "GET",
headers: {
"x-api-key": ""
},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/api/v1/surveys/{id}/analytics",
headers={"x-api-key": ""},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/api/v1/surveys/%7Bid%7D/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/api/v1/surveys/{id}/analytics")!)
request.httpMethod = "GET"
request.setValue("", forHTTPHeaderField: "x-api-key")
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/api/v1/surveys/{id}/analytics")
.method("GET", null)
.addHeader("x-api-key", "")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/api/v1/surveys/{id}/analytics"));
request.headers.addAll({
"x-api-key": "",
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/api/v1/surveys/%7Bid%7D/analytics"),
Headers =
{
{ "x-api-key", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {},
"success": true
}
```
---
### Export survey responses
Export all responses for a survey as a downloadable file (admin only). Wide CSV (one row per response, one column per question) or nested JSON.
Required API key scope: `surveys:view`.
**`POST`** `/api/v1/surveys/{id}/export`
**Authentication:** x-api-key (header)
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `format` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request POST \
--url 'https://api.appgram.dev/api/v1/surveys/{id}/export' \
--header 'x-api-key: '
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/api/v1/surveys/{id}/export", {
method: "POST",
headers: {
"x-api-key": ""
},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"POST",
"https://api.appgram.dev/api/v1/surveys/{id}/export",
headers={"x-api-key": ""},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/api/v1/surveys/%7Bid%7D/export"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/api/v1/surveys/{id}/export")!)
request.httpMethod = "POST"
request.setValue("", forHTTPHeaderField: "x-api-key")
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/api/v1/surveys/{id}/export")
.method("POST", "".toRequestBody(null))
.addHeader("x-api-key", "")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("POST", Uri.parse("https://api.appgram.dev/api/v1/surveys/{id}/export"));
request.headers.addAll({
"x-api-key": "",
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.appgram.dev/api/v1/surveys/%7Bid%7D/export"),
Headers =
{
{ "x-api-key", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
"string"
```
---
### List survey nodes
Get all nodes (questions) for a survey
Required API key scope: `surveys:view`.
**`GET`** `/api/v1/surveys/{id}/nodes`
**Authentication:** x-api-key (header)
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/api/v1/surveys/{id}/nodes' \
--header 'x-api-key: '
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/api/v1/surveys/{id}/nodes", {
method: "GET",
headers: {
"x-api-key": ""
},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/api/v1/surveys/{id}/nodes",
headers={"x-api-key": ""},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/api/v1/surveys/%7Bid%7D/nodes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/api/v1/surveys/{id}/nodes")!)
request.httpMethod = "GET"
request.setValue("", forHTTPHeaderField: "x-api-key")
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/api/v1/surveys/{id}/nodes")
.method("GET", null)
.addHeader("x-api-key", "")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/api/v1/surveys/{id}/nodes"));
request.headers.addAll({
"x-api-key": "",
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/api/v1/surveys/%7Bid%7D/nodes"),
Headers =
{
{ "x-api-key", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": [
{
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [
{}
],
"children": [
{}
],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [],
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {},
"options": [],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
},
"options": [
{}
],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"is_active": true,
"name": "string",
"nodes": [],
"number_of_questions": 0,
"number_of_responses": 0,
"project": {},
"project_id": "string",
"slug": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [],
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {},
"options": [],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
}
}
],
"success": true
}
```
---
### Create survey node
Create a new question/node in a survey with support for multiple question types (yes_no, short_answer, paragraph, multiple_choice, checkboxes, rating)
Required API key scope: `surveys:manage`.
**`POST`** `/api/v1/surveys/{id}/nodes`
**Authentication:** x-api-key (header)
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
**Body**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `answer_no_node_id` | `string` | | |
| `answer_yes_node_id` | `string` | | |
| `branches` | `array` | | Conditional branches evaluated in order; each next_node_id must belong to the same survey. |
| `is_required` | `boolean` | | |
| `max_rating` | `integer` | | |
| `min_rating` | `integer` | | |
| `next_node_id` | `string` | | |
| `options` | `array` | | Choices for multiple_choice and checkboxes questions (validate_survey_node_options requires value and label); null for other types. |
| `parent_id` | `string` | | |
| `question` | `string` | ✓ | |
| `question_type` | `string` | ✓ | |
| `result_message` | `string` | | |
| `sort_order` | `integer` | | |
| `survey_id` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request POST \
--url 'https://api.appgram.dev/api/v1/surveys/{id}/nodes' \
--header 'x-api-key: ' \
--header 'Content-Type: application/json' \
--data '{
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [
{
"condition": {
"type": "equals"
},
"next_node_id": "string"
}
],
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"options": [
{
"label": "string",
"value": "string"
}
],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey_id": "string"
}'
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/api/v1/surveys/{id}/nodes", {
method: "POST",
headers: {
"x-api-key": "",
"Content-Type": "application/json"
},
body: "{\n \"answer_no_node_id\": \"string\",\n \"answer_yes_node_id\": \"string\",\n \"branches\": [\n {\n \"condition\": {\n \"type\": \"equals\"\n },\n \"next_node_id\": \"string\"\n }\n ],\n \"is_required\": true,\n \"max_rating\": 0,\n \"min_rating\": 0,\n \"next_node_id\": \"string\",\n \"options\": [\n {\n \"label\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"parent_id\": \"string\",\n \"question\": \"string\",\n \"question_type\": \"checkboxes\",\n \"result_message\": \"string\",\n \"sort_order\": 0,\n \"survey_id\": \"string\"\n}",
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"POST",
"https://api.appgram.dev/api/v1/surveys/{id}/nodes",
headers={"x-api-key": "", "Content-Type": "application/json"},
data="{\n \"answer_no_node_id\": \"string\",\n \"answer_yes_node_id\": \"string\",\n \"branches\": [\n {\n \"condition\": {\n \"type\": \"equals\"\n },\n \"next_node_id\": \"string\"\n }\n ],\n \"is_required\": true,\n \"max_rating\": 0,\n \"min_rating\": 0,\n \"next_node_id\": \"string\",\n \"options\": [\n {\n \"label\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"parent_id\": \"string\",\n \"question\": \"string\",\n \"question_type\": \"checkboxes\",\n \"result_message\": \"string\",\n \"sort_order\": 0,\n \"survey_id\": \"string\"\n}".encode("utf-8"),
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/api/v1/surveys/%7Bid%7D/nodes"
payload := strings.NewReader("{\n \"answer_no_node_id\": \"string\",\n \"answer_yes_node_id\": \"string\",\n \"branches\": [\n {\n \"condition\": {\n \"type\": \"equals\"\n },\n \"next_node_id\": \"string\"\n }\n ],\n \"is_required\": true,\n \"max_rating\": 0,\n \"min_rating\": 0,\n \"next_node_id\": \"string\",\n \"options\": [\n {\n \"label\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"parent_id\": \"string\",\n \"question\": \"string\",\n \"question_type\": \"checkboxes\",\n \"result_message\": \"string\",\n \"sort_order\": 0,\n \"survey_id\": \"string\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/api/v1/surveys/{id}/nodes")!)
request.httpMethod = "POST"
request.setValue("", forHTTPHeaderField: "x-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = Data("{\n \"answer_no_node_id\": \"string\",\n \"answer_yes_node_id\": \"string\",\n \"branches\": [\n {\n \"condition\": {\n \"type\": \"equals\"\n },\n \"next_node_id\": \"string\"\n }\n ],\n \"is_required\": true,\n \"max_rating\": 0,\n \"min_rating\": 0,\n \"next_node_id\": \"string\",\n \"options\": [\n {\n \"label\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"parent_id\": \"string\",\n \"question\": \"string\",\n \"question_type\": \"checkboxes\",\n \"result_message\": \"string\",\n \"sort_order\": 0,\n \"survey_id\": \"string\"\n}".utf8)
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/api/v1/surveys/{id}/nodes")
.method("POST", "{\n \"answer_no_node_id\": \"string\",\n \"answer_yes_node_id\": \"string\",\n \"branches\": [\n {\n \"condition\": {\n \"type\": \"equals\"\n },\n \"next_node_id\": \"string\"\n }\n ],\n \"is_required\": true,\n \"max_rating\": 0,\n \"min_rating\": 0,\n \"next_node_id\": \"string\",\n \"options\": [\n {\n \"label\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"parent_id\": \"string\",\n \"question\": \"string\",\n \"question_type\": \"checkboxes\",\n \"result_message\": \"string\",\n \"sort_order\": 0,\n \"survey_id\": \"string\"\n}".toRequestBody("application/json".toMediaType()))
.addHeader("x-api-key", "")
.addHeader("Content-Type", "application/json")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("POST", Uri.parse("https://api.appgram.dev/api/v1/surveys/{id}/nodes"));
request.headers.addAll({
"x-api-key": "",
"Content-Type": "application/json",
});
request.body = "{\n \"answer_no_node_id\": \"string\",\n \"answer_yes_node_id\": \"string\",\n \"branches\": [\n {\n \"condition\": {\n \"type\": \"equals\"\n },\n \"next_node_id\": \"string\"\n }\n ],\n \"is_required\": true,\n \"max_rating\": 0,\n \"min_rating\": 0,\n \"next_node_id\": \"string\",\n \"options\": [\n {\n \"label\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"parent_id\": \"string\",\n \"question\": \"string\",\n \"question_type\": \"checkboxes\",\n \"result_message\": \"string\",\n \"sort_order\": 0,\n \"survey_id\": \"string\"\n}";
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.appgram.dev/api/v1/surveys/%7Bid%7D/nodes"),
Headers =
{
{ "x-api-key", "" },
},
Content = new StringContent("{\n \"answer_no_node_id\": \"string\",\n \"answer_yes_node_id\": \"string\",\n \"branches\": [\n {\n \"condition\": {\n \"type\": \"equals\"\n },\n \"next_node_id\": \"string\"\n }\n ],\n \"is_required\": true,\n \"max_rating\": 0,\n \"min_rating\": 0,\n \"next_node_id\": \"string\",\n \"options\": [\n {\n \"label\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"parent_id\": \"string\",\n \"question\": \"string\",\n \"question_type\": \"checkboxes\",\n \"result_message\": \"string\",\n \"sort_order\": 0,\n \"survey_id\": \"string\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `201`
```json
{
"data": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [
{
"condition": {},
"next_node_id": "string"
}
],
"children": [
{
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [],
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {},
"options": [],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
}
],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [
{}
],
"children": [
{}
],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [],
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {},
"options": [],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
},
"options": [
{}
],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"is_active": true,
"name": "string",
"nodes": [],
"number_of_questions": 0,
"number_of_responses": 0,
"project": {},
"project_id": "string",
"slug": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [],
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {},
"options": [],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
}
},
"options": [
{
"label": "string",
"value": "string"
}
],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"is_active": true,
"name": "string",
"nodes": [
{}
],
"number_of_questions": 0,
"number_of_responses": 0,
"project": {
"captcha_enabled": true,
"color": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"custom_domain": "string",
"description": "string",
"icon_url": "string",
"id": "string",
"is_launched": true,
"name": "string",
"organization_id": "string",
"slug": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"project_id": "string",
"slug": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [
{}
],
"children": [
{}
],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [],
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {},
"options": [],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
},
"options": [
{}
],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"is_active": true,
"name": "string",
"nodes": [],
"number_of_questions": 0,
"number_of_responses": 0,
"project": {},
"project_id": "string",
"slug": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [],
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {},
"options": [],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey": {},
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
}
}
},
"success": true
}
```
---
### List survey responses
Get paginated list of survey responses for a survey (admin only)
Required API key scope: `surveys:view`.
**`GET`** `/api/v1/surveys/{id}/responses`
**Authentication:** x-api-key (header)
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `page` | `string` | | |
| `per_page` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/api/v1/surveys/{id}/responses' \
--header 'x-api-key: '
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/api/v1/surveys/{id}/responses", {
method: "GET",
headers: {
"x-api-key": ""
},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/api/v1/surveys/{id}/responses",
headers={"x-api-key": ""},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/api/v1/surveys/%7Bid%7D/responses"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/api/v1/surveys/{id}/responses")!)
request.httpMethod = "GET"
request.setValue("", forHTTPHeaderField: "x-api-key")
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/api/v1/surveys/{id}/responses")
.method("GET", null)
.addHeader("x-api-key", "")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/api/v1/surveys/{id}/responses"));
request.headers.addAll({
"x-api-key": "",
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/api/v1/surveys/%7Bid%7D/responses"),
Headers =
{
{ "x-api-key", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"page": 0,
"per_page": 0,
"responses": [
{
"answers": [],
"created_at": "1970-01-01T00:00:00.000Z",
"external_user_id": "string",
"fingerprint": "string",
"id": "string",
"metadata": {},
"survey": {},
"survey_id": "string"
}
],
"total": 0
},
"success": true
}
```
---
### Submit survey response
Submit a completed survey response with all answers (public endpoint, no authentication required)
**`POST`** `/portal/surveys/{id}/responses`
**Authentication:** None
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | ✓ | |
**Body**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `answers` | `array` | ✓ | |
| `external_user_id` | `string` | | |
| `fingerprint` | `string` | ✓ | |
| `metadata` | `object` | | |
**Responses**
| Status | Description |
| --- | --- |
| 201 | Created |
| 400 | Bad Request |
**Request**
**cURL**
```bash
curl --request POST \
--url 'https://api.appgram.dev/portal/surveys/{id}/responses' \
--header 'Content-Type: application/json' \
--data '{
"answers": [
{
"answer": "string",
"answer_options": [
"string"
],
"answer_text": "string",
"node_id": "string"
}
],
"external_user_id": "string",
"fingerprint": "string",
"metadata": {}
}'
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/surveys/{id}/responses", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: "{\n \"answers\": [\n {\n \"answer\": \"string\",\n \"answer_options\": [\n \"string\"\n ],\n \"answer_text\": \"string\",\n \"node_id\": \"string\"\n }\n ],\n \"external_user_id\": \"string\",\n \"fingerprint\": \"string\",\n \"metadata\": {}\n}",
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"POST",
"https://api.appgram.dev/portal/surveys/{id}/responses",
headers={"Content-Type": "application/json"},
data="{\n \"answers\": [\n {\n \"answer\": \"string\",\n \"answer_options\": [\n \"string\"\n ],\n \"answer_text\": \"string\",\n \"node_id\": \"string\"\n }\n ],\n \"external_user_id\": \"string\",\n \"fingerprint\": \"string\",\n \"metadata\": {}\n}".encode("utf-8"),
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/surveys/%7Bid%7D/responses"
payload := strings.NewReader("{\n \"answers\": [\n {\n \"answer\": \"string\",\n \"answer_options\": [\n \"string\"\n ],\n \"answer_text\": \"string\",\n \"node_id\": \"string\"\n }\n ],\n \"external_user_id\": \"string\",\n \"fingerprint\": \"string\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/surveys/{id}/responses")!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = Data("{\n \"answers\": [\n {\n \"answer\": \"string\",\n \"answer_options\": [\n \"string\"\n ],\n \"answer_text\": \"string\",\n \"node_id\": \"string\"\n }\n ],\n \"external_user_id\": \"string\",\n \"fingerprint\": \"string\",\n \"metadata\": {}\n}".utf8)
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/surveys/{id}/responses")
.method("POST", "{\n \"answers\": [\n {\n \"answer\": \"string\",\n \"answer_options\": [\n \"string\"\n ],\n \"answer_text\": \"string\",\n \"node_id\": \"string\"\n }\n ],\n \"external_user_id\": \"string\",\n \"fingerprint\": \"string\",\n \"metadata\": {}\n}".toRequestBody("application/json".toMediaType()))
.addHeader("Content-Type", "application/json")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("POST", Uri.parse("https://api.appgram.dev/portal/surveys/{id}/responses"));
request.headers.addAll({
"Content-Type": "application/json",
});
request.body = "{\n \"answers\": [\n {\n \"answer\": \"string\",\n \"answer_options\": [\n \"string\"\n ],\n \"answer_text\": \"string\",\n \"node_id\": \"string\"\n }\n ],\n \"external_user_id\": \"string\",\n \"fingerprint\": \"string\",\n \"metadata\": {}\n}";
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.appgram.dev/portal/surveys/%7Bid%7D/responses"),
Content = new StringContent("{\n \"answers\": [\n {\n \"answer\": \"string\",\n \"answer_options\": [\n \"string\"\n ],\n \"answer_text\": \"string\",\n \"node_id\": \"string\"\n }\n ],\n \"external_user_id\": \"string\",\n \"fingerprint\": \"string\",\n \"metadata\": {}\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `201`
```json
{
"data": {
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"survey_id": "string"
},
"success": true
}
```
---
### Get a survey to answer
Get a survey by slug for users to take. Only returns active surveys (public endpoint, no authentication required)
**`GET`** `/portal/surveys/{slug}`
**Authentication:** None
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `slug` | `string` | ✓ | |
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/surveys/{slug}?project_id='
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/surveys/{slug}?project_id=", {
method: "GET",
headers: {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/portal/surveys/{slug}?project_id=",
headers={},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/surveys/%7Bslug%7D?project_id="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/surveys/{slug}?project_id=")!)
request.httpMethod = "GET"
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/surveys/{slug}?project_id=")
.method("GET", null)
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/portal/surveys/{slug}?project_id="));
request.headers.addAll({
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/portal/surveys/%7Bslug%7D?project_id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": {
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"is_active": true,
"name": "string",
"nodes": [
{
"answer_no_node_id": "string",
"answer_yes_node_id": "string",
"branches": [],
"children": [],
"created_at": "1970-01-01T00:00:00.000Z",
"id": "string",
"is_required": true,
"max_rating": 0,
"min_rating": 0,
"next_node_id": "string",
"no_node": {},
"options": [],
"parent_id": "string",
"question": "string",
"question_type": "checkboxes",
"result_message": "string",
"sort_order": 0,
"survey_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z",
"yes_node": {}
}
],
"number_of_questions": 0,
"project_id": "string",
"slug": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"success": true
}
```
---
# Blog
Read published posts, categories, tags, and feeds.
> Source: https://appgram.dev/docs/api/blog
> Endpoints: 11
> API version: v1.0
See [Authentication](/docs/guides/api-authentication) for the base setup.
### Get Atom feed
Get Atom feed for blog posts (public endpoint)
**`GET`** `/portal/blog/atom.xml`
**Authentication:** None
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 500 | Internal Server Error |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/blog/atom.xml?project_id='
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/blog/atom.xml?project_id=", {
method: "GET",
headers: {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/portal/blog/atom.xml?project_id=",
headers={},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/blog/atom.xml?project_id="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/blog/atom.xml?project_id=")!)
request.httpMethod = "GET"
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/blog/atom.xml?project_id=")
.method("GET", null)
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/portal/blog/atom.xml?project_id="));
request.headers.addAll({
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/portal/blog/atom.xml?project_id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
"string"
```
---
### List blog categories
List all blog categories for a project (public endpoint)
**`GET`** `/portal/blog/categories`
**Authentication:** None
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | `string` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 500 | Internal Server Error |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/blog/categories?project_id='
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/blog/categories?project_id=", {
method: "GET",
headers: {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/portal/blog/categories?project_id=",
headers={},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/blog/categories?project_id="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/blog/categories?project_id=")!)
request.httpMethod = "GET"
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/blog/categories?project_id=")
.method("GET", null)
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/portal/blog/categories?project_id="));
request.headers.addAll({
});
final response = await request.send();
print(await response.stream.bytesToString());
}
```
**C# · HttpClient**
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.appgram.dev/portal/blog/categories?project_id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
```
**Response** — `200`
```json
{
"data": [
{
"color": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"description": "string",
"id": "string",
"name": "string",
"post_count": 0,
"project_id": "string",
"slug": "string",
"sort_order": 0,
"updated_at": "1970-01-01T00:00:00.000Z"
}
],
"success": true
}
```
---
### Get category with posts
Get a category with its published posts (public endpoint)
**`GET`** `/portal/blog/categories/{slug}`
**Authentication:** None
**Path parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `slug` | `string` | ✓ | |
**Query parameters**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | `string` | | |
| `page` | `integer` | | |
| `per_page` | `integer` | | |
**Responses**
| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
| 500 | Internal Server Error |
**Request**
**cURL**
```bash
curl --request GET \
--url 'https://api.appgram.dev/portal/blog/categories/{slug}?project_id='
```
**TypeScript · fetch**
```typescript
const response = await fetch("https://api.appgram.dev/portal/blog/categories/{slug}?project_id=", {
method: "GET",
headers: {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
```
**Python · requests**
```python
import requests
response = requests.request(
"GET",
"https://api.appgram.dev/portal/blog/categories/{slug}?project_id=",
headers={},
timeout=30,
)
response.raise_for_status()
print(response.text)
```
**Go · net/http**
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/portal/blog/categories/%7Bslug%7D?project_id="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
```
**Swift · URLSession**
```swift
import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/portal/blog/categories/{slug}?project_id=")!)
request.httpMethod = "GET"
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
```
**Kotlin · OkHttp**
```kotlin
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/portal/blog/categories/{slug}?project_id=")
.method("GET", null)
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
```
**Dart · http**
```dart
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future main() async {
final request = http.Request("GET", Uri.parse("https://api.appgram.dev/portal/blog/categories/{slug}?project_id=