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

# Clone a version of a workflow



## OpenAPI

````yaml api-reference/generated.yaml post /v1/accounts/{accountId}/workflows/{workflowId}/versions
openapi: 3.1.0
info:
  description: >
    # Introduction


    Welcome to the documentation for the Sakari Messaging REST API. 


    Sakari provides an advanced platform to drive large scale customized SMS
    communication


    REST is a web-service protocol that lends itself to rapid development by
    using everyday HTTP and JSON technology.


    To find out more about our product offering, please visit
    [https://sakari.io](https://sakari.io).


    # Quickstart


    For your convenience we have created a quickstart guide to get you up and
    running in 5 minutes. 


    [https://sakari.io/blog/text-messaging-sms-api-quickstart/](https://sakari.io/blog/text-messaging-sms-api-quickstart/)


    # PostMan Collection


    We've created a simple set of examples using
    [PostMan](https://www.getpostman.com/) Simply click below to import these.
    You will need to setup three environment variables in PostMan - AccountId,
    ClientId and ClientSecret. Check out our PostMan blog post for more
    information


    [![Run in
    Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/d616e273edc916a7a6eb)


    # Finding your client id, client secret and account id


    To authenticate against the API's you will need three key pieces of data
     - client id
     - client secret
     - account id

    To retrieve these, simply login into
    [https://hub.sakari.io](https://hub.sakari.io) and click on the "cog" in the
    top right corner. In the popup dialog at the bottom you should see your API
    credentials and account id. If these are not visible you will need to click
    on "Request Credentials"


    # Versioning


    With any breaking changes we will introduce a new version of the API. The
    latest version is v1.


    The API uses an open schema model, which means server may add extra
    properties to responses. Likewise, the server will ignore any extra query
    parameters and request body properties. When you write clients, you need to
    ignore additional properties in responses to ensure they do not break.


    # Testing


    There are numerous tools available for testing the API's. We will include
    examples using curl and the client SDKs that we have created. If you would
    like to see an SDK in a language not currently available, please let us
    know.


    # Throttling / Limits


    Our API's have been specifically designed to support bulk messaging in a
    single API call. We therefore impose limits on the frequency of calling the
    APIs to prevent abuse or runaway processes. If you feel you need a higher
    limit, please contact us. If you hit the limit you will get a 429 error code
    returned from our servers


    # Errors


    The API uses standard HTTP status codes to indicate the success or failure
    of the API call. The body of the response will be JSON in the following
    format:


    ```

    {
      "success": false,
      "error": {
        "code": "CONT-001",
        "message": "Invalid mobile number"
      }
    }

    ```


    # Pagination


    For performance, most GET calls return a subset of data. This data is
    paginated for easy access. Most APIs which return collections of data will
    return a pagination object as such:


    ```

    {
      "pagination": {
        "offset": 0,
        "limit": 10
      }  
    }

    ```


    When making calls to the API, you can adjust the slice of data returned
    using query parameters such as:


    `` https://api.sakari.io/v1/accounts/123/contacts?offset=20&limit=25 ``


    This will return 25 contacts with an offset of 20.
  version: 1.0.2
  title: Sakari
  termsOfService: https://sakari.io/terms-service.html
  contact:
    email: help@sakari.io
servers:
  - description: Sakari Production
    url: https://api.sakari.io
security: []
tags:
  - name: authentication
    description: >
      Sakari uses OAuth2 for authentication. After you have created an account
      at [https://hub.sakari.io](https://hub.sakari.io), you can retrieve your
      client id and secret from the 'Account Details' screen (click on the 'cog'
      icon in the top right corner and scroll down to API Credentials)


      Using your client id and secret, you can exchange these for a JWT ([JSON
      Web Token](https://en.wikipedia.org/wiki/JSON_Web_Token))


      The JWT should then be used when accessing any of the core API's. It
      should be passed in the `Authorization` header.


      For example:


      ``Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImt....``
  - name: accounts
    description: Create, modify or delete accounts
  - name: contacts
    description: Create, modify or delete contacts
  - name: integrations
    description: View existing integrations in your Sakari account
  - name: autoresponders
    description: Create, modify, or delete autoresponders
  - name: availablephonenumbers
    description: Check for available phone numbers
  - name: bulk
    description: Bulk actions for contacts and users
  - name: messages
    description: >-
      Send or track messages to one contact, a group of contacts or your entire
      address book
  - name: templates
    description: Define reusable message or web templates
  - name: campaigns
    description: >-
      Define reusable message campaigns with a predefined contact list/filter,
      template and schedule
  - name: conversations
    description: Conversations group your message history with each contact into one thread
  - name: tools
    description: >-
      Tools to assist with sending and receiving messages, such as file sharing,
      translation, etc.
  - name: webhooks
    description: >-
      Webhooks allow your own system to be automatically notified upon certin
      events, such as a new message received from one of your contacts or a
      status change notification for your messages
  - name: workflows
    description: Create, modify, and delete workflows
  - name: workflowtemplates
    description: Existing workflow templates that can be used
  - name: meetingevents
    description: Configure meeting events for your leads to book time with you
  - name: meetings
    description: Meetings with your contacts
externalDocs:
  description: Find out more about Sakari
  url: https://sakari.io
paths:
  /v1/accounts/{accountId}/workflows/{workflowId}/versions:
    post:
      tags:
        - workflows
      summary: Clone a version of a workflow
      operationId: workflows.versions.clone
      parameters:
        - $ref: '#/components/parameters/accountIdPath'
        - $ref: '#/components/parameters/workflowIdPath'
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/Workflow'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowVersionResponse'
        4XX:
          $ref: '#/components/responses/4XX'
        5XX:
          $ref: '#/components/responses/5XX'
      security:
        - sakari_auth: []
components:
  parameters:
    accountIdPath:
      name: accountId
      in: path
      description: Account to apply operations to
      required: true
      schema:
        type: string
    workflowIdPath:
      name: workflowId
      in: path
      description: Workflow to apply operations to
      required: true
      schema:
        type: string
  schemas:
    Workflow:
      type: object
      required:
        - id
        - name
        - account
        - created
        - updated
      properties:
        id:
          type: string
          readOnly: true
        name:
          type: string
        versions:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowVersion'
        created:
          $ref: '#/components/schemas/Updated'
        updated:
          $ref: '#/components/schemas/Updated'
    WorkflowVersionResponse:
      allOf:
        - $ref: '#/components/schemas/BasicResponse'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/WorkflowVersion'
          required:
            - data
    WorkflowVersion:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        definition:
          $ref: '#/components/schemas/WorkflowDefinition'
        readonly:
          type: boolean
        active:
          type: string
          format: date-time
        lastActive:
          type: string
          format: date-time
        created:
          $ref: '#/components/schemas/Updated'
        updated:
          $ref: '#/components/schemas/Updated'
      required:
        - id
        - version
        - definition
        - created
        - updated
    Updated:
      type: object
      properties:
        at:
          type: string
          format: date-time
        by:
          $ref: '#/components/schemas/UpdatedBy'
      readOnly: true
      required:
        - at
    BasicResponse:
      type: object
      properties:
        success:
          type: boolean
      required:
        - success
    ErrorResponse:
      allOf:
        - $ref: '#/components/schemas/BasicResponse'
        - type: object
          properties:
            error:
              $ref: '#/components/schemas/Error'
      required:
        - error
    WorkflowDefinition:
      type: object
      properties:
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowNode'
        edges:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowEdge'
        properties:
          $ref: '#/components/schemas/WorkflowProperties'
      required:
        - nodes
        - edges
    UpdatedBy:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          example: Joe Bloggs
        firstName:
          type: string
          example: Joe
        lastName:
          type: string
          example: Bloggs
        email:
          type: string
          example: joe@bloggs.com
        source:
          type: string
        subSource:
          type: string
    Error:
      type: object
      properties:
        code:
          type: string
          example: CONT-010
        description:
          type: string
          example: Contact has requested no further communication
      required:
        - code
        - description
    WorkflowNode:
      type: object
      properties:
        id:
          type: string
        type:
          $ref: '#/components/schemas/WorkflowNodeType'
        config:
          $ref: '#/components/schemas/WorkflowNodeConfig'
      required:
        - id
        - type
        - config
    WorkflowEdge:
      type: object
      properties:
        id:
          type: string
        type:
          $ref: '#/components/schemas/WorkflowEdgeType'
        source:
          type: string
        target:
          type: string
        value:
          anyOf:
            - type: string
            - type: boolean
            - type: number
      required:
        - source
        - id
        - type
    WorkflowProperties:
      type: array
      items:
        $ref: '#/components/schemas/WorkflowProperty'
    WorkflowNodeType:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        type:
          type: string
          readOnly: true
        group:
          type: string
          properties:
            id:
              type: string
              readOnly: true
            label:
              type: string
              readOnly: true
          readOnly: true
        name:
          type: string
          readOnly: true
        label:
          type: string
          readOnly: true
        description:
          type: string
          readOnly: true
        icon:
          type: string
          readOnly: true
        properties:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowNodeProperty'
          readOnly: true
        outputs:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowNodeTypeOutput'
          readOnly: true
        validation:
          $ref: '#/components/schemas/WorkflowNodeTypeValidation'
        supportsReenrollment:
          type: boolean
          readOnly: true
        color:
          type: string
          readOnly: true
        status:
          type: string
          readOnly: true
        supportLink:
          type: string
          readOnly: true
      required:
        - id
        - name
        - type
    WorkflowNodeConfig:
      type: object
      oneOf:
        - $ref: '#/components/schemas/MessageReceivedTriggerConfig'
        - $ref: '#/components/schemas/LinkClickedTriggerConfig'
        - $ref: '#/components/schemas/MessageStatusTriggerConfig'
        - $ref: '#/components/schemas/ListTriggerConfig'
        - $ref: '#/components/schemas/ContactCreatedTriggerConfig'
        - $ref: '#/components/schemas/ContactUpdatedTriggerConfig'
        - $ref: '#/components/schemas/FormSubmittedTriggerConfig'
        - $ref: '#/components/schemas/ListNodeConfig'
        - $ref: '#/components/schemas/ABTestNodeConfig'
        - $ref: '#/components/schemas/ChoiceNodeConfig'
        - $ref: '#/components/schemas/DelayNodeConfig'
        - $ref: '#/components/schemas/FilterNodeConfig'
        - $ref: '#/components/schemas/IfThenNodeConfig'
        - $ref: '#/components/schemas/IncrDecrementNodeConfig'
        - $ref: '#/components/schemas/SendMessageNodeConfig'
        - $ref: '#/components/schemas/SetWorkflowPropertyNodeConfig'
        - $ref: '#/components/schemas/UpdateContactNodeConfig'
        - $ref: '#/components/schemas/GoogleSheetsExportNodeConfig'
        - $ref: '#/components/schemas/GoogleSheetsLookupNodeConfig'
        - $ref: '#/components/schemas/LinkClickedNodeConfig'
        - $ref: '#/components/schemas/MessageReceivedNodeConfig'
    WorkflowEdgeType:
      type: string
      enum:
        - standard
        - timeout
        - error
    WorkflowProperty:
      type: object
      properties:
        name:
          type: string
        dataType:
          type: string
          enum:
            - string
            - number
            - boolean
            - date
        created:
          type: object
          properties:
            at:
              type: string
              format: date-time
      required:
        - name
        - dataType
    WorkflowNodeProperty:
      allOf:
        - $ref: '#/components/schemas/WorkflowNodePropertyBaseObject'
        - type: object
          properties:
            name:
              type: string
            conditions:
              type: array
              items:
                $ref: '#/components/schemas/WorkflowNodePropertyCondition'
          required:
            - name
    WorkflowNodeTypeOutput:
      type: object
      required:
        - path
        - name
        - dataType
      properties:
        default:
          type: boolean
        path:
          type: string
        name:
          type: string
        dataType:
          $ref: '#/components/schemas/WorkflowNodeTypeOutputDataType'
    WorkflowNodeTypeValidation:
      type: object
      properties:
        numEdgeCondition:
          $ref: '#/components/schemas/NumEdgeConditions'
        numEdges:
          type: number
        edges:
          type: array
          items:
            $ref: '#/components/schemas/EdgeValidation'
      readOnly: true
    MessageReceivedTriggerConfig:
      type: object
      properties:
        message:
          type: string
        groups:
          type: array
          items:
            $ref: '#/components/schemas/Group'
    LinkClickedTriggerConfig:
      type: object
      properties:
        link:
          $ref: '#/components/schemas/Link'
    MessageStatusTriggerConfig:
      type: object
      properties:
        status:
          type: string
          enum:
            - sent
            - error
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
    ListTriggerConfig:
      type: object
      properties:
        list:
          $ref: '#/components/schemas/List'
    ContactCreatedTriggerConfig:
      type: object
    ContactUpdatedTriggerConfig:
      type: object
      properties:
        condition:
          $ref: '#/components/schemas/WorkflowCondition'
    FormSubmittedTriggerConfig:
      type: object
      properties:
        form:
          $ref: '#/components/schemas/Form'
    ListNodeConfig:
      type: object
      properties:
        contact:
          $ref: '#/components/schemas/WorkflowDataReference'
        list:
          $ref: '#/components/schemas/List'
    ABTestNodeConfig:
      type: object
      properties:
        split:
          type: number
    ChoiceNodeConfig:
      type: object
      properties:
        property:
          $ref: '#/components/schemas/WorkflowDataReference'
      required:
        - property
    DelayNodeConfig:
      type: object
      properties:
        delay:
          $ref: '#/components/schemas/AdvancedDelay'
    FilterNodeConfig:
      type: object
      properties:
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowCondition'
    IfThenNodeConfig:
      type: object
      properties:
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowCondition'
    IncrDecrementNodeConfig:
      type: object
      properties:
        operation:
          type: string
          enum:
            - add
            - subtract
        property:
          type: string
        value:
          type: number
      required:
        - property
        - value
    SendMessageNodeConfig:
      type: object
      properties:
        from:
          type: object
          properties:
            type:
              type: string
              enum:
                - group
                - custom
            group:
              $ref: '#/components/schemas/Group'
            custom:
              type: string
          required:
            - type
        to:
          type: object
          properties:
            type:
              $ref: '#/components/schemas/SendMessageToType'
            mobile:
              $ref: '#/components/schemas/InternationalNumber'
            group:
              $ref: '#/components/schemas/Group'
            user:
              $ref: '#/components/schemas/User'
            contact:
              $ref: '#/components/schemas/WorkflowDataReference'
        message:
          type: object
          properties:
            message:
              type: string
            media:
              type: array
              description: List of media objects attached to message
              items:
                $ref: '#/components/schemas/Media'
    SetWorkflowPropertyNodeConfig:
      type: object
      properties:
        property:
          type: string
        value:
          anyOf:
            - type: string
            - type: number
      required:
        - property
        - value
    UpdateContactNodeConfig:
      type: object
      properties:
        contact:
          $ref: '#/components/schemas/WorkflowDataReference'
        updates:
          type: array
          items:
            $ref: '#/components/schemas/ContactUpdate'
    GoogleSheetsExportNodeConfig:
      type: object
      properties:
        googlesheet:
          $ref: '#/components/schemas/GoogleSheet'
        properties:
          type: array
          items:
            $ref: '#/components/schemas/GoogleSheetColumnMapping'
        userId:
          type: string
    GoogleSheetsLookupNodeConfig:
      type: object
      properties:
        googlesheet:
          $ref: '#/components/schemas/GoogleSheet'
        searchColumn:
          $ref: '#/components/schemas/GoogleSheetColumn'
        outputColumn:
          $ref: '#/components/schemas/GoogleSheetColumn'
        searchValue:
          type: string
        userId:
          type: string
    LinkClickedNodeConfig:
      type: object
      properties:
        link:
          $ref: '#/components/schemas/Link'
        timeout:
          $ref: '#/components/schemas/Delay'
    MessageReceivedNodeConfig:
      type: object
      properties:
        group:
          $ref: '#/components/schemas/Group'
        timeout:
          $ref: '#/components/schemas/Delay'
    WorkflowNodePropertyBaseObject:
      type: object
      properties:
        label:
          type: string
        helperText:
          type: string
        link:
          type: string
        type:
          $ref: '#/components/schemas/WorkflowNodePropertyType'
        mandatory:
          type: boolean
        args:
          type: array
          items:
            type: string
        options:
          type: array
          items:
            $ref: '#/components/schemas/SelectOption'
        min:
          type: number
        max:
          type: number
        defaultValue:
          anyOf:
            - type: string
            - type: boolean
            - type: number
            - type: object
      required:
        - type
    WorkflowNodePropertyCondition:
      type: object
      properties:
        property:
          type: string
        comparator:
          type: string
        value:
          type: string
      required:
        - property
        - comparator
        - value
    WorkflowNodeTypeOutputDataType:
      type: string
      enum:
        - boolean
        - call
        - contact
        - country
        - date
        - file
        - group
        - link
        - list
        - message
        - number
        - object
        - payload
        - phonenumber
        - string
        - tweet
    NumEdgeConditions:
      type: string
      enum:
        - exactly
        - at least
    EdgeValidation:
      type: object
      properties:
        type:
          type: string
          enum:
            - timeout
            - standard
            - error
        value:
          type: object
          properties:
            mandatory:
              type: boolean
            editable:
              type: boolean
            value:
              oneOf:
                - type: string
                - type: number
                - type: boolean
            default:
              oneOf:
                - type: string
                - type: number
                - type: boolean
        multiple:
          type: boolean
        defaultEdge:
          type: boolean
    Group:
      allOf:
        - $ref: '#/components/schemas/BasicGroup'
        - type: object
          properties:
            id:
              type: string
            name:
              type: string
            phoneNumbers?:
              type: array
              items:
                $ref: '#/components/schemas/PhoneNumber'
            notifications:
              type: array
              items:
                $ref: '#/components/schemas/GroupNotification'
            tags:
              type: array
              items:
                type: string
            users:
              type: array
              items:
                $ref: '#/components/schemas/User'
            senders:
              type: array
              items:
                $ref: '#/components/schemas/Sender'
            officeHours:
              $ref: '#/components/schemas/GroupOfficeHours'
            isDefault:
              type: boolean
            useSharedPool:
              type: boolean
    Link:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        name:
          type: string
        keyId:
          type: string
          readOnly: true
        domain:
          type: object
          readOnly: true
          properties:
            id:
              type: string
            name:
              type: string
        destinationUrl:
          type: string
        shortenedUrl:
          type: string
          readOnly: true
        contactTracking:
          type: boolean
        sourceTracking:
          type: boolean
        stats:
          type: object
          readOnly: true
          properties:
            totalClicks:
              type: number
            uniqueClicks:
              type: number
            ctr:
              type: number
        created:
          $ref: '#/components/schemas/Updated'
        updated:
          $ref: '#/components/schemas/Updated'
      required:
        - keyId
        - destinationUrl
        - shortenedUrl
    List:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        name:
          type: string
        source:
          type: object
          properties:
            id:
              type: string
            integration:
              type: string
            lastSynced:
              type: string
          required:
            - id
            - integration
        keyword:
          type: string
        doubleOptIn:
          type: object
          properties:
            enabled:
              type: boolean
            prompt:
              type: string
        filter:
          $ref: '#/components/schemas/ContactFilter'
        optInConfirmation:
          type: string
      required:
        - id
        - name
    WorkflowCondition:
      type: object
      properties:
        attribute:
          $ref: '#/components/schemas/WorkflowDataReference'
        comparator:
          type: string
        value:
          oneOf:
            - type: array
              items:
                type: string
            - type: array
              items:
                type: number
            - type: string
            - type: number
      required:
        - attribute
        - comparator
        - value
    Form:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        name:
          type: string
        active:
          type: string
          format: date-time
          readOnly: true
        impressions:
          type: number
          readOnly: true
        conversions:
          type: number
          readOnly: true
        created:
          $ref: '#/components/schemas/Updated'
          readOnly: true
        updated:
          $ref: '#/components/schemas/Updated'
          readOnly: true
      required:
        - id
        - name
        - impressions
        - conversions
    WorkflowDataReference:
      type: object
      properties:
        type:
          type: string
          enum:
            - workflow
            - output
            - contact
            - event
        nodeId:
          type: string
        name:
          type: string
        path:
          type: string
      required:
        - type
        - name
    AdvancedDelay:
      type: object
      properties:
        initialDelay:
          $ref: '#/components/schemas/Delay'
        additionalTime:
          type: object
          properties:
            timezone:
              type: string
            days:
              $ref: '#/components/schemas/AdvancedDelayDays'
            time:
              $ref: '#/components/schemas/AdvancedDelayTime'
    SendMessageToType:
      type: string
      enum:
        - contact
        - custom
        - group
        - user
    InternationalNumber:
      type: object
      properties:
        country:
          type: string
        number:
          type: string
          example: 123-456-7890
        verified:
          type: string
          format: date-time
        valid:
          type: boolean
        lineType:
          type: string
          example: mobile
      required:
        - country
        - number
    User:
      allOf:
        - $ref: '#/components/schemas/Person'
        - type: object
          properties:
            role:
              type: string
              enum:
                - Administrator
                - CampaignManager
                - Sender
                - ReadOnly
            tacAccepted:
              type: string
              format: date-time
      required:
        - id
        - email
        - role
    Media:
      type: object
      properties:
        url:
          type: string
        type:
          type: string
        name:
          type: string
        filename:
          type: string
    ContactUpdate:
      type: object
      properties:
        property:
          $ref: '#/components/schemas/Property'
        value:
          type: string
    GoogleSheet:
      type: object
      properties:
        connection:
          $ref: '#/components/schemas/UserIntegration'
        id:
          type: string
        name:
          type: string
        tabs:
          type: array
          items:
            $ref: '#/components/schemas/GoogleSheetTab'
        tab:
          $ref: '#/components/schemas/GoogleSheetTab'
    GoogleSheetColumnMapping:
      type: object
      properties:
        column:
          $ref: '#/components/schemas/GoogleSheetColumn'
        value:
          type: string
    GoogleSheetColumn:
      type: object
      properties:
        index:
          type: number
        name:
          type: string
      required:
        - index
        - name
    Delay:
      type: object
      properties:
        days:
          type: number
        hours:
          type: number
        minutes:
          type: number
      required:
        - days
        - hours
        - minutes
    WorkflowNodePropertyType:
      type: string
      enum:
        - basictext
        - number
        - text
        - textarea
        - password
        - checkbox
        - dropdown
        - apidropdown
        - split
        - form
        - groups
        - group
        - dynamicgroup
        - lists
        - list
        - to
        - composer
        - contactattributecondition
        - filtercondition
        - edges
        - property
        - update
        - link
        - delay
        - simpledelay
        - workflowproperty
        - messagestatusanderror
        - dynamicgroup
        - errors
        - googlesheet
        - googlesheetcolumnmappings
        - googlesheetcolumn
        - timeout
        - contactselect
        - userintegration
        - url
        - code
        - readonlytext
        - buttongroup
        - cron
        - phonenumber
        - image
    SelectOption:
      type: object
      properties:
        value:
          type: string
        label:
          type: string
    BasicGroup:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
      required:
        - id
        - name
    PhoneNumber:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        status:
          type: string
        number:
          type: string
        country:
          type: string
        type:
          type: string
        verified:
          type: boolean
        provider:
          type: string
        supportedDestinations:
          type: array
          items:
            type: string
        forwardTo:
          type: object
        universalReply:
          type: boolean
        channels:
          $ref: '#/components/schemas/PhoneNumberChannels'
        groups:
          type: array
          items:
            $ref: '#/components/schemas/BasicGroup'
        hosted:
          type: boolean
      required:
        - id
        - number
        - country
        - type
        - status
    GroupNotification:
      type: object
      properties:
        destination:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
          required:
            - id
            - name
        integration:
          type: string
        group:
          $ref: '#/components/schemas/BasicGroup'
    Sender:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - phonenumber
        subType:
          type: string
        status:
          type: string
        identifier:
          type: string
        channels:
          $ref: '#/components/schemas/PhoneNumberChannels'
        groups:
          type: array
          items:
            $ref: '#/components/schemas/BasicGroup'
        created:
          $ref: '#/components/schemas/Updated'
        updated:
          $ref: '#/components/schemas/Updated'
      required:
        - id
        - type
        - subType
        - status
        - identifier
        - created
        - updated
    GroupOfficeHours:
      type: object
      properties:
        active:
          type: boolean
        timezone:
          type: string
        times:
          $ref: '#/components/schemas/Times'
    ContactFilter:
      type: object
      properties:
        q:
          type: string
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/Condition'
        list:
          type: string
        valid:
          type: boolean
        invalid:
          type: boolean
        blocked:
          type: boolean
        unblocked:
          type: boolean
        optIn:
          type: boolean
    AdvancedDelayDays:
      type: array
      items:
        $ref: '#/components/schemas/DayOfWeek'
    AdvancedDelayTime:
      type: object
      required:
        - hour
        - minute
      properties:
        hour:
          type: number
        minute:
          type: number
    Person:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        email:
          type: string
          example: chris@sakari.io
        firstName:
          type: string
          example: Chris
        lastName:
          type: string
          example: Bloggs
        mobile:
          $ref: '#/components/schemas/InternationalNumber'
    Property:
      type: object
      properties:
        name:
          type: string
        label:
          type: string
        dataType:
          $ref: '#/components/schemas/DataType'
    UserIntegration:
      type: object
      properties:
        id:
          type: string
        connectedAt:
          type: string
          format: date-time
        user:
          type: object
          properties:
            id:
              type: string
            email:
              type: string
          required:
            - id
      required:
        - id
        - connectedAt
        - user
    GoogleSheetTab:
      type: object
      properties:
        id:
          type: number
        name:
          type: string
    PhoneNumberChannels:
      type: object
      properties:
        sms:
          $ref: '#/components/schemas/SmsChannel'
        voice:
          $ref: '#/components/schemas/VoiceChannel'
        whatsapp:
          $ref: '#/components/schemas/WhatsappChannel'
    Times:
      type: object
      properties:
        sun:
          type: array
          items:
            $ref: '#/components/schemas/Hours'
        mon:
          type: array
          items:
            $ref: '#/components/schemas/Hours'
        tue:
          type: array
          items:
            $ref: '#/components/schemas/Hours'
        wed:
          type: array
          items:
            $ref: '#/components/schemas/Hours'
        thu:
          type: array
          items:
            $ref: '#/components/schemas/Hours'
        fri:
          type: array
          items:
            $ref: '#/components/schemas/Hours'
        sat:
          type: array
          items:
            $ref: '#/components/schemas/Hours'
    Condition:
      type: object
      properties:
        attribute:
          type: string
        comparator:
          type: string
        value:
          oneOf:
            - type: array
              items:
                type: string
            - type: array
              items:
                type: number
            - type: string
            - type: number
      required:
        - attribute
        - comparator
        - value
    DayOfWeek:
      type: number
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
    DataType:
      type: string
      enum:
        - string
        - boolean
        - number
        - date
    SmsChannel:
      allOf:
        - $ref: '#/components/schemas/Channel'
        - type: object
          properties:
            universalReply:
              type: boolean
            supportedDestinations:
              $ref: '#/components/schemas/SupportedDestinations'
            regulatory:
              $ref: '#/components/schemas/SmsRegulatory'
    VoiceChannel:
      allOf:
        - $ref: '#/components/schemas/Channel'
        - type: object
          properties:
            incoming:
              type: object
              properties:
                action:
                  type: string
                  enum:
                    - forward
                    - voicemail
                forwardTo:
                  type: string
                message:
                  type: string
                transcribe:
                  type: boolean
            features:
              type: array
              items:
                type: string
    WhatsappChannel:
      allOf:
        - $ref: '#/components/schemas/Channel'
    Hours:
      type: object
      properties:
        start:
          $ref: '#/components/schemas/Time'
        end:
          $ref: '#/components/schemas/Time'
      required:
        - start
        - end
    Channel:
      type: object
      properties:
        active:
          type: boolean
    SupportedDestinations:
      type: object
      additionalProperties:
        type: boolean
    SmsRegulatory:
      type: object
      properties:
        brandStatus:
          type: string
        campaign:
          type: object
          properties:
            id:
              type: string
            campaignId:
              type: string
            useCase:
              type: string
        pft:
          type: boolean
        submitted:
          type: string
          format: date-time
        approved:
          type: string
          format: date-time
        rejected:
          type: string
          format: date-time
    Time:
      type: object
      required:
        - hour
        - minute
      properties:
        hour:
          type: number
        minute:
          type: number
  responses:
    4XX:
      description: invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    5XX:
      description: invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    sakari_auth:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /oauth2/token
          scopes:
            messages:send: Send messages

````