Skip to content
Merged
2 changes: 1 addition & 1 deletion .github/.release-please-live-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0"
".": "1.0.0"
}
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog

## [1.0.0](https://github.com/respond-io/typescript-sdk/compare/v0.1.0...v1.0.0) (2025-11-12)


### ⚠ BREAKING CHANGES

* Bump breaking changes version

### Features

* Bump breaking changes version ([4c82ff7](https://github.com/respond-io/typescript-sdk/commit/4c82ff7e2fbb5aef3056460c2a9fb9a4ada14d1b))


### Bug Fixes

* Update License Content ([15d7c3b](https://github.com/respond-io/typescript-sdk/commit/15d7c3b5a7421e0bb6ae12a48f56bdb43d724cef))
64 changes: 43 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ await client.contacts.create('email:user@example.com', {
```typescript
await client.contacts.update('id:123', {
firstName: 'Jane',
custom_fields: [
{ name: 'Role', value: 'Senior Developer' },
],
custom_fields: [{ name: 'Role', value: 'Senior Developer' }],
});
```

Expand All @@ -166,23 +164,26 @@ const result = await client.contacts.list({
});

// List with filters
const result = await client.contacts.list({
search: '',
timezone: 'UTC',
filter: {
$and: [
{
category: 'contactField',
field: 'assigneeUserId',
operator: 'isEqualTo',
value: '123',
},
],
const result = await client.contacts.list(
{
search: '',
timezone: 'UTC',
filter: {
$and: [
{
category: 'contactField',
field: 'assigneeUserId',
operator: 'isEqualTo',
value: '123',
},
],
},
},
}, {
limit: 50,
cursorId: 0,
});
{
limit: 50,
cursorId: 0,
}
);
```

#### Manage Tags
Expand Down Expand Up @@ -259,6 +260,27 @@ const message = await client.messaging.get('id:123', 987654);
console.log(message.status); // Message delivery status
```

#### List Messages

```typescript
// List all messages for a contact
const result = await client.messaging.list('id:123');
console.log(result.items); // Array of messages
console.log(result.pagination); // Pagination info

// List messages with pagination
const result = await client.messaging.list('id:123', {
limit: 50,
cursorId: 100,
});

// List messages for different contact identifiers
const result = await client.messaging.list('email:user@example.com');
const result = await client.messaging.list('phone:+1234567890', {
limit: 20,
});
```

### Comments

The Comment API allows you to add internal comments to contacts.
Expand Down Expand Up @@ -392,7 +414,7 @@ try {
console.error('Status:', error.statusCode);
console.error('Code:', error.code);
console.error('Message:', error.message);

// Check error type
if (error.isRateLimitError()) {
console.error('Rate limit reached!');
Expand Down Expand Up @@ -563,4 +585,4 @@ Contributions are welcome! Please feel free to submit a Pull Request.

---

Made with ❤️ by the respond.io community
Made with ❤️ by the respond.io community
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@respond-io/typescript-sdk",
"version": "0.2.0",
"version": "1.0.0",
"description": "Official TypeScript SDK for the respond.io Developer API v2",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
14 changes: 14 additions & 0 deletions src/clients/messaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
SendMessageRequest,
SendMessageResponse,
GetMessageResponse,
PaginationParams,
PaginationResponse,
} from '../types/index';

/**
Expand Down Expand Up @@ -35,4 +37,16 @@ export class MessagingClient {
): Promise<GetMessageResponse> {
return this.http.get(`/contact/${identifier}/message/${messageId}`);
}

/**
* List messages for a contact
* @param identifier - Contact identifier
* @param pagination - Pagination parameters
*/
async list(
identifier: ContactIdentifier,
pagination?: PaginationParams
): Promise<{ items: GetMessageResponse[]; pagination: PaginationResponse }> {
return this.http.post(`/contact/${identifier}/message/list`, undefined, pagination);
}
}
12 changes: 12 additions & 0 deletions src/types/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,17 @@ export interface SendMessageResponse {
messageId: number;
}

/**
* Message sender
*/
export interface MessageSender {
source: 'user' | 'ai_agent' | 'workflow' | 'api' | 'echo' | 'broadcast';
userId?: number;
teamId?: number;
workflowId?: number;
broadcastHistoryId?: number;
}

/**
* Get message response
*/
Expand All @@ -197,4 +208,5 @@ export interface GetMessageResponse {
traffic: MessageTraffic;
message: Message;
status?: MessageStatusEntry[];
sender?: MessageSender;
}
Loading