# Superchat

> Manage Superchat contacts, conversations, text messages, channels, labels and webhook subscriptions.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/superchat

## Actions

### Create contact

Create a contact.

**Inputs**

- First name (`first_name`, text): The first name of the contact
- Last name (`last_name`, text): The last name of the contact
- Gender (`gender`, text): The gender of the contact. One of: `male`, `female`, `diverse`, `unknown`. Default: `unknown`.
- Email address (`email`, text): Email address for the new contact.
- Phone number (`phone`, text): Phone number for the new contact.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "custom_attributes": [],
    "first_name": "example",
    "gender": "male",
    "handles": [],
    "id": "example",
    "last_name": "example",
    "updated_at": "example",
    "url": "example"
  }
}
```

### Create label

Create a label.

**Inputs**

- Name (`name`, text, required): The name of the label
- Color (`color`, text, required): The hex color of the label
- Folder ID (`folder_id`, text): The ID of the folder the label should be created in

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "color": "example",
    "folder_id": "example",
    "id": "example",
    "name": "example",
    "url": "example"
  }
}
```

### Create webhook

Create a webhook subscription.

**Inputs**

- Events (`events`, list): The webhook events to subscribe to
- Target url (`target_url`, text, required): The HTTPS target URL that should receive webhook deliveries

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "delivery": {
      "reason": "repeated_delivery_failure",
      "status": "active"
    },
    "events": [],
    "id": "example",
    "secret": "example",
    "target_url": "example",
    "updated_at": "example",
    "url": "example"
  }
}
```

### Delete contact

Delete a contact.

**Inputs**

- Contact (`contact_id`, text, required): Public ID of the contact.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "id": "example"
  }
}
```

### Delete label

Delete a label.

**Inputs**

- Label ID (`label_id`, text, required): Public ID of the label.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "id": "example"
  }
}
```

### Delete webhook

Delete a webhook subscription.

**Inputs**

- Subscription ID (`subscription_id`, text, required): Public ID of the webhook subscription.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "id": "example"
  }
}
```

### Get channel

Get a channel.

**Inputs**

- Channel (`channel_id`, text, required): Public ID of the channel.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "id": "example",
    "inbox": {
      "id": "example",
      "name": "example",
      "url": "example"
    },
    "name": "example",
    "phone_number": "example",
    "type": "sms"
  }
}
```

### Get contact

Get a contact.

**Inputs**

- Contact (`contact_id`, text, required): Public ID of the contact.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "custom_attributes": [],
    "first_name": "example",
    "gender": "male",
    "handles": [],
    "id": "example",
    "last_name": "example",
    "updated_at": "example",
    "url": "example"
  }
}
```

### Get conversation

Get a conversation.

**Inputs**

- Conversation (`id`, text, required): Public ID of the conversation.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "assigned_users": [],
    "channel": {
      "id": "example",
      "type": "sms",
      "url": "example"
    },
    "contacts": [],
    "id": "example",
    "inbox": {
      "id": "example",
      "name": "example",
      "url": "example"
    },
    "labels": [],
    "snoozed_until": "example",
    "status": "open",
    "time_window": {
      "open_until": "example",
      "state": "open"
    },
    "url": "example"
  }
}
```

### Get current user

Get current user.

**Inputs**: None.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "user": {
      "email": "example",
      "first_name": "example",
      "id": "example",
      "last_name": "example",
      "phone": "example",
      "role": "admin",
      "url": "example"
    },
    "workspace": {
      "name": "example"
    }
  }
}
```

### Get message

Get a message.

**Inputs**

- Id (`id`, text, required): Public ID of the message.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "content": {
      "body": "example",
      "type": "text"
    },
    "conversation_id": "example",
    "created_at": "example",
    "direction": "inbound",
    "from": {
      "id": "example",
      "identifier": "example",
      "url": "example"
    },
    "id": "example",
    "in_reply_to": "example",
    "status": "processed",
    "to": {
      "channel_id": "example"
    },
    "updated_at": "example"
  }
}
```

### Get template

Get a template.

**Inputs**

- Id (`id`, text, required): Public ID of the template.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "channels": [],
    "content": {
      "body": "example",
      "file_ids": [],
      "type": "generic_template",
      "variables": []
    },
    "created_at": "example",
    "folder": {
      "id": "example",
      "name": "example",
      "parent_id": "example"
    },
    "id": "example",
    "name": "example",
    "status": "submitted",
    "updated_at": "example",
    "url": "example"
  }
}
```

### List channels

List all channels.

**Inputs**

- After (`after`, text): Return channels after this channel ID.
- Before (`before`, text): Return channels before this channel ID.
- Limit (`limit`, number): Maximum number of channels to return. From 1 to 100. Default: `50`.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "pagination": {
      "next_cursor": "example",
      "next_url": "example",
      "previous_cursor": "example",
      "previous_url": "example"
    },
    "results": [],
    "url": "example"
  }
}
```

### List contacts

List all contacts.

**Inputs**

- After (`after`, text): Return contacts after this contact ID.
- Before (`before`, text): Return contacts before this contact ID.
- Limit (`limit`, number): Maximum number of contacts to return. From 1 to 100. Default: `50`.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "pagination": {
      "next_cursor": "example",
      "next_url": "example",
      "previous_cursor": "example",
      "previous_url": "example"
    },
    "results": [],
    "url": "example"
  }
}
```

### List conversations

List all conversations.

**Inputs**

- After (`after`, text): Return conversations after this conversation ID.
- Before (`before`, text): Return conversations before this conversation ID.
- Limit (`limit`, number): Maximum number of conversations to return. From 1 to 100. Default: `50`.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "pagination": {
      "next_cursor": "example",
      "next_url": "example",
      "previous_cursor": "example",
      "previous_url": "example"
    },
    "results": [],
    "url": "example"
  }
}
```

### List inboxes

List all inboxes.

**Inputs**

- After (`after`, text): Return inboxes after this inbox ID.
- Before (`before`, text): Return inboxes before this inbox ID.
- Limit (`limit`, number): Maximum number of inboxes to return. From 1 to 100. Default: `50`.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "pagination": {
      "next_cursor": "example",
      "next_url": "example",
      "previous_cursor": "example",
      "previous_url": "example"
    },
    "results": [],
    "url": "example"
  }
}
```

### List labels

List all labels.

**Inputs**

- After (`after`, text): Return labels after this label ID.
- Before (`before`, text): Return labels before this label ID.
- Limit (`limit`, number): Maximum number of labels to return. From 1 to 100. Default: `50`.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "pagination": {
      "next_cursor": "example",
      "next_url": "example",
      "previous_cursor": "example",
      "previous_url": "example"
    },
    "results": [],
    "url": "example"
  }
}
```

### List messages

Get conversation messages.

**Inputs**

- Conversation (`id`, text, required): Public ID of the conversation.
- After (`after`, text): Return messages after this message ID.
- Before (`before`, text): Return messages before this message ID.
- Created after (`created_after`, date and time): Only return messages created after this ISO 8601 timestamp.
- Created before (`created_before`, date and time): Only return messages created before this ISO 8601 timestamp.
- Direction (`direction`, text): Only return messages with this direction. One of: `INBOUND`, `OUTBOUND`.
- Limit (`limit`, number): Maximum number of messages to return. From 1 to 100. Default: `20`.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "pagination": {
      "next_cursor": "example",
      "next_url": "example",
      "previous_cursor": "example",
      "previous_url": "example"
    },
    "results": [],
    "url": "example"
  }
}
```

### List templates

List all templates.

**Inputs**

- After (`after`, text): Return templates after this template ID.
- Before (`before`, text): Return templates before this template ID.
- Channel (`channel_id`, text): Only return templates for this channel ID.
- Folder ID (`folder_id`, text): Only return templates in this folder ID.
- Limit (`limit`, number): Maximum number of templates to return. From 1 to 100. Default: `50`.
- Type (`type`, text): Only return templates with this content type. One of: `generic_template` (Generic template), `whats_app_template` (Whats app template).

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "pagination": {
      "next_cursor": "example",
      "next_url": "example",
      "previous_cursor": "example",
      "previous_url": "example"
    },
    "results": [],
    "url": "example"
  }
}
```

### List users

List all users.

**Inputs**

- After (`after`, text): Return users after this user ID.
- Before (`before`, text): Return users before this user ID.
- Limit (`limit`, number): Maximum number of users to return. From 1 to 100. Default: `50`.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "pagination": {
      "next_cursor": "example",
      "next_url": "example",
      "previous_cursor": "example",
      "previous_url": "example"
    },
    "results": [],
    "url": "example"
  }
}
```

### List webhooks

List all webhook subscriptions.

**Inputs**

- After (`after`, text): Return webhook subscriptions after this subscription ID.
- Before (`before`, text): Return webhook subscriptions before this subscription ID.
- Limit (`limit`, number): Maximum number of webhook subscriptions to return. From 1 to 100. Default: `50`.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "pagination": {
      "next_cursor": "example",
      "next_url": "example",
      "previous_cursor": "example",
      "previous_url": "example"
    },
    "results": [],
    "url": "example"
  }
}
```

### Search contacts

Search all contacts.

**Inputs**

- After (`after`, text): Return contacts after this contact ID.
- Before (`before`, text): Return contacts before this contact ID.
- Limit (`limit`, number): Maximum number of contacts to return. From 1 to 100. Default: `50`.
- Search filters (`query_value`, list, required): The list of search expressions to evaluate

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "pagination": {
      "next_cursor": "example",
      "next_url": "example",
      "previous_cursor": "example",
      "previous_url": "example"
    },
    "results": [],
    "url": "example"
  }
}
```

### Send message

Send a message.

**Inputs**

- To (`to`, list, required): The recipient list for the message
- From channel (`from_channel_id`, text, required): The ID of the channel used to send the message
- From name (`from_name`, text): The display name to use as the sender
- Content body (`content_body`, text, required): The text body of the message
- In reply to (`in_reply_to`, text): The ID of the message used to determine which conversation this new message is sent into

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "content": {
      "body": "example",
      "type": "text"
    },
    "conversation_id": "example",
    "created_at": "example",
    "direction": "outbound",
    "from": {
      "channel_id": "example",
      "name": "example"
    },
    "id": "example",
    "in_reply_to": "example",
    "status": "processed",
    "to": [],
    "updated_at": "example",
    "url": "example"
  }
}
```

### Update contact

Update a contact.

**Inputs**

- Contact (`contact_id`, text, required): Public ID of the contact.
- First name (`first_name`, text): The first name of the contact
- Last name (`last_name`, text): The last name of the contact
- Gender (`gender`, text): The gender of the contact. One of: `male`, `female`, `diverse`, `unknown`. Default: `unknown`.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "custom_attributes": [],
    "first_name": "example",
    "gender": "male",
    "handles": [],
    "id": "example",
    "last_name": "example",
    "updated_at": "example",
    "url": "example"
  }
}
```

### Update conversation

Update a conversation.

**Inputs**

- Conversation (`id`, text, required): Public ID of the conversation.
- Status (`status`, text): The new status of the conversation. One of: `open`, `done`, `spam`, `archived`, `snoozed`.
- Inbox (`inbox_id`, text): The ID of the inbox to assign to the conversation
- Snoozed until (`snoozed_until`, date and time): The time until which the conversation should be snoozed
- Assigned users (`assigned_users`, list): The IDs of the users to assign to the conversation
- Labels (`labels`, list): The IDs of the labels to assign to the conversation

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "assigned_users": [],
    "channel": {
      "id": "example",
      "type": "sms",
      "url": "example"
    },
    "contacts": [],
    "id": "example",
    "inbox": {
      "id": "example",
      "name": "example",
      "url": "example"
    },
    "labels": [],
    "snoozed_until": "example",
    "status": "open",
    "time_window": {
      "open_until": "example",
      "state": "open"
    },
    "url": "example"
  }
}
```
