# Spoki

Spoki is an Italian platform that integrates WhatsApp's official APIs to automate communication for marketing, sales, customer support, and payments.

- **Category:** marketing automation
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 57
- **Triggers:** 0
- **Slug:** `SPOKI`
- **Version:** 20260227_00

## Tools

### Add Contact Operator

**Slug:** `SPOKI_ADD_CONTACT_OPERATOR`

Tool to assign an operator to a contact's chat. Use this when you need to assign a team member to handle a specific contact's conversation. The operator must have been invited to the account first. Rate limited to 5 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | The contact ID to assign the operator to. This is the unique identifier of the contact in Spoki |
| `email` | string | Yes | Operator's email address. The operator must be invited to join the account first before being assigned to a contact. If the operator is not found, the API will return a 400 error |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Add Service User

**Slug:** `SPOKI_ADD_SERVICE_USER`

Adds a new service user with a specific role to your Spoki account. Use this when you need to create service accounts for automation, API integrations, or specialized operator roles. Rate limit: 10 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | Name of the service user to be created. This is a human-readable identifier for the service user |
| `role` | string | Yes | Role to assign to the service user. Common roles include 'Chat Operator', 'Admin', 'Agent', etc. The role must exist in your Spoki account |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Check Role Private Key

**Slug:** `SPOKI_CHECK_ROLE_PRIVATE_KEY`

Tool to check if a service user role has a private key configured. Use when you need to verify key status for a role. Rate limit: 10 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `role_id` | integer | Yes | The unique identifier of the role to check for private key |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Clone Template

**Slug:** `SPOKI_CLONE_TEMPLATE`

Tool to create a duplicate copy of an existing template. Clone starts in DRAFT status. Use when you need to duplicate a template by ID.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `template_id` | integer | Yes | The template ID to clone |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Account Onboarding Link

**Slug:** `SPOKI_CREATE_ACCOUNT_ONBOARDING_LINK`

Tool to create an onboarding link for a specific Spoki account. Use when you need to generate a setup link to help users configure their account.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `account_id` | integer | Yes | The unique identifier of the Spoki account to create an onboarding link for. Must be a valid account ID accessible to the authenticated user. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Custom Field

**Slug:** `SPOKI_CREATE_CUSTOM_FIELD`

Creates a new custom field in Spoki for storing additional contact data. Use this action when you need to define extra data points that can be stored on contacts beyond the standard fields. Custom fields are useful for tracking business-specific information like customer IDs, preferences, subscription dates, or any other structured data. The custom field will be available for use immediately after creation across contact management, automation workflows, and API operations. Ensure the label and code are unique and descriptive for easy identification and usage.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `code` | string | Yes | Programmatic identifier for the custom field. Must be uppercase with underscores, unique across all custom fields, and not use reserved keywords. Use this code when referencing the field in API calls. |
| `label` | string | Yes | Human-readable label for the custom field. Must be uppercase, unique across all custom fields, and not use reserved keywords. This label will be visible in the Spoki UI. |
| `example` | string | Yes | Example or default value for the custom field. Should match the field_type: plain text for TEXT, date format 'YYYY-MM-DD' for DATE, datetime format 'YYYY-MM-DD HH:MM:SS' for DATETIME. |
| `field_type` | integer ("1" | "2" | "3") | Yes | Data type for the custom field. 1 = TEXT (string values), 2 = DATE (date-only values like '2024-01-15'), 3 = DATETIME (date and time values like '2024-01-15 10:30:00'). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Contact List

**Slug:** `SPOKI_CREATE_LIST`

Creates a new contact list in Spoki for organizing and managing contacts. Use this action when you need to create a new list for grouping contacts by campaigns, segments, or any other organizational criteria. Lists are essential for targeted messaging, automation workflows, and campaign management. Rate limit: 10 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | Name of the contact list to create. This should be a descriptive name that helps identify the purpose or contents of the list (e.g., 'Newsletter Subscribers', 'VIP Customers', 'Marketing Campaign Q1 2024'). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Media File

**Slug:** `SPOKI_CREATE_MEDIA`

Tool to create a new media file entry in Spoki. Use when you need to register external media files (images, videos, documents) that can be used in campaigns, messages, or other Spoki features. Rate limit: 120 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `title` | string | Yes | Title or name of the media file. This will be used to identify the media in the Spoki interface |
| `format_type` | string | Yes | Format type of the media file. Common values include 'image', 'video', 'audio', or 'document' |
| `content_type` | string | Yes | MIME type of the media file. Must match the actual file type (e.g., 'image/jpeg', 'image/png', 'video/mp4', 'application/pdf') |
| `external_url` | string | Yes | External URL where the media file is hosted. Must be a valid, publicly accessible URL (e.g., 'https://example.com/image.jpg') |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create or Update Contact

**Slug:** `SPOKI_CREATE_OR_UPDATE_CONTACT`

Creates a new contact or updates an existing contact in Spoki using the phone number as the unique identifier. This action performs an "upsert" operation: - If a contact with the provided phone number exists, it will be updated with the new information - If no contact exists with that phone number, a new contact will be created Use this when you need to: - Add new contacts to your Spoki account - Update existing contact information (name, email, language, custom fields) - Ensure contact records are synchronized with external systems The phone number must be in E.164 format (international format with country code).

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `email` | string | No | Email address of the contact. Must be a valid email format |
| `phone` | string | Yes | Contact phone number in E.164 international format (must include country code with + prefix). Examples: '+393331234567' (Italy), '+14155552671' (USA), '+447700900123' (UK) |
| `language` | string | No | ISO 639-1 two-letter language code for the contact's preferred language. Common values: 'en' (English), 'it' (Italian), 'es' (Spanish), 'de' (German), 'pt' (Portuguese), 'fr' (French). Defaults to 'en' if not specified |
| `last_name` | string | No | Last name of the contact. Supports Unicode characters and special characters like hyphens and apostrophes (e.g., 'O'Brien-Müller') |
| `first_name` | string | No | First name of the contact. Supports Unicode characters for international names (e.g., 'François', 'María', 'João') |
| `custom_fields` | object | No | Dictionary of custom field names and their values. Use this to store additional contact information beyond standard fields (e.g., {'company': 'Acme Corp', 'employee_id': 'EMP-12345'}) |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Template

**Slug:** `SPOKI_CREATE_TEMPLATE`

Creates a new WhatsApp message template with localizations, buttons, and media headers. Use when you need to define a reusable template for marketing campaigns, transactional notifications, or authentication messages. Templates must be approved by WhatsApp before use (created in DRAFT status). Rate limit: 10 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | Internal template name/identifier. Must be unique, lowercase with underscores (e.g., 'promo_summer_2024'). This is not shown to end users |
| `category` | string ("MARKETING" | "ACCOUNT_UPDATE" | "PAYMENT_UPDATE" | "PERSONAL_FINANCE_UPDATE" | "SHIPPING_UPDATE" | "RESERVATION_UPDATE" | "ISSUE_RESOLUTION" | "APPOINTMENT_UPDATE" | "TRANSPORTATION_UPDATE" | "TICKET_UPDATE" | "ALERT_UPDATE" | "AUTO_REPLY") | Yes | Template category: MARKETING for promotional content, or specific utility categories like ACCOUNT_UPDATE, PAYMENT_UPDATE, SHIPPING_UPDATE, APPOINTMENT_UPDATE, etc. for transactional messages |
| `subcategory` | string | No | Optional template subcategory for additional classification |
| `templatelocalization_set` | array | Yes | Array of localizations - at least one required. Each localization defines the template content for a specific language |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Ticket

**Slug:** `SPOKI_CREATE_TICKET`

Tool to create a new support ticket in Spoki. Use when you need to create a ticket for tracking customer support issues or requests. Rate limit: 120 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `title` | string | Yes | Title of the ticket. Should be a concise summary of the support issue or request |
| `status` | string | Yes | Current status of the ticket. Common values: 'Open', 'Closed', 'In Progress', 'Pending' |
| `priority` | string ("Highest" | "High" | "Medium" | "Low" | "Lowest") | Yes | Priority level of the ticket. Accepted values: Highest, High, Medium, Low, Lowest |
| `reference` | string | No | External reference or ticket ID from another system for tracking purposes |
| `description` | string | No | Detailed description of the ticket. Provide additional context and information about the support issue or request |
| `contact_phone` | string | Yes | Contact phone number in E.164 international format (must include country code with + prefix). Examples: '+1234567890', '+393331234567' |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete contact

**Slug:** `SPOKI_DELETE_CONTACT`

Tool to delete a specific contact. Use after confirming the contact ID. Example prompt: "Delete contact with ID 1091234."

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | integer | Yes | ID of the contact to delete |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete Custom Field

**Slug:** `SPOKI_DELETE_CUSTOM_FIELD`

Tool to delete a specific custom field. Cannot delete if the custom field is used in automations. Rate limit: 5 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | integer | Yes | ID of the custom field to delete |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete list

**Slug:** `SPOKI_DELETE_LIST`

Tool to delete a specific list. Use after confirming the list ID. Rate limit: 5 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | integer | Yes | ID of the list to delete |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete media file

**Slug:** `SPOKI_DELETE_MEDIA`

Tool to delete a specific media file. Use after confirming the media ID. Rate limit: 60 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | ID of the media file to delete |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete role

**Slug:** `SPOKI_DELETE_ROLE`

Tool to delete a specific role. Use after confirming the role ID. Cannot delete the sole admin role. Rate limit: 5 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | ID of the role to delete. Cannot delete the sole admin role. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete template

**Slug:** `SPOKI_DELETE_TEMPLATE`

Tool to delete a WhatsApp template. Use force_delete=true for templates used in automations. Rate limit: 10/min.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | integer | Yes | ID of the template to delete |
| `force_delete` | boolean | No | Set to true to force delete templates that are used in automations. Default is false. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete ticket

**Slug:** `SPOKI_DELETE_TICKET`

Tool to delete a specific ticket. Use after confirming the ticket ID. Rate limit: 60 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | integer | Yes | ID of the ticket to delete |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Generate Role Private Key

**Slug:** `SPOKI_GENERATE_ROLE_PRIVATE_KEY`

Tool to generate a private key for a service user role. Use when you need to create API credentials for service users. Rate limit: 10 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | The role ID for which to generate a private key |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Account Current Report

**Slug:** `SPOKI_GET_ACCOUNT_CURRENT_REPORT`

Tool to get the current report for a specified account. Use when you need up-to-date metrics on messages and conversations for an account. Note: result is cached for 30 minutes.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `account_id` | integer | Yes | ID of the account to retrieve the current report for |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Accounts

**Slug:** `SPOKI_LIST_ACCOUNTS`

Tool to retrieve a list of Spoki WhatsApp Business accounts with their details. Use when you need to view all accounts accessible to the authenticated user, including their credit balances, status, and language settings. Note: This endpoint has a rate limit of 5 requests per minute.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Agencies

**Slug:** `SPOKI_LIST_AGENCIES`

Tool to list all agencies accessible to the user. Use when you need to retrieve all agencies for the authenticated account.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Automations

**Slug:** `SPOKI_LIST_AUTOMATIONS`

Tool to list, search, and filter automations. Use after authenticating to retrieve available automations and apply optional search or platform filters.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `search` | string | No | Search automations by name or webhook link |
| `is_active` | boolean | No | Filter by active (true) or inactive (false) automations |
| `webhook_platform` | string ("Api" | "Active Campaign" | "Woocommerce" | "Magento" | "Prestashop" | "Shopify" | "Zapier" | "Qapla'" | "BrainLead" | "HubSpot" | "Klaviyo" | "Zoho" | "Sendinblue" | "WPNotif" | "Connectif" | "IFTTT" | "Pipedrive" | "Meta" | "Zendesk") | No | Filter automations by webhook integration platform |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List campaigns

**Slug:** `SPOKI_LIST_CAMPAIGNS`

Tool to list, search, and filter campaigns. Use when you need to retrieve campaigns optionally filtered by scheduled datetime.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `scheduled_datetime_gte` | string | No | Only include campaigns scheduled on or after this timestamp (ISO 8601). |
| `scheduled_datetime_lte` | string | No | Only include campaigns scheduled on or before this timestamp (ISO 8601). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Contacts

**Slug:** `SPOKI_LIST_CONTACTS`

Tool to list, search, and filter contacts. Use when you need to retrieve contacts with optional search and filters.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `tag` | integer | No | Filter by tag ID |
| `email` | string | No | Filter by email (exact match) |
| `phone` | string | No | Filter by phone (exact match) |
| `search` | string | No | Search query for phone, email, first_name, last_name, language, or notes |
| `language` | string | No | Filter by language code |
| `last_name` | string | No | Filter by last name |
| `first_name` | string | No | Filter by first name |
| `is_blocked` | boolean | No | Filter blocked contacts only when true |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Custom Fields

**Slug:** `SPOKI_LIST_CUSTOM_FIELDS`

Tool to list, search, and filter custom fields. Use when you need to fetch available custom-field definitions by label or code.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `code` | string | No | Filter custom fields whose code contains this string |
| `label` | string | No | Filter custom fields whose label contains this string |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Lists

**Slug:** `SPOKI_LIST_LISTS`

Tool to list, search, and filter contact lists. Use when you need to retrieve all lists or find specific lists by name. Rate limit: 5 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `search` | string | No | Search query to filter lists by name |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List media

**Slug:** `SPOKI_LIST_MEDIA`

Tool to list media files. Returns all media files with their details including title, content type, format, and URLs. Use when you need to retrieve or browse available media files in the account.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Partners

**Slug:** `SPOKI_LIST_PARTNERS`

List all partners accessible to the authenticated account. Partners represent business partners or affiliates associated with your Spoki account.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Reports

**Slug:** `SPOKI_LIST_REPORTS`

Tool to list, search, and filter usage reports. Use when you need to retrieve historical usage metrics with optional filters. Note: results are cached for 30 minutes.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `account` | integer | No | Filter reports by account ID |
| `granularity` | string | No | Filter by reporting period granularity (e.g., 'Month', 'Day') |
| `period_start` | string | No | Filter reports by period start date (YYYY-MM-DD format) |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Roles

**Slug:** `SPOKI_LIST_ROLES`

Tool to list user roles in the system. Use when you need to retrieve all role assignments for users in the account.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List tags

**Slug:** `SPOKI_LIST_TAGS`

Lists all tags in the account. Returns tag details including id, name, color, and order. Use this when you need to view all available tags or find a specific tag by name.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List templates

**Slug:** `SPOKI_LIST_TEMPLATES`

Tool to list, search, and filter WhatsApp templates. Use when you need to retrieve available templates, optionally filtering by keywords.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `search` | string | No | Search term to filter templates by id, name, or text |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Tickets

**Slug:** `SPOKI_LIST_TICKETS`

Tool to list, search, and filter tickets. Use when you need to retrieve tickets with optional pagination and filters.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `page` | integer | No | Page number for pagination, must be >= 1. |
| `order` | string ("asc" | "desc") | No | Order of sorting: 'asc' or 'desc'. |
| `sort_by` | string | No | Field to sort by, e.g., created_datetime. |
| `per_page` | integer | No | Number of tickets per page, must be >= 1. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Remove All List Contacts

**Slug:** `SPOKI_REMOVE_ALL_LIST_CONTACTS`

Tool to remove all contacts from a list. Use when you need to clear all contacts from a specific list. Rate limit: 5 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | integer | Yes | The list ID from which to remove all contacts |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Remove Contact Operator

**Slug:** `SPOKI_REMOVE_CONTACT_OPERATOR`

Tool to remove an operator from a contact's chat. Use when you need to unassign an operator from handling a specific contact's conversations. Rate limit: 5 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | The contact ID from which to remove the operator |
| `email` | string | Yes | Operator's email address to be removed from the contact's chat. This must be the email of a service user or operator in your Spoki account |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Remove Contacts from List

**Slug:** `SPOKI_REMOVE_LIST_CONTACTS`

Tool to remove specific contacts from a list. Use when you need to unsubscribe or remove multiple contacts from a particular list. Rate limit: 5 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `list_id` | integer | Yes | The ID of the list from which contacts should be removed |
| `contacts` | array | Yes | Array of contact IDs to remove from the list. Each ID must be a valid contact identifier |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Resend Invitation

**Slug:** `SPOKI_RESEND_INVITATION`

Tool to resend an invitation email. Use when you need to resend an existing invitation. Rate limit: 5 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | integer | Yes | The invitation ID to resend |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Retrieve Account

**Slug:** `SPOKI_RETRIEVE_ACCOUNT`

Retrieves detailed information about a specific Spoki WhatsApp Business account. Returns comprehensive account details including credit balance, verification status, messaging limits, quality metrics, timezone settings, and Facebook integration configuration. Use this action when you need to check account status, credit levels, or configuration details. Note: You must have access permissions for the specified account ID.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `account_id` | integer | Yes | The unique identifier of the Spoki account to retrieve. Must be a valid account ID accessible to the authenticated user. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Retrieve Automation

**Slug:** `SPOKI_RETRIEVE_AUTOMATION`

Tool to retrieve details of a specific automation. Use when you need name, first message, webhooks and timestamps of an existing automation.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | integer | Yes | ID of the automation to retrieve |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Retrieve Contact

**Slug:** `SPOKI_RETRIEVE_CONTACT`

Tool to retrieve details of a specific contact. Use when you have a contact ID and need full profile details.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `contact_id` | integer | Yes | Unique identifier of the contact to retrieve |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Retrieve Custom Field

**Slug:** `SPOKI_RETRIEVE_CUSTOM_FIELD`

Tool to retrieve details of a specific custom field. Use when you have a field ID and need its metadata before using it in automations.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `custom_field_id` | integer | Yes | The unique identifier of the custom field to retrieve |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Retrieve List

**Slug:** `SPOKI_RETRIEVE_LIST`

Tool to retrieve details of a specific list by ID. Use when you need list metadata and contact count. Rate limit: 5 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `list_id` | integer | Yes | Unique identifier of the list to retrieve |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Retrieve Media

**Slug:** `SPOKI_RETRIEVE_MEDIA`

Tool to retrieve details of a specific media file by ID. Use when you need media file metadata.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | Unique identifier of the media file to retrieve |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Retrieve Role

**Slug:** `SPOKI_RETRIEVE_ROLE`

Tool to retrieve details of a specific role by ID. Use when you need role information for a given role ID. Rate limit: 5 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | ID of the role to retrieve |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Retrieve Tag

**Slug:** `SPOKI_RETRIEVE_TAG`

Tool to retrieve details of a specific tag. Use when you need tag metadata by ID.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | integer | Yes | ID of the tag to retrieve |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Retrieve Template

**Slug:** `SPOKI_RETRIEVE_TEMPLATE`

Tool to retrieve details of a specific template. Use after obtaining a template ID.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `template_id` | integer | Yes | Unique identifier of the template to retrieve |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Revert Template to Draft

**Slug:** `SPOKI_REVERT_TEMPLATE_TO_DRAFT`

Tool to revert a WhatsApp template back to DRAFT status, removing it from WhatsApp. Use when you need to unpublish a template and return it to draft mode for editing.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `template_id` | integer | Yes | Unique identifier of the template to revert to DRAFT status |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Bulk Sync Contacts

**Slug:** `SPOKI_SYNC_CONTACTS_BULK`

Tool to bulk sync (create or update) multiple contacts in a single request. Rate limit: 1 request per minute. This action performs bulk "upsert" operations: - If a contact with the provided phone number exists, it will be updated with the new information - If no contact exists with that phone number, a new contact will be created Use when you need to: - Import multiple contacts from external systems - Synchronize contact lists in bulk - Efficiently create or update many contacts at once IMPORTANT: Do not use this action to update contacts before initiating an automation. The strict rate limit (1/min) makes it unsuitable for automation workflows.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `contacts` | array | Yes | List of contact objects to sync. Each contact will be created if new or updated if the phone number already exists. Maximum recommended: 100 contacts per request due to rate limits |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Sync Contacts to List

**Slug:** `SPOKI_SYNC_LIST_CONTACTS`

Tool to create or update contacts and add them to a specific list in Spoki. Rate limit: 1 request per minute. This action performs bulk "upsert" operations and list assignment: - If a contact with the provided phone number exists, it will be updated with the new information - If no contact exists with that phone number, a new contact will be created - All synced contacts are automatically added to the specified list Use when you need to: - Add multiple contacts to a specific list - Import contacts from external systems directly into a list - Synchronize contact lists with list membership Maximum 500 contacts per request. Phone numbers must be in E.164 format (international format with country code).

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `list_id` | string | Yes | The unique identifier of the list to sync contacts to. Contacts will be created or updated and then added to this list |
| `contacts` | array | Yes | List of contact objects to sync to the list. Each contact will be created if new or updated if the phone number already exists, then added to the specified list. Maximum: 500 contacts per request |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Campaign

**Slug:** `SPOKI_UPDATE_CAMPAIGN`

Tool to update an existing campaign's name, status, or scheduled time. Use when you need to modify campaign details after creation. Rate limited to 5 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | The unique identifier of the campaign to update |
| `name` | string | No | New name for the campaign |
| `status` | string ("Draft" | "Scheduled") | No | Allowed campaign status values. |
| `scheduled_datetime` | string | No | Scheduled start time in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.sssZ). Required when status is 'Scheduled' |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Contact

**Slug:** `SPOKI_UPDATE_CONTACT`

Tool to update an existing contact in Spoki. Use when you need to modify contact information for a specific contact ID. Only the fields provided will be updated; other fields remain unchanged.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | Unique identifier of the contact to update. This is the contact ID returned when creating or listing contacts |
| `email` | string | No | Email address of the contact. Must be a valid email format |
| `phone` | string | No | Contact phone number in E.164 international format (must include country code with + prefix). Examples: '+393331234567' (Italy), '+14155552671' (USA), '+447700900123' (UK) |
| `language` | string | No | ISO 639-1 two-letter language code for the contact's preferred language. Common values: 'en' (English), 'it' (Italian), 'es' (Spanish), 'de' (German), 'pt' (Portuguese), 'fr' (French) |
| `last_name` | string | No | Last name of the contact. Supports Unicode characters and special characters like hyphens and apostrophes (e.g., 'O'Brien-Müller') |
| `first_name` | string | No | First name of the contact. Supports Unicode characters for international names (e.g., 'François', 'María', 'João') |
| `custom_fields` | object | No | Dictionary of custom field names and their values. Use this to store additional contact information beyond standard fields (e.g., {'company': 'Acme Corp', 'employee_id': 'EMP-12345'}) |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Custom Field

**Slug:** `SPOKI_UPDATE_CUSTOM_FIELD`

Tool to update a specific custom field. Use after retrieving a field to change its label.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `label` | string | Yes | New display label of the custom field |
| `custom_field_id` | integer | Yes | Unique identifier of the custom field to update |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Invitation Role

**Slug:** `SPOKI_UPDATE_INVITATION_ROLE`

Tool to update the role of a pending invitation. Use when you need to change the role assigned to an existing invitation. Rate limit: 5 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | The invitation ID to update the role for |
| `role` | string | Yes | New role to assign to the invitation. Common roles include 'Administrator', 'Chat Operator', 'Admin', 'Agent', etc. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Media

**Slug:** `SPOKI_UPDATE_MEDIA`

Tool to update an existing media file in Spoki. Use when you need to modify media file details like title. Rate limit: 120 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | integer | Yes | Unique identifier of the media file to update |
| `title` | string | Yes | New title for the media file |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Role

**Slug:** `SPOKI_UPDATE_ROLE`

Tool to update a user's role. Use when you need to change a user's role assignment. Rate limit: 10 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | The role ID to update |
| `role` | string | Yes | New role name to assign to the user |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Template

**Slug:** `SPOKI_UPDATE_TEMPLATE`

Tool to update an existing WhatsApp template in Spoki. Use when you need to modify template name, category, subcategory, or localization details. Rate limit: 10 requests per minute.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | integer | Yes | Unique identifier of the template to update |
| `name` | string | No | New name for the template |
| `category` | string | No | Template category (e.g., 'ACCOUNT_UPDATE', 'MARKETING', 'UTILITY') |
| `subcategory` | string | No | Template subcategory for further classification |
| `templatelocalization_set` | array | No | Array of localizations to update for this template |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
