---
title: "Create play"
method: POST
path: "/api/plays"
tags: ["plays"]
---

# Create play

`POST /api/plays`

## Request

- Base URL: `https://beta.getsales.io/playtables/v1`
- URL: `https://beta.getsales.io/playtables/v1/api/plays`
- Auth: HTTP bearer and API key in header `Team-SID`

Create a play. The usual way: catalog_key alone (plus action.workflow_sid for a people play), which births the playbook's entry on the table as it is, once (a second create answers the existing row); then estimate_play, one sentence with the count and the credits, and run_play or the switch. The other way, a play saved from a view: an audience of one tab (the same filter AST a saved view carries), one action and a cadence. find_people over a company audience: the play owns a find_people source born at the first run; add_to_workflow over a people audience: the play owns a manual source born when the workflow is named (here, or later with update_play). A manual play runs on run_play (the click is the consent); a daily play runs by itself while enabled, and switching it on is the consent: estimate_play first, then say what one run does and what a day may spend (daily_credit_limit) in one sentence, and switch it on only after the yes. Refusals: an action that does not fit the object, a switch or a ceiling where it does not apply, a people play switched on with no workflow (422), an archived workflow (409 conflict), a workflow with no published version (409 invalid_transition), an audience the tab refuses (422 under audience).

Contract:
- MCP tool `create_play`, registry package `mcp.playtables/plays`, mount `playtables.pipeline`.
- Operation `create`, response envelope `create`.
- Flags: none.

## Request body

- CreatePlayRequest: Request body of `create_play`.
  - `playtable_sid` string, required: The table the play lives in; its audience is resolved inside it.
  - `catalog_key` 'keep_fresh' | 'congratulate' | 'on_job_change' | 'engage_posts' | 'on_website_visit' | 'find_people_empty' | 'top_up_thin' | 'top_up_silent' | 'top_up_no_reply' | 'top_up_exhausted' | 'find_decision_maker' | 'reengage_dormant' | 'reach_untouched': A playbook play: the entry gives object, audience, action and name, so send only the table (plus action.workflow_sid for a people play; cadence, switch, ceiling if wanted). Born once per table: a repeat answers the existing row, already_exists true.
  - `name` string: Required without catalog_key; with it, a name over the entry's.
  - `object_type` 'people' | 'company': Required without catalog_key. What the audience selects: company for find_people, people for add_to_workflow (422 otherwise).
  - `action_type` 'find_people' | 'add_to_workflow' | 'refresh' | 'congratulate' | 'on_job_change' | 'engage_posts' | 'on_website_visit': Required without catalog_key.
  - `action` object: The action's parameters (required without catalog_key), the keys of the action_type over the entry's defaults. The sids of the play's sources are never sent: the server births them. A workflow a typed action names must be the team's, live and published.
    - `prompt` string, nullable: find_people: who to find at each account; absent on a playbook play = the entry's default, empty otherwise = everyone the page gives.
    - `per_company_limit` integer, nullable: find_people: people per account; absent on a playbook play = the entry's default, absent otherwise = the whole first page.
    - `workflow_sid` string, nullable: add_to_workflow: the workflow the audience enters, the team's, live, published (409 otherwise); the play's manual source is born in it. Omit to pick it later with update_play: until then the play neither estimates, runs nor switches on.
    - `moments` object: congratulate: the moments over the entry's defaults, each key deep (one moment's own keys over its default).
      - `birthday` object
        - `on` boolean, required: The moment's switch.
        - `do` 'send_message' | 'add_to_workflow', required: While on: a message (the template, sent as the person's connected sender profile) or the workflow the person enters.
        - `template` string, nullable, required: The message, in the workflow template grammar ({{people.first_name}}).
        - `workflow_sid` string, nullable, required: wf_wf_…: the workflow, when the Do is a workflow.
      - `work_anniversary` object
        - `on` boolean, required: The moment's switch.
        - `do` 'send_message' | 'add_to_workflow', required: While on: a message (the template, sent as the person's connected sender profile) or the workflow the person enters.
        - `template` string, nullable, required: The message, in the workflow template grammar ({{people.first_name}}).
        - `workflow_sid` string, nullable, required: wf_wf_…: the workflow, when the Do is a workflow.
      - `job_change` object
        - `on` boolean, required: The moment's switch.
        - `do` 'send_message' | 'add_to_workflow', required: While on: a message (the template, sent as the person's connected sender profile) or the workflow the person enters.
        - `template` string, nullable, required: The message, in the workflow template grammar ({{people.first_name}}).
        - `workflow_sid` string, nullable, required: wf_wf_…: the workflow, when the Do is a workflow.
    - `do` string: on_job_change: pause_and_ask | remove_from_workflows | move_to_workflow; on_website_visit: pause_and_ask | add_to_workflow.
    - `like` object
      - `on` boolean, required
      - `reaction` 'ai' | 'like' | 'celebrate' | 'support' | 'love' | 'insightful' | 'funny', required: ai = the AI reads the post and picks one of the six; else always this one. One reaction a post, never changed later.
    - `comment` object
      - `on` boolean, required
      - `brief` string, nullable, required: What the AI writes the comment from; required while on.
    - `per_person_weekly_cap` integer
    - `sender_profile_sid` string, nullable: engage_posts: who acts on a person connected to no sender profile.
    - `pages` string[], nullable
  - `watch` object, nullable: What the play keeps refreshed; absent on a playbook play = the entry's; a cadence outside the product's own is 422; null = nothing.
    - `profile_days` union: The LinkedIn profile every N days: 7 | 14 | 30 | 90; null = not watched.
      - 7
      - 14
      - 30
      - 90
      - unknown
    - `company_days` union: The company page every N days: 30 | 90; null = not watched.
      - 30
      - 90
      - unknown
    - `posts_days` union: The person's posts every N days: 1 | 3 | 7; null = not watched.
      - 1
      - 3
      - 7
      - unknown
    - `moments` boolean: The network's moments (birthdays, work anniversaries, job changes) through the sender profiles' catch-up feed, daily, free.
  - `mode` 'ask_me' | 'automatic': ask_me | automatic; absent on a playbook play = the entry's (ask me for the plays that act).
  - `audience` unknown
  - `cadence` 'manual' | 'daily': Default manual.
  - `enabled` boolean: daily only: true is the consent, stated with the estimate; the first run follows within the minute. 422 on a manual play.
  - `daily_credit_limit` integer, nullable: find_people only: what one day may spend. 422 on an add_to_workflow play.

## Response `200`

`create` success envelope.

- CreatePlayResponse
  - `success` true, required
  - `operation` 'create', required
  - `item` object, required
    - `sid` string, required: Play sid (pt_pl_…).
    - `team_sid` string, required: Owning team (ts_tm_…).
    - `playtable_sid` string, required: The table the play lives in (pt_tb_…): its tab, and the scope of its audience.
    - `catalog_key` 'keep_fresh' | 'congratulate' | 'on_job_change' | 'engage_posts' | 'on_website_visit' | 'find_people_empty' | 'top_up_thin' | 'top_up_silent' | 'top_up_no_reply' | 'top_up_exhausted' | 'find_decision_maker' | 'reengage_dormant' | 'reach_untouched', nullable, required: The playbook entry the row was born from; null = a play saved from a view's filter.
    - `name` string, required: The play's name, 1..255.
    - `object_type` 'people' | 'company', required: What the audience selects: people, or company (accounts).
    - `action_type` 'find_people' | 'add_to_workflow' | 'refresh' | 'congratulate' | 'on_job_change' | 'engage_posts' | 'on_website_visit', required: find_people (a company audience); every other kind runs on a people audience: add_to_workflow, refresh (Keep data fresh), congratulate, on_job_change, engage_posts, on_website_visit.
    - `action` union, required: The action's parameters, the shape of its action_type: the sids of the sources a find_people or add_to_workflow play owns; the moments of a congratulate play; the Do of on_job_change and on_website_visit; the like, the comment and the weekly cap of engage_posts; {} for refresh.
      - object
        - `prompt` string, nullable, required: Who to find at each account ("owner, founder, VP and up"); planned once into a Sales Navigator filter by the play's source. null = everyone the page gives.
        - `per_company_limit` integer, nullable, required: People taken per account, 1..25; null = the whole first page.
        - `data_source_sid` string, nullable, required: The play's own find_people source (ds_sc_…), born at the first run that had accounts; its queue and funnel are read with get_data_source. null until then.
      - object
        - `workflow_sid` string, nullable, required: The workflow the audience enters (wf_wf_…); null while the play waits for one (picked once, with update_play), and fixed from then on.
        - `workflow_source_sid` string, nullable, required: The play's own manual source in that workflow (wf_sr_…), born when the workflow is picked; its entry counters are read with search_workflow_sources.
      - object
        - `moments` object, required: A switch per moment with its own Do under it; a kind absent is off.
          - `birthday` object
            - `on` boolean, required: The moment's switch.
            - `do` 'send_message' | 'add_to_workflow', required: While on: a message (the template, sent as the person's connected sender profile) or the workflow the person enters.
            - `template` string, nullable, required: The message, in the workflow template grammar ({{people.first_name}}).
            - `workflow_sid` string, nullable, required: wf_wf_…: the workflow, when the Do is a workflow.
          - `work_anniversary` object
            - `on` boolean, required: The moment's switch.
            - `do` 'send_message' | 'add_to_workflow', required: While on: a message (the template, sent as the person's connected sender profile) or the workflow the person enters.
            - `template` string, nullable, required: The message, in the workflow template grammar ({{people.first_name}}).
            - `workflow_sid` string, nullable, required: wf_wf_…: the workflow, when the Do is a workflow.
          - `job_change` object
            - `on` boolean, required: The moment's switch.
            - `do` 'send_message' | 'add_to_workflow', required: While on: a message (the template, sent as the person's connected sender profile) or the workflow the person enters.
            - `template` string, nullable, required: The message, in the workflow template grammar ({{people.first_name}}).
            - `workflow_sid` string, nullable, required: wf_wf_…: the workflow, when the Do is a workflow.
      - object
        - `do` 'pause_and_ask' | 'remove_from_workflows' | 'move_to_workflow', required: For a person in a workflow whose title or company moved.
        - `workflow_sid` string, nullable, required: wf_wf_…: where move_to_workflow moves the person (required then).
      - object
        - `like` object, required
          - `on` boolean, required
          - `reaction` 'ai' | 'like' | 'celebrate' | 'support' | 'love' | 'insightful' | 'funny', required: ai = the AI reads the post and picks one of the six; else always this one. One reaction a post, never changed later.
        - `comment` object, required
          - `on` boolean, required
          - `brief` string, nullable, required: What the AI writes the comment from; required while on.
        - `per_person_weekly_cap` integer, required: At most this many acts a week per person.
        - `sender_profile_sid` string, nullable, required: ub_sp_…: who acts on a person connected to no sender profile (the connected one acts otherwise; the social workspace is the team's); null = the team's first that can.
      - object
        - `do` 'pause_and_ask' | 'add_to_workflow', required: On a visit of a key page or a form: pause the journey and ask, or the workflow named.
        - `workflow_sid` string, nullable, required: wf_wf_…: required when the Do is a workflow.
        - `pages` string[], nullable, required: Path prefixes of the team's site (/pricing) that count; null = every visit the snippet reports.
      - object: Keep data fresh acts on nothing: the refresh of what it watches is the deed.
    - `audience` unknown
    - `watch` object, nullable, required: What the play keeps refreshed and how often; null = nothing (2026-10-13).
      - `profile_days` union, required: The LinkedIn profile every N days: 7 | 14 | 30 | 90; null = not watched.
        - 7
        - 14
        - 30
        - 90
        - unknown
      - `company_days` union, required: The company page every N days: 30 | 90; null = not watched.
        - 30
        - 90
        - unknown
      - `posts_days` union, required: The person's posts every N days: 1 | 3 | 7; null = not watched.
        - 1
        - 3
        - 7
        - unknown
      - `moments` boolean, required: The network's moments (birthdays, work anniversaries, job changes) through the sender profiles' catch-up feed, daily, free.
    - `cadence` 'manual' | 'daily', required: manual: runs on run_play; daily: runs by itself every day while enabled.
    - `mode` 'ask_me' | 'automatic', required: ask_me: the act waits for approval as a task in the Signals feed; automatic: it goes out by itself. The plays that act are born asking (2026-10-13).
    - `enabled` boolean, required: The switch of a daily play; a manual play is always false.
    - `enabled_by` object, nullable, required: Who gave the consent (switched the play on).
      - `actor_type` 'user' | 'support' | 'api_key' | 'system' | 'agent', required
      - `actor_sid` string, nullable, required
      - `team_sid` string, required
      - `actor_name` string, nullable: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
      - `oauth_client_sid` string, nullable: The acting OAuth client (id_oc_*); null off the OAuth path.
      - `reason` string, nullable: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
      - `permissions` object, required: Internal audit context: the grant set the actor held at write time. Not a contract.
      - `cluster_id` integer, nullable: Internal audit context: the cluster that served the write.
      - `trace_id` string, nullable: Internal audit context: the trace id of the request that wrote the row.
    - `enabled_at` string, nullable, required: ISO 8601 UTC: when.
    - `daily_credit_limit` integer, nullable, required: The plays that spend (find_people, and a watching play's reads): the credits one day may spend; null = no ceiling (the queue's room and the 500-row cap still bound a run). 422 on add_to_workflow.
    - `last_run_at` string, nullable, required: ISO 8601 UTC.
    - `last_run_counts` object, nullable, required: What the last run did; null before the first run.
      - `matched` integer, required: Rows the audience matched at the run (the tab's count under the filter).
      - `acted` integer, required: Accounts appended to the queue, or people entered or re-entered.
      - `skipped` integer, required: Left alone: already queued or searched, in flight, held at the door, past the ceiling or the 500-row cap.
      - `credits` integer, required: What the run committed: the walk's estimate for the accounts appended (one credit per account); 0 for an add_to_workflow play.
    - `next_run_at` string, nullable, required: ISO 8601 UTC: when the daily sweep runs it next; null on a manual or switched-off play.
    - `created_by` object, required
      - `actor_type` 'user' | 'support' | 'api_key' | 'system' | 'agent', required
      - `actor_sid` string, nullable, required
      - `team_sid` string, required
      - `actor_name` string, nullable: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
      - `oauth_client_sid` string, nullable: The acting OAuth client (id_oc_*); null off the OAuth path.
      - `reason` string, nullable: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
      - `permissions` object, required: Internal audit context: the grant set the actor held at write time. Not a contract.
      - `cluster_id` integer, nullable: Internal audit context: the cluster that served the write.
      - `trace_id` string, nullable: Internal audit context: the trace id of the request that wrote the row.
    - `deleted_by` object, nullable, required
      - `actor_type` 'user' | 'support' | 'api_key' | 'system' | 'agent', required
      - `actor_sid` string, nullable, required
      - `team_sid` string, required
      - `actor_name` string, nullable: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
      - `oauth_client_sid` string, nullable: The acting OAuth client (id_oc_*); null off the OAuth path.
      - `reason` string, nullable: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
      - `permissions` object, required: Internal audit context: the grant set the actor held at write time. Not a contract.
      - `cluster_id` integer, nullable: Internal audit context: the cluster that served the write.
      - `trace_id` string, nullable: Internal audit context: the trace id of the request that wrote the row.
    - `created_at` string, required: ISO 8601 UTC.
    - `updated_at` string, required: ISO 8601 UTC.
    - `deleted_at` string, nullable, required: ISO 8601 UTC; null = live.
  - `already_exists` boolean, required
  - `meta` object, required
    - `trace_id` string, required: UUID v7; same 128-bit value as the X-Trace-Id header.
    - `span_id` string, required: 16 hex chars, root span of this request.
    - `timestamp` string, required: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
    - `duration_ms` integer, required: Server-side wall clock.
    - `team_sid` string, nullable: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
    - `actor_type` string, nullable: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.

## Other responses

- `4XX`: MCP error envelope. `error.code` is one of validation_failed, nothing_to_update, not_found, relation_not_found, invalid_transition, limit_exceeded, payment_required, duplicate_rejected, conflict, delete_blocked, unauthorized, forbidden, rate_limited, not_implemented.
- `5XX`: MCP error envelope with `error.code` internal_error or service_unavailable.

---

[API](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-playtables.md) - [All operations](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-playtables/llms.txt) - [OpenAPI document](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-playtables/revisions/aa394506515d?raw)
