Skip to content

docs(rest-api): redact real-looking credentials and sample data from API specs - #445

Open
shardul-cometchat wants to merge 2 commits into
mainfrom
docs/replace-sample-phone-numbers
Open

docs(rest-api): redact real-looking credentials and sample data from API specs#445
shardul-cometchat wants to merge 2 commits into
mainfrom
docs/replace-sample-phone-numbers

Conversation

@shardul-cometchat

@shardul-cometchat shardul-cometchat commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

The OpenAPI specs contained example values that looked like real credentials, personal details and phone numbers rather than obvious placeholders. This replaces all of them.

Found by scanning the whole repo. Worth stating what the scan did not find, since that bounds the exposure: no AWS/Google/Slack/GitHub/Stripe keys, no JWTs, no private keys or certificates, no tracked .env/.pem/serviceAccount files, and no real personal email addresses. Everything below is confined to example values in the API specs and two SMS docs pages.

Personal details

  • management-apis.json — the Add Tenant request and response examples used a real person's name and @cometchat.com address. Replaced with Example User / my-email@example.com / somePassword#!, matching the placeholders that file's own "Request Example" block already uses.

Third-party credentials

  • Twilio — account SIDs and auth tokens in chat-apis.json (5 each) and management-apis.json (1 each) → <TWILIO_ACCOUNT_SID> / <TWILIO_AUTH_TOKEN>. Some had been hand-mangled previously (non-hex characters, wrong length), but they still read as live credentials.
  • Reply-webhook tokens — SendGrid (2, chat-apis.json), Intercom (3) and Chatwoot (3, management-apis.json) → <REPLIES_WEBHOOK_TOKEN>. These are bearer credentials embedded in URLs. The Intercom and Chatwoot tokens carry a base64 segment that decodes cleanly to {"appId":"212663ddb7a2a66b"}, so they were generated against a real app rather than invented.

CometChat credentials

  • REST API keys — 12 in chat-apis.json, 1 in data-import-apis.json<API_KEY>. The list-keys endpoint uses <API_KEY1>/<API_KEY2>/<API_KEY3> so the example still reads as three distinct keys.
  • Call session secretwsChannel.secret in chat-apis.json (2) → <WS_CHANNEL_SECRET>.

Phone numbers

Standardized to +12125550123, which sits in the 555-0100555-0199 block that NANP permanently reserves for fictional use, so it can never be assigned to anyone:

  • Twilio sender numbers (5, chat-apis.json)
  • SMS payload samples (3 in sms-templates.mdx, 2 in sms-custom-providers.mdx)
  • contactNumber examples (10 in chat-apis.json, 3 in management-apis.json)
  • fromMobileNo in the SMS extension settings, which was a malformed 9-digit number

The +91 examples on the contact-details endpoint are deliberately left as-is, so they keep matching that field's description ("phone number with country code (Ex: +1 for US, +91 for India, etc.)").

Related Issue(s)

N/A

Type of Change

  • Documentation correction/update
  • New documentation
  • Improvement to existing documentation
  • Typo fix
  • Other (please specify)

Checklist

  • I have read the CONTRIBUTING document
  • My branch name follows the naming convention
  • My changes follow the documentation style guide
  • I have checked for spelling and grammar errors
  • All links in my changes are valid and working
  • My changes are accurately described in this pull request

Additional Information

Important

Redaction is not remediation. Every value removed here remains in this repository's git history and has been served publicly by the docs site. If any of these are still live — particularly the Twilio credentials, the Intercom/Chatwoot/SendGrid webhook tokens, and the REST API keys — they need to be rotated at the source. This PR only stops further leakage.

Two notes on scope:

  • contactNumber examples changed from bare 10-digit strings to E.164 with a country code. That is a format change, not just a value swap, and it is intentional: those fields feed SMS notifications, which require a country code.
  • App IDs were left unchanged. They are not secret, and the sample values for that field are already inconsistent across the specs.

All three specs were validated as parseable JSON after the edits. No schema, endpoint or field-description changes, so there is no behavioral impact on the rendered API reference beyond the displayed sample values.

Screenshots (if applicable)

N/A

🤖 Generated with Claude Code

Swap out sample data in the OpenAPI specs that looked like real personal
details with obvious placeholders:

- chat-apis.json: Update/Get contact details examples now use the
  placeholder phone +911111111111 instead of a real-looking number.
- management-apis.json: Add Tenant request/response examples now use
  "Example User" / my-email@example.com, matching the placeholders the
  file already uses elsewhere, and contactNumber is normalized to
  1111111111 across all three examples.
- management-apis.json: the Add Tenant response example exposed what
  look like a genuine authKey and apiKey; replaced with <AUTH_KEY> and
  <API_KEY>, matching the <API_KEY1> convention used earlier in the file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mintlify

mintlify Bot commented Jul 28, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
cometchat 🟢 Ready View Preview Jul 28, 2026, 2:12 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Follow-up to the contact-details cleanup, covering the rest of the
real-looking credentials and phone numbers across the API specs.

Credentials replaced with placeholders:
- Twilio account SIDs and auth tokens (chat-apis.json, management-apis.json)
- Reply-webhook tokens for SendGrid, Intercom and Chatwoot. The Intercom
  and Chatwoot tokens carried a base64 payload decoding to a real appId,
  so they were generated against an actual app.
- CometChat REST API keys (chat-apis.json, data-import-apis.json). The
  list-keys example uses <API_KEY1..3> so it still reads as three keys.
- Call session wsChannel.secret (chat-apis.json)

Phone numbers standardized to +12125550123, which falls in the 555-0100
to 555-0199 block that NANP permanently reserves for fictional use:
- Twilio sender numbers, SMS payload samples, contactNumber examples and
  the malformed fromMobileNo in the SMS extension settings.
- contactNumber examples move from bare 10-digit strings to E.164, since
  those fields feed SMS notifications and need a country code.
- The +91 contact-details examples are left alone so they keep matching
  the field description, which cites +91 for India.

Redaction stops further leakage but does not undo it: these values remain
in git history and have been served by the docs site. Any that are still
live should be rotated.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@shardul-cometchat shardul-cometchat changed the title docs(rest-api): replace real-looking sample contact data in API specs docs(rest-api): redact real-looking credentials and sample data from API specs Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants