Skip to content

SDK v0.1.0#2

Merged
rayruizhiliao merged 56 commits intomainfrom
phone
Mar 13, 2026
Merged

SDK v0.1.0#2
rayruizhiliao merged 56 commits intomainfrom
phone

Conversation

@rayruizhiliao
Copy link
Copy Markdown
Contributor

@rayruizhiliao rayruizhiliao commented Mar 12, 2026

Initial SDK (v0.1.0)

To test and run examples locally

cd inkbox/examples/python
pip install -e ../../python  #or with uv: uv pip install -e ../../python
# then run any example:
INKBOX_API_KEY=ApiKey_... MAILBOX_ADDRESS=agent@inkboxmail.com python agent_send_email.py
cd inkbox/typescript && npm run build
cd ../examples/typescript
INKBOX_API_KEY=ApiKey_... MAILBOX_ADDRESS=agent@inkboxmail.com node --experimental-strip-types agent-send-email.ts

dimavrem22 and others added 10 commits March 10, 2026 16:01
- pip install inkbox-mail → inkbox
- from inkbox_mail → from inkbox.mail
- @inkbox/mail → @inkbox/sdk
- Python examples: async/await → synchronous (matches actual SDK)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Python: inkbox.phone package with InkboxPhone client, 5 models, 4 resource classes (numbers, calls, transcripts, webhooks)
- TypeScript: @inkbox/sdk/phone subpath export with matching resources
- 16 methods covering: provision/release numbers, place/list/get calls, list transcripts, search transcripts, webhook CRUD

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Python: uv sync --extra dev installs ruff/pytest/pytest-cov
- TypeScript: remove cache config (no package-lock.json)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mode

- stream_url now falls back to phone number's default_stream_url
- call_mode renamed to pipeline_mode to match actual API field name
- Updated both Python and TypeScript SDKs + tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rayruizhiliao rayruizhiliao marked this pull request as ready for review March 12, 2026 21:03
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should either make this a full read me or remove it? but probably make it a detailed docs. and then we would prob also need to add one for type script

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in commit 279c72d

@dimavrem22
Copy link
Copy Markdown
Contributor

dimavrem22 commented Mar 12, 2026

high level thought: I feel like 3 separate clients are a little confusing to manage. Can we put all clients under a single InkboxClient like this:
Screenshot 2026-03-12 at 5 58 07 PM

this will let us to things like in the future:

  inkbox = Inkbox(api_key="ApiKey_...")                                                                                                                                                                                         
                                                            
  agent = inkbox.identities.create(agent_handle="support-bot")                                                                                                                                                                  
                                                                                                                                                                                                                                
  # Provision and link
  agent.assign_mailbox(display_name="Support Bot")
  agent.assign_phone_number(type="toll_free")

  # Send directly from the agent
  agent.send_email(
      to=["customer@example.com"],
      subject="Your order has shipped",
      body_text="Tracking number: 1Z999AA10123456784",
  )

  agent.place_call(
      to_number="+18005559999",
      stream_url="wss://my-app.com/voice",
  )

  # Read inbox
  for message in agent.messages():
      print(message.subject)

  # Search transcripts
  transcripts = agent.search_transcripts(q="refund")

  inkbox.close()

@dimavrem22
Copy link
Copy Markdown
Contributor

lets include a built in method to help verify that requests that we sent come from us:

Screenshot 2026-03-12 at 6 08 52 PM

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Provision and link channels in one call each
    identity.assign_mailbox(display_name="Support Bot")
    identity.assign_phone_number(type="toll_free")

to me assign sounds like we are attaching an existing object. maybe something like "provision"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in commit 58c2743

Below are updated channel methods for AgentIdentity:

create_mailbox(display_name=) — create + link a new mailbox
assign_mailbox(mailbox_id) — link an existing mailbox
unlink_mailbox() — unlink (doesn't delete)
provision_phone_number(type=, state=) — provision + link a new phone number
assign_phone_number(phone_number_id) — link an existing phone number
unlink_phone_number() — unlink (doesn't release)

Comment on lines +34 to +38
// Place an outbound call
await identity.placeCall({
toNumber: "+18005559999",
streamUrl: "wss://my-app.com/voice",
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets move this under all mail methods and add then add examples for reading / searching transcripts for consistency with mail (same for python)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

self hosting? Should the base url be removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in the current README: https://github.com/VectorlyApp/inkbox/tree/phone

Comment on lines +70 to 72
print(mailbox.email_address)
print(phone.number)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print(mailbox.email_address)
print(phone.number)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python/README.md Outdated
Comment on lines +105 to +106
# Iterate inbox (paginated automatically)
for msg in identity.messages():
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does this work? iterate through all messages in the mailbox ever? should we have some methods like
unread_count? or only parse those that are unread? also can the agent pull targeted messages from a thread for example?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated comment:

Rename messages(page_size=, direction=) to emails(). Instead add get_unread_emails(), get_emails_by_thread()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed messages(page_size=, direction=) to iter_emails(page_size?, direction?) to clarify it's an iterator for emails in commit 58c2743

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added iterUnreadEmails(pageSize?, direction?) and markEmailsRead(messageIds) in commit 94db06f

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added get_thread(self, thread_id: str) in commit d2ec5fd

python/README.md Outdated
print(hook.secret) # save this
print(call.status, call.rate_limit.calls_remaining)

# Full-text search across transcripts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shodul also probably be able to get transcript of a call by id

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated comment:

Remove search_transcripts(q, party=, limit=), and transcripts(call_id) already exists

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in commit 581d790

  • callslist_calls
  • transcriptslist_transcripts
  • search_transcripts removed

README.md Outdated
# Inkbox SDK

Official SDKs for the [Inkbox Mail API](https://inkbox.ai) — API-first email for AI agents.
Official SDKs for the [Inkbox API](https://inkbox.ai) — API-first communication infrastructure for AI agents (email, phone, identities).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this point to docs?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, updated in commit 71b6ac0

@rayruizhiliao rayruizhiliao merged commit ba60e8d into main Mar 13, 2026
2 checks passed
@dimavrem22 dimavrem22 deleted the phone branch March 13, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants