> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goyappr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Suggested campaign settings

> The settings the dashboard's campaign wizard starts a new campaign from, resolved
for this workspace. `settings` can be sent to `POST /campaigns` as-is, together
with `name`, `agent_id`, `from_phone_number_id` and `regulatory_basis`.

These are suggestions the caller sends, not defaults the API applies: a
name-only `POST /campaigns` stores every other configuration field `null`.
The exception is `stop_disposition_ids`, which a create that leaves it out
takes from here. The set is copied when the campaign is created: an outcome
added later stops only campaigns created after it; send this list with
`PATCH /campaigns/{id}` to re-apply it. It includes every outcome the
workspace added itself, a "call me back" one included. Required scope `campaigns:read`.


The settings the dashboard's campaign wizard starts a new campaign from, resolved for your workspace: its outcome IDs, its timezone and its working week. `settings` is shaped to be sent to [`POST /campaigns`](https://docs.goyappr.com/api-reference/campaigns/create) as-is.

Required scope: `campaigns:read`.

> [!NOTE]
>
> **These are suggestions you send, not defaults the API applies** — with one exception.
> A campaign's configuration columns have no default: a name-only `POST /campaigns`
> creates a draft with every other setting `null`, and launch refuses until each is set.
> The exception is `stop_disposition_ids`: left out of `POST /campaigns`, the campaign
> stops on the set below. Read these values, change what you want, and send them — the
> way a dashboard user sees them on screen before saving.

> [!WARNING]
>
> The suggested stop set includes **every outcome your workspace added itself**, whatever it means. An outcome of yours that asks for another call — *Call me back on Sunday*, *Callback requested — confirm number* — therefore stops a new campaign from calling that contact again, unlike the built-in *Callback Requested*. Take such an outcome out of `settings.stop_disposition_ids` before you send it, or the person who asked to be called back never is.

**The stop set is copied when the campaign is created.** `POST /campaigns` stores these ids on the campaign; it does not follow this list afterwards. An outcome you add to the workspace later stops only the campaigns created after it — an existing draft or a running campaign keeps the set it was created with. To give an existing campaign the current suggested set, read this endpoint again and send its `settings.stop_disposition_ids` with [`PATCH /campaigns/{id}`](https://docs.goyappr.com/api-reference/campaigns/update):

```bash theme={null}
IDS=$(curl -s "https://api.goyappr.com/campaigns/defaults" -H "Authorization: Bearer $YAPPR_API_KEY" \
  | jq '{stop_disposition_ids: .settings.stop_disposition_ids}')
curl -X PATCH "https://api.goyappr.com/campaigns/CAMPAIGN_ID" \
  -H "Authorization: Bearer $YAPPR_API_KEY" -H "Content-Type: application/json" -d "$IDS"
```

There is no query parameter and no request body.

## Response fields

| Field | Type | Meaning |
| - | - | - |
| `settings` | object | Writable campaign fields with their suggested values. Merge in `name`, `agent_id`, `from_phone_number_id` and `regulatory_basis` — never suggested, because they are yours to state — and send the result to `POST /campaigns`. |
| `settings.stop_disposition_ids` | uuid\[] | Your workspace's IDs for every outcome that settles a contact: **Interested**, **Appointment Set**, **Not Interested**, **Issue Resolved**, **Transferred to a Person**, **Wrong Number**, **Do Not Call**, and every outcome your workspace added itself (a *Qualified* or *Booked a viewing* of your own records something the call decided). An interested contact is not called again: they show on the campaign's leads with that outcome, and a follow-up on the agent can notify you. Left out: *Callback Requested*, which asks for another call, and the four outcomes Yappr assigns by itself — *No Answer*, *Voicemail*, *Unclassified* and *Failed* — which have their own switches (`stop_on_no_answer`, `stop_on_voicemail`, `stop_on_unclassified`) and are refused in this list. |
| `settings.calling_window` | object | `{ tz, days, start, end }` in your workspace timezone, drawn from your workspace calling hours when it has them. How depends on `outbound_enabled` on [`GET /call-windows`](https://docs.goyappr.com/api-reference/call-windows/get). When it is `true` (the default), the hours gate every outbound call on top of a campaign's window, so the window is the days that have hours, from the earliest opening to the latest close — a workspace open Sunday–Thursday 09:00–19:00 and Friday 09:00–13:00 gets `days: [0,1,2,3,4,5]`, `09:00`–`19:00`, and Friday still closes at 13:00. When it is `false`, nothing trims outbound calls, so the window fits inside the hours of every day it offers, choosing the most calling time — the same workspace gets `days: [0,1,2,3,4]`, `09:00`–`19:00`, and no call on Friday. Without hours it is `09:00`–`18:00`, Sunday–Thursday (`[0,1,2,3,4]`) where that is the working week — Israel and most of the Gulf — and Monday–Friday (`[1,2,3,4,5]`) elsewhere. `{}` (follow the workspace calling hours) when the workspace has no timezone set. |
| `settings.max_attempts` … `settings.max_infra_retries` | — | The pacing and retry values listed as *Suggested* on [Create a campaign](https://docs.goyappr.com/api-reference/campaigns/create.md): 3 attempts, a 1-hour wait after no answer, a 1-day wait after a conversation, 200 calls a day, 30 seconds apart, 2 at a time, no double dial, 3 retries for calls that could not be placed. |
| `stop_dispositions` | object\[] | The full outcome objects behind `settings.stop_disposition_ids`, so you can show their labels without a second request. |
| `timezone` | string \| null | The workspace timezone the window was built from. Set it with `timezone` on [`PUT /call-windows`](https://docs.goyappr.com/api-reference/call-windows/update#the-workspaces-clock). |
| `window_source` | string | `workspace_hours` when the window was drawn from your calling hours, `suggested` when the workspace has none and the fixed suggestion applies. |
| `company_id` | uuid | Workspace this response belongs to. |

## Example

```bash theme={null}
curl "https://api.goyappr.com/campaigns/defaults" \
  -H "Authorization: Bearer $YAPPR_API_KEY"
```

```json theme={null}
{
  "settings": {
    "max_calls_per_day": 200,
    "min_seconds_between_calls": 30,
    "max_in_flight": 2,
    "randomize_retry_time": false,
    "stop_on_no_answer": false,
    "stop_on_voicemail": false,
    "stop_on_unclassified": false,
    "max_attempts": 3,
    "retry_no_answer_seconds": 3600,
    "retry_completed_seconds": 86400,
    "double_dial_enabled": false,
    "double_dial_gap_seconds": 90,
    "max_infra_retries": 3,
    "stop_disposition_ids": [
      "5c1d9a2e-0000-4b10-9f31-000000000004",
      "5c1d9a2e-0000-4b10-9f31-000000000002",
      "5c1d9a2e-0000-4b10-9f31-000000000005",
      "5c1d9a2e-0000-4b10-9f31-000000000007",
      "5c1d9a2e-0000-4b10-9f31-000000000008",
      "5c1d9a2e-0000-4b10-9f31-000000000009",
      "5c1d9a2e-0000-4b10-9f31-000000000010"
    ],
    "calling_window": { "tz": "Asia/Jerusalem", "days": [0, 1, 2, 3, 4], "start": "09:00", "end": "18:00" }
  },
  "stop_dispositions": [
    { "id": "5c1d9a2e-0000-4b10-9f31-000000000002", "label": "Not Interested", "position": 2 }
  ],
  "timezone": "Asia/Jerusalem",
  "window_source": "suggested",
  "company_id": "00000000-0000-4000-8000-0000000000c1"
}
```

`stop_dispositions` is abbreviated to one entry here; the response carries all seven — one per ID above, for a workspace with only the standard outcomes, and one more for each outcome it added.

## Creating a campaign from them

```bash theme={null}
DEFAULTS=$(curl -s "https://api.goyappr.com/campaigns/defaults" -H "Authorization: Bearer $YAPPR_API_KEY")
echo "$DEFAULTS" | jq '.settings + {
  name: "Recall — October",
  agent_id: "7e8a91c1-0000-4c11-9a00-000000000001",
  from_phone_number_id: "2d9f4b6a-0000-4a3c-8b21-000000000002",
  regulatory_basis: "existing_customer"
}' | curl -X POST "https://api.goyappr.com/campaigns" \
  -H "Authorization: Bearer $YAPPR_API_KEY" -H "Content-Type: application/json" -d @-
```

## Errors

| HTTP | Code | When |
| - | - | - |
| 403 | `INSUFFICIENT_SCOPE` | API key lacks `campaigns:read`. |
| 405 | `METHOD_NOT_ALLOWED` | Any method other than `GET`. This path never creates a campaign. |
| 500 | `INTERNAL_ERROR` | The workspace's timezone, calling hours or outcomes could not be read. Retry. |


## OpenAPI

````yaml GET /campaigns/defaults
openapi: 3.1.0
info:
  title: Yappr API
  description: >
    Create and manage AI voice agents, purchase phone numbers, configure tools,
    and initiate calls — all via REST.
  version: 1.0.0
  contact:
    url: https://goyappr.com
servers:
  - url: https://api.goyappr.com
    description: Production
security:
  - apiKey: []
paths:
  /campaigns/defaults:
    get:
      tags:
        - Campaigns
      summary: Suggested campaign settings
      description: >
        The settings the dashboard's campaign wizard starts a new campaign from,
        resolved

        for this workspace. `settings` can be sent to `POST /campaigns` as-is,
        together

        with `name`, `agent_id`, `from_phone_number_id` and `regulatory_basis`.


        These are suggestions the caller sends, not defaults the API applies: a

        name-only `POST /campaigns` stores every other configuration field
        `null`.

        The exception is `stop_disposition_ids`, which a create that leaves it
        out

        takes from here. The set is copied when the campaign is created: an
        outcome

        added later stops only campaigns created after it; send this list with

        `PATCH /campaigns/{id}` to re-apply it. It includes every outcome the

        workspace added itself, a "call me back" one included. Required scope
        `campaigns:read`.
      operationId: getCampaignDefaults
      responses:
        '200':
          description: The suggested settings for this workspace
          content:
            application/json:
              schema:
                type: object
                properties:
                  settings:
                    type: object
                    description: >
                      Writable campaign fields with their suggested values.
                      `stop_disposition_ids` holds this workspace's Interested,
                      Appointment Set, Not Interested, Issue Resolved,
                      Transferred to a Person, Wrong Number and Do Not Call
                      outcomes (any the workspace still has) and every outcome
                      the workspace added itself — all but Callback Requested
                      and the four Yappr assigns (No Answer, Voicemail,
                      Unclassified, Failed). `calling_window` is in the
                      workspace timezone and follows the workspace calling hours
                      when it has them: while `outbound_enabled` is true, their
                      days from the earliest opening to the latest close (the
                      hours still trim each day); while it is false, the window
                      that fits inside the hours of every day it offers; without
                      hours it is 09:00–18:00, Sunday–Thursday where that is the
                      working week and Monday–Friday elsewhere. `{}` when the
                      workspace has no timezone.
                    properties:
                      stop_disposition_ids:
                        type: array
                        items:
                          type: string
                          format: uuid
                      calling_window:
                        type: object
                        additionalProperties: true
                      stop_on_no_answer:
                        type: boolean
                        example: false
                      stop_on_voicemail:
                        type: boolean
                        example: false
                      stop_on_unclassified:
                        type: boolean
                        example: false
                      max_attempts:
                        type: integer
                        example: 3
                      max_infra_retries:
                        type: integer
                        example: 3
                      retry_no_answer_seconds:
                        type: integer
                        example: 3600
                      retry_completed_seconds:
                        type: integer
                        example: 86400
                      randomize_retry_time:
                        type: boolean
                        example: false
                      double_dial_enabled:
                        type: boolean
                        example: false
                      double_dial_gap_seconds:
                        type: integer
                        example: 90
                      max_calls_per_day:
                        type: integer
                        example: 200
                      min_seconds_between_calls:
                        type: integer
                        example: 30
                      max_in_flight:
                        type: integer
                        example: 2
                  stop_dispositions:
                    type: array
                    description: >-
                      The full outcome objects behind
                      `settings.stop_disposition_ids`.
                    items:
                      type: object
                      additionalProperties: true
                  timezone:
                    type: string
                    nullable: true
                  window_source:
                    type: string
                    enum:
                      - workspace_hours
                      - suggested
                    description: >-
                      Where `settings.calling_window` came from — the workspace
                      calling hours, or the fixed suggestion when the workspace
                      has none.
                  company_id:
                    type: string
                    format: uuid
        '400':
          description: >-
            CAMPAIGNS_QUERY_INVALID — a query parameter was sent; this read
            takes none, and the message names it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '405':
          description: >-
            `METHOD_NOT_ALLOWED` — any method but GET. This path never creates a
            campaign.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: The workspace's timezone or outcomes could not be read.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - error
        - code
      description: >
        Every error response - the secret-key API and the browser data plane
        alike - carries a

        human-readable `error` and a stable machine `code`, and a refusal that
        names what is

        wrong with the request carries `issues[]` too. Branch on `code`, never
        on the `error`

        text. A refusal that names nothing more specific carries the code its
        status means:

        `BAD_REQUEST` (400), `UNAUTHORIZED` (401, the browser data plane; the
        secret-key API

        answers `MISSING_KEY`, `INVALID_KEY` or `EXPIRED_KEY`), `BILLING_ERROR`
        (402),

        `FORBIDDEN` (403), `NOT_FOUND` (404), `METHOD_NOT_ALLOWED` (405),
        `CONFLICT` (409),

        `GONE` (410), `PAYLOAD_TOO_LARGE` (413), `UNSUPPORTED_MEDIA_TYPE` (415),

        `UNPROCESSABLE_REQUEST` (422), `RATE_LIMIT` (429), `INTERNAL_ERROR`
        (500),

        `UPSTREAM_ERROR` (502), `SERVICE_UNAVAILABLE` (503), `UPSTREAM_TIMEOUT`
        (504). Some

        refusals add members of their own beside these (a call request's
        `status`, a workflow's

        `current_version`); the operation says which.
      properties:
        error:
          type: string
          description: The refusal, in one sentence for a person. Its wording may change.
        code:
          type: string
          description: The stable code to branch on.
        issues:
          type: array
          description: >
            Each thing at fault, on a 400 or 422 that names them: every query
            parameter or body field, not just the first. `path` is the
            parameter's name or the field's location.
          items:
            type: object
            required:
              - code
              - message
            properties:
              code:
                type: string
                description: >-
                  query_param_unknown, query_param_repeated, query_param_blank,
                  query_param_invalid, field_unknown, field_required,
                  field_invalid, or the route's own word.
              path:
                type: string
              message:
                type: string
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Your Yappr API key (e.g. `ypr_live_...`). Generate one in the dashboard
        under **Settings → API Keys**. No key is `401 MISSING_KEY`; a key that
        is not one of ours, or is revoked, is `401 INVALID_KEY`; an expired one
        is `401 EXPIRED_KEY`. A valid key without the scope an operation needs
        is `403 INSUFFICIENT_SCOPE` on every operation, and the message names
        the scope. Every response, a 401 included, carries X-RateLimit-Limit,
        X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a
        minute per API key. Every 429, whatever its code, carries Retry-After
        (whole seconds, never zero): the per-key budget's `RATE_LIMIT` asks for
        what is left of the minute, a route's daily cap (`RATE_LIMITED`) for the
        time until that cap resets. All four headers are listed in
        Access-Control-Expose-Headers, so a browser can read them. A path the
        API does not serve (an unknown sub-path, an id left empty) is `404
        ROUTE_NOT_FOUND`, and a method a served path does not take is `405
        METHOD_NOT_ALLOWED` with an `Allow` header; both are answered before any
        scope check, and nothing is read or changed. A trailing slash is ignored
        where it cannot be an id left empty (`POST /calls/` is `POST /calls`)
        and refused where it can (`GET /calls/`). A doubled slash inside a path
        is merged into one before the request reaches the API (`GET //calls` is
        `GET /calls`).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.