---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/api/errors/51118#article
headline: "51118: Twilsock: Invalid claim set"
url: https://www.twilio.com/docs/api/errors/51118
inLanguage: en
dateModified: 2026-06-08T12:04:59.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# 51118: Twilsock: Invalid claim set

Log Level: ERROR

## Description

This error occurs when Twilio cannot validate the claim set in the Access Token used to authenticate a Twilsock connection. Twilio Access Tokens are JWTs for client-side SDKs, and the payload must include valid claim values such as `jti`, `iss`, `sub`, `iat`, optional `nbf`, `exp`, and `grants`.

### Possible causes

* The token payload is malformed or missing required claims such as `iss`, `sub`, `exp`, or `grants`.
* The token was generated with credentials that do not belong together, such as a mismatched `Account SID`, API Key SID, and API key secret, or it was created with test credentials instead of live credentials.
* The token does not include the product grant required by your SDK, or the grant is missing required values for that product.
* The client sent something other than the serialized JWT string, such as a JSON object or another wrapped token format.

### Possible solutions

* Generate the token with a Twilio helper library or SDK instead of constructing the JWT manually.
* Decode the token in a JWT debugger and compare the payload to Twilio's expected Access Token structure before returning it to the client.
* Verify that `iss` contains the API Key SID, `sub` contains the live `Account SID`, the timestamps are valid, and `grants` includes the permissions required by your SDK.
* Confirm that the API Key SID and API key secret match and that all credentials come from the same live account or subaccount.
* If you use Conversations, include a `ChatGrant` with a valid `service_sid` and an `identity` grant.

#### Additional resources

* [Access Tokens](/docs/iam/access-tokens)
* [API keys overview](/docs/iam/api-keys)
* [Troubleshooting Invalid Access Tokens](https://help.twilio.com/articles/115015890207-Troubleshooting-Invalid-Access-Tokens)
