# Surge

> Send SMS and look up contacts, recordings, campaigns and phone numbers in your Surge accounts.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/surge

## Actions

### Check account status

Check an account's status and capabilities

**Inputs**

- Account (`account_id`, text, required): ID of the account to check
- Capabilities (`capabilities`, list): capabilities about which to check the status. One or more of: `local_messaging` (Local messaging), `toll_free_messaging` (Toll free messaging).

**Outputs**

- `data` (object): Response containing account status information

**Example output**

```json
{
  "data": {
    "capabilities": {}
  }
}
```

### Create a contact

Creates a new Contact object.

**Inputs**

- Account (`account_id`, text, required): The account for which the contact should be created.
- Email (`email`, text): The contact's email address.
- First name (`first_name`, text): The contact's first name.
- Last name (`last_name`, text): The contact's last name.
- Metadata (`metadata`, object): Set of key-value pairs that will be stored with the object.
- Outbound disabled (`outbound_disabled`, true/false): Whether outbound messaging should be manually disabled for the contact.
- Phone number (`phone_number`, text, required): The contact's phone number in E.164 format.

**Outputs**

- `data` (object): A contact who has consented to receive messages

**Example output**

```json
{
  "data": {
    "email": "sample@example.com",
    "first_name": "Example",
    "id": "sample_id",
    "last_name": "Example",
    "metadata": {},
    "outbound_disabled": false,
    "phone_number": "Example"
  }
}
```

### Create a message

Send a text message now or schedule it for later.

**Inputs**

- Account (`account_id`, text, required): Choose an account.
- Recipient number (`to`, text, required): Recipient phone number in E.164 format.
- Sender number (`from_number`, text): Surge sender phone number in E.164 format.
- Body (`body`, text, required): Text of the message.
- Send at (`send_at`, date and time): When to send the message.

**Outputs**

- `data` (object): A Message is a communication sent to a Contact.

**Example output**

```json
{
  "data": {
    "attachments": [
      {
        "id": "sample_id",
        "type": "file",
        "url": "Example"
      }
    ],
    "blast_id": "sample_blast_id",
    "body": "Example",
    "conversation": {
      "contact": {
        "email": "sample@example.com",
        "first_name": "Example",
        "id": "sample_id",
        "last_name": "Example",
        "metadata": {},
        "outbound_disabled": false,
        "phone_number": "Example"
      },
      "id": "sample_id",
      "phone_number": {
        "id": "sample_id",
        "metadata": {},
        "name": "Example",
        "number": "Example",
        "type": "alphanumeric"
      }
    },
    "created_at": "2026-11-30T12:00:00Z",
    "failure_reason": "Example",
    "id": "sample_id",
    "metadata": {},
    "status": "pending"
  }
}
```

### List accounts

List all accounts with cursor-based pagination.

**Inputs**

- After (`after`, text): Cursor for forward pagination. Use the next_cursor from a previous response.
- Before (`before`, text): Cursor for backward pagination. Use the previous_cursor from a previous response.

**Outputs**

- `data` (object): A paginated list of accounts

**Example output**

```json
{
  "data": {
    "data": [
      {
        "brand_name": "Example",
        "id": "sample_id",
        "name": "Example",
        "organization": {
          "address": {},
          "contact": {},
          "country": "Example",
          "email": "sample@example.com",
          "identifier": "sample_identifier",
          "identifier_type": "ein",
          "industry": "agriculture",
          "mobile_number": "Example",
          "regions_of_operation": [
            "Example"
          ],
          "registered_name": "Example",
          "stock_exchange": "amex",
          "stock_symbol": "Example",
          "type": "co_op",
          "website": "Example"
        },
        "time_zone": "Example"
      }
    ],
    "pagination": {
      "next_cursor": "Example",
      "previous_cursor": "Example"
    }
  }
}
```

### List available phone numbers

Browse purchasable phone numbers from Surge inventory before buying. Use country=AU to browse Australian mobile numbers with an approved Australia registration. Pagination cursors are always null for now.

**Inputs**

- Account (`account_id`, text, required): The account ID to list available phone numbers for.
- Area code (`area_code`, text): Filter by 3-digit area code for US and Canadian numbers.
- Country (`country`, text): ISO country code to search in. One of: `US` (United States), `CA` (Canada), `AU` (Australia).
- Type (`type`, text): Number type to search for. For US and Canada, specify local or toll_free, or supply an area code to infer the type. Defaults to mobile for AU. One of: `local`, `toll_free` (Toll free), `mobile`.
- After (`after`, text): Cursor for forward pagination. Use the next_cursor from a previous response.
- Before (`before`, text): Cursor for backward pagination. Use the previous_cursor from a previous response.

**Outputs**

- `data` (object): A list of phone numbers available for purchase

**Example output**

```json
{
  "data": {
    "data": [
      {
        "country": "US",
        "number": "Example",
        "type": "local"
      }
    ],
    "pagination": {
      "next_cursor": "Example",
      "previous_cursor": "Example"
    }
  }
}
```

### List blocked contacts

Lists the account's blocked contacts, newest first, with cursor-based pagination.

**Inputs**

- Account (`account_id`, text, required): Account id.
- After (`after`, text): After.
- Before (`before`, text): Before.

**Outputs**

- `data` (object): A paginated list of blocked contacts, newest first.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_at": "2026-11-30T12:00:00Z",
        "id": "sample_id",
        "phone_number": "Example",
        "reason": "Example"
      }
    ],
    "pagination": {
      "next_cursor": "Example",
      "previous_cursor": "Example"
    }
  }
}
```

### List campaigns

List all campaigns for an account with cursor-based pagination.

**Inputs**

- Account (`account_id`, text, required): The account ID to list campaigns for.
- After (`after`, text): Cursor for forward pagination. Use the next_cursor from a previous response.
- Before (`before`, text): Cursor for backward pagination. Use the previous_cursor from a previous response.

**Outputs**

- `data` (object): A paginated list of campaigns

**Example output**

```json
{
  "data": {
    "data": [
      {
        "account_id": "sample_account_id",
        "consent_flow": "Example",
        "description": "Example",
        "id": "sample_id",
        "includes": [
          "links"
        ],
        "link_sample": "https://example.com",
        "message_samples": [
          "Example"
        ],
        "privacy_policy_url": "https://example.com",
        "status": "active",
        "terms_and_conditions_url": "https://example.com",
        "use_cases": [
          "account_notification"
        ],
        "volume": "high"
      }
    ],
    "pagination": {
      "next_cursor": "Example",
      "previous_cursor": "Example"
    }
  }
}
```

### List contacts

List all contacts for an account with cursor-based pagination.

**Inputs**

- Account (`account_id`, text, required): The account ID to list contacts for.
- After (`after`, text): Cursor for forward pagination. Use the next_cursor from a previous response.
- Before (`before`, text): Cursor for backward pagination. Use the previous_cursor from a previous response.

**Outputs**

- `data` (object): A paginated list of contacts

**Example output**

```json
{
  "data": {
    "data": [
      {
        "email": "sample@example.com",
        "first_name": "Example",
        "id": "sample_id",
        "last_name": "Example",
        "metadata": {},
        "outbound_disabled": false,
        "phone_number": "Example"
      }
    ],
    "pagination": {
      "next_cursor": "Example",
      "previous_cursor": "Example"
    }
  }
}
```

### List messages

List all messages for an account with cursor-based pagination.

**Inputs**

- Account (`account_id`, text, required): The account ID to list messages for.
- After (`after`, text): Cursor for forward pagination. Use the next_cursor from a previous response.
- Before (`before`, text): Cursor for backward pagination. Use the previous_cursor from a previous response.

**Outputs**

- `data` (object): A paginated list of messages

**Example output**

```json
{
  "data": {
    "data": [
      {
        "attachments": [
          {}
        ],
        "blast_id": "sample_blast_id",
        "body": "Example",
        "conversation": {
          "contact": {},
          "id": "sample_id",
          "phone_number": {}
        },
        "created_at": "2026-11-30T12:00:00Z",
        "failure_reason": "Example",
        "id": "sample_id",
        "metadata": {},
        "status": "pending"
      }
    ],
    "pagination": {
      "next_cursor": "Example",
      "previous_cursor": "Example"
    }
  }
}
```

### List phone numbers

List all phone numbers for an account with cursor-based pagination.

**Inputs**

- Account (`account_id`, text, required): The account ID to list phone numbers for.
- After (`after`, text): Cursor for forward pagination. Use the next_cursor from a previous response.
- Before (`before`, text): Cursor for backward pagination. Use the previous_cursor from a previous response.

**Outputs**

- `data` (object): A paginated list of phone numbers

**Example output**

```json
{
  "data": {
    "data": [
      {
        "caller_id_name_id": "sample_caller_id_name_id",
        "campaign": {
          "attachment_status": "attached",
          "id": "sample_id"
        },
        "campaign_id": "sample_campaign_id",
        "id": "sample_id",
        "metadata": {},
        "name": "Example",
        "number": "Example",
        "type": "alphanumeric"
      }
    ],
    "pagination": {
      "next_cursor": "Example",
      "previous_cursor": "Example"
    }
  }
}
```

### List recordings

List all recordings for an account with cursor-based pagination.

**Inputs**

- Account (`account_id`, text, required): The account ID to list recordings for.
- After (`after`, text): Cursor for forward pagination. Use the next_cursor from a previous response.
- Before (`before`, text): Cursor for backward pagination. Use the previous_cursor from a previous response.

**Outputs**

- `data` (object): A paginated list of recordings

**Example output**

```json
{
  "data": {
    "data": [
      {
        "call": {
          "contact": {},
          "duration": 1,
          "id": "sample_id",
          "initiated_at": "2026-11-30T12:00:00Z",
          "status": "blocked"
        },
        "duration": 1,
        "id": "sample_id"
      }
    ],
    "pagination": {
      "next_cursor": "Example",
      "previous_cursor": "Example"
    }
  }
}
```

### List toll-free campaigns

List all toll-free campaigns for an account with cursor-based pagination.

**Inputs**

- Account (`account_id`, text, required): The account ID to list toll-free campaigns for.
- After (`after`, text): Cursor for forward pagination. Use the next_cursor from a previous response.
- Before (`before`, text): Cursor for backward pagination. Use the previous_cursor from a previous response.

**Outputs**

- `data` (object): A paginated list of toll-free campaigns

**Example output**

```json
{
  "data": {
    "data": [
      {
        "consent_flows": [
          {}
        ],
        "description": "Example",
        "id": "sample_id",
        "includes": [
          "age_gated"
        ],
        "message_samples": [
          "Example"
        ],
        "phone_number_id": "sample_phone_number_id",
        "privacy_policy_url": "https://example.com",
        "status": "active",
        "terms_and_conditions_url": "https://example.com",
        "use_cases": [
          "two_factor_authentication"
        ]
      }
    ],
    "pagination": {
      "next_cursor": "Example",
      "previous_cursor": "Example"
    }
  }
}
```

### List users

List all users for an account with cursor-based pagination.

**Inputs**

- Account (`account_id`, text, required): The account ID to list users for.
- After (`after`, text): Cursor for forward pagination. Use the next_cursor from a previous response.
- Before (`before`, text): Cursor for backward pagination. Use the previous_cursor from a previous response.

**Outputs**

- `data` (object): A paginated list of users

**Example output**

```json
{
  "data": {
    "data": [
      {
        "first_name": "Example",
        "id": "sample_id",
        "last_name": "Example",
        "metadata": {},
        "photo_url": "https://example.com"
      }
    ],
    "pagination": {
      "next_cursor": "Example",
      "previous_cursor": "Example"
    }
  }
}
```

### Retrieve a campaign

Retrieves a Campaign object.

**Inputs**

- ID (`id`, text, required): The ID of the campaign to retrieve.

**Outputs**

- `data` (object): A campaign represents the context in which one or more of your phone numbers communicates with your contacts. Consent and opt-outs are tied to the campaign.

**Example output**

```json
{
  "data": {
    "account_id": "sample_account_id",
    "consent_flow": "Example",
    "description": "Example",
    "id": "sample_id",
    "includes": [
      "links"
    ],
    "link_sample": "https://example.com",
    "message_samples": [
      "Example"
    ],
    "privacy_policy_url": "https://example.com",
    "status": "active",
    "terms_and_conditions_url": "https://example.com",
    "use_cases": [
      "account_notification"
    ],
    "volume": "high"
  }
}
```

### Retrieve a contact

Retrieves a Contact object.

**Inputs**

- ID (`id`, text, required): The ID of the contact to retrieve.

**Outputs**

- `data` (object): A contact who has consented to receive messages

**Example output**

```json
{
  "data": {
    "email": "sample@example.com",
    "first_name": "Example",
    "id": "sample_id",
    "last_name": "Example",
    "metadata": {},
    "outbound_disabled": false,
    "phone_number": "Example"
  }
}
```

### Retrieve a message

Retrieves a Message object.

**Inputs**

- ID (`id`, text, required): The ID of the message to retrieve.

**Outputs**

- `data` (object): A Message is a communication sent to a Contact.

**Example output**

```json
{
  "data": {
    "attachments": [
      {
        "id": "sample_id",
        "type": "file",
        "url": "Example"
      }
    ],
    "blast_id": "sample_blast_id",
    "body": "Example",
    "conversation": {
      "contact": {
        "email": "sample@example.com",
        "first_name": "Example",
        "id": "sample_id",
        "last_name": "Example",
        "metadata": {},
        "outbound_disabled": false,
        "phone_number": "Example"
      },
      "id": "sample_id",
      "phone_number": {
        "id": "sample_id",
        "metadata": {},
        "name": "Example",
        "number": "Example",
        "type": "alphanumeric"
      }
    },
    "created_at": "2026-11-30T12:00:00Z",
    "failure_reason": "Example",
    "id": "sample_id",
    "metadata": {},
    "status": "pending"
  }
}
```

### Retrieve a phone number

Retrieves a PhoneNumber object.

**Inputs**

- ID (`id`, text, required): The ID of the phone number to retrieve.

**Outputs**

- `data` (object): A phone number that can be used to send and receive messages and calls

**Example output**

```json
{
  "data": {
    "caller_id_name_id": "sample_caller_id_name_id",
    "campaign": {
      "attachment_status": "attached",
      "id": "sample_id"
    },
    "campaign_id": "sample_campaign_id",
    "id": "sample_id",
    "metadata": {},
    "name": "Example",
    "number": "Example",
    "type": "alphanumeric"
  }
}
```

### Retrieve a recording

Retrieves a Recording object.

**Inputs**

- ID (`id`, text, required): The ID of the recording to retrieve.

**Outputs**

- `data` (object): A call recording

**Example output**

```json
{
  "data": {
    "call": {
      "contact": {
        "email": "sample@example.com",
        "first_name": "Example",
        "id": "sample_id",
        "last_name": "Example",
        "metadata": {},
        "outbound_disabled": false,
        "phone_number": "Example"
      },
      "duration": 1,
      "id": "sample_id",
      "initiated_at": "2026-11-30T12:00:00Z",
      "status": "blocked"
    },
    "duration": 1,
    "id": "sample_id"
  }
}
```

### Retrieve account usage

Returns priced usage for an account between `start_time` (inclusive) and `end_time` (exclusive). Both times must be whole UTC minutes and must fall within the last year. The window may span at most 90 days. Prices use the project's current plan rates. Phone number, campaign, and recording storage charges are included when their billing time falls in the window.

**Inputs**

- Account (`account_id`, text, required): ID of the account.
- Start time (`start_time`, date and time, required): Inclusive start of the window. Must be a whole UTC minute.
- End time (`end_time`, date and time, required): Exclusive end of the window. Must be a whole UTC minute.

**Outputs**

- `data` (object): Priced usage for an account over a requested window.

**Example output**

```json
{
  "data": {
    "end_time": "2026-11-30T12:00:00Z",
    "line_items": [
      {
        "category": "sms",
        "count": 1,
        "item": "Example",
        "total_price": "Example",
        "unit": "segment",
        "unit_price": "Example"
      }
    ],
    "start_time": "2026-11-30T12:00:00Z",
    "total": "Example"
  }
}
```

### Retrieve an account

Retrieves an Account object.

**Inputs**

- ID (`id`, text, required): The ID of the account to retrieve.

**Outputs**

- `data` (object): Response containing account information.

**Example output**

```json
{
  "data": {
    "brand_name": "Example",
    "id": "sample_id",
    "name": "Example",
    "organization": {
      "address": {
        "country": "Example",
        "line1": "Example",
        "line2": "Example",
        "locality": "Example",
        "name": "Example",
        "postal_code": "Example",
        "region": "Example"
      },
      "contact": {
        "email": "sample@example.com",
        "first_name": "Example",
        "last_name": "Example",
        "phone_number": "Example",
        "title": "ceo",
        "title_other": "Example"
      },
      "country": "Example",
      "email": "sample@example.com",
      "identifier": "sample_identifier",
      "identifier_type": "ein",
      "industry": "agriculture",
      "mobile_number": "Example",
      "regions_of_operation": [
        "africa"
      ],
      "registered_name": "Example",
      "stock_exchange": "amex",
      "stock_symbol": "Example",
      "type": "co_op",
      "website": "Example"
    },
    "time_zone": "Example"
  }
}
```
