import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
import * as core from "../../../../core/index.mjs";
import * as Pinnacle from "../../../index.mjs";
import { Submissions } from "../resources/submissions/client/Client.mjs";
export declare namespace Forms {
interface Options extends BaseClientOptions {
}
interface RequestOptions extends BaseRequestOptions {
}
}
export declare class Forms {
protected readonly _options: Forms.Options;
protected _submissions: Submissions | undefined;
constructor(_options: Forms.Options);
get submissions(): Submissions;
/**
* Retrieve a form by id. Includes submission count, last submission timestamp, and archive state.
*
* @param {string} id - The unique identifier of the form you want to retrieve.
*
This identifier is a string that always begins with the prefix `form_`, for example: `form_Oy2n7iUoi9CJwUU6`. It's returned on every form response (`Form.id`) and by [`POST /forms/send`](/api-reference/forms/send-form) (`response.form.id`).
* @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Pinnacle.BadRequestError}
* @throws {@link Pinnacle.UnauthorizedError}
* @throws {@link Pinnacle.NotFoundError}
* @throws {@link Pinnacle.InternalServerError}
*
* @example
* await client.forms.get("form_Oy2n7iUoi9CJwUU6")
*/
get(id: string, requestOptions?: Forms.RequestOptions): core.HttpResponsePromise;
private __get;
/**
* Partial update. Only keys present in the body are applied. Archived forms (non-null `archived_at`) cannot be updated — restore the form by setting `archived_at: null` in a PATCH first.
*
* @param {string} id - The unique identifier of the form you want to update.
*
This identifier is a string that always begins with the prefix `form_`, for example: `form_Oy2n7iUoi9CJwUU6`.
* @param {Pinnacle.UpdateFormParams} request
* @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Pinnacle.BadRequestError}
* @throws {@link Pinnacle.UnauthorizedError}
* @throws {@link Pinnacle.NotFoundError}
* @throws {@link Pinnacle.InternalServerError}
*
* @example
* await client.forms.update("form_Oy2n7iUoi9CJwUU6", {
* name: "Contact request (v2)",
* can_update: true,
* expires_at: "2026-12-31T23:59:59Z"
* })
*/
update(id: string, request?: Pinnacle.UpdateFormParams, requestOptions?: Forms.RequestOptions): core.HttpResponsePromise;
private __update;
/**
* Paginated list of forms on your team, sorted by creation date (newest first). Includes archived forms.
*
* @param {Pinnacle.ListFormsParams} request
* @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Pinnacle.BadRequestError}
* @throws {@link Pinnacle.UnauthorizedError}
* @throws {@link Pinnacle.InternalServerError}
*
* @example
* await client.forms.list({
* pageIndex: 0,
* pageSize: 20
* })
*/
list(request?: Pinnacle.ListFormsParams, requestOptions?: Forms.RequestOptions): core.HttpResponsePromise;
private __list;
/**
* Create a hosted form without sending it.
*
* Returns the form object including its public URL — `https://forms.pinnacle.sh/{form_id}`.
*
* To also deliver the URL to a recipient over SMS or RCS in a single call, use [`POST /forms/send`](/api-reference/forms/send-form).
*
* @param {Pinnacle.CreateFormRequest} request
* @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Pinnacle.BadRequestError}
* @throws {@link Pinnacle.UnauthorizedError}
* @throws {@link Pinnacle.InternalServerError}
*
* @example
* await client.forms.create({
* name: "Contact request",
* description: "We'll follow up over SMS or RCS.",
* fields: [{
* type: "text",
* key: "full_name",
* label: "Full name",
* required: true,
* placeholder: "Ada Lovelace",
* min_length: 2,
* max_length: 60
* }, {
* type: "email",
* key: "email",
* label: "Email",
* required: true,
* placeholder: "you@example.com"
* }, {
* type: "phone",
* key: "phone",
* label: "Phone",
* required: true,
* placeholder: "(555) 555-1212"
* }, {
* type: "select",
* key: "plan",
* label: "Plan",
* required: true,
* options: [{
* value: "basic",
* label: "Basic"
* }, {
* value: "pro",
* label: "Pro"
* }, {
* value: "enterprise",
* label: "Enterprise"
* }]
* }],
* can_update: false
* })
*/
create(request: Pinnacle.CreateFormRequest, requestOptions?: Forms.RequestOptions): core.HttpResponsePromise;
private __create;
/**
* Send a form to a recipient over SMS or RCS, or mint a standalone submission URL.
*
* Pass `form` as either an existing form id (`form_*`) or an inline `{ fields, ... }` definition to mint a new form for this send.
*
* The delivery channel is inferred from `from`:
* - `from: "agent_*"` → RCS (with optional SMS `fallback`)
* - `from: "+E.164"` → SMS
*
* When `to` is provided, Pinnacle dispatches a message whose body contains the submission URL and the recipient is recorded on the response: `submission.to` echoes the same E.164 number and `message_id` is the id of the outbound SMS/RCS.
*
* When `to` is omitted, no message is sent — `submission.to` and `message_id` are both `null` — which is useful for embedding the URL in your own outreach.
*
* On completion, a `FORM.SUBMISSION` webhook event is delivered to webhooks subscribed to the sender. See [Receiving Messages and User Events](/guides/messages/receiving).
*
* @param {Pinnacle.SendFormParams} request
* @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Pinnacle.BadRequestError}
* @throws {@link Pinnacle.UnauthorizedError}
* @throws {@link Pinnacle.NotFoundError}
* @throws {@link Pinnacle.InternalServerError}
*
* @example
* await client.forms.send({
* from: "agent_iM9wQcyBBjYn",
* to: "+14155551234",
* form: "form_Oy2n7iUoi9CJwUU6",
* fallback: {
* from: "+14155550000"
* },
* options: {
* webview_mode: "FULL"
* }
* })
*/
send(request: Pinnacle.SendFormParams, requestOptions?: Forms.RequestOptions): core.HttpResponsePromise;
private __send;
protected _getCustomAuthorizationHeaders(): Promise>;
}