REST ClientFabricTokens

create_subscriber_token

View as MarkdownOpen in Claude

Create a subscriber authentication token.

Request

referencestringRequired
A string that uniquely identifies the subscriber. Often it's an email, but can be any other string.
expire_atintegerOptional
A unixtime (the number of seconds since 1970-01-01 00:00:00) at which the token should no longer be valid. Defaults to 'two hours from now'
application_idstringOptionalformat: "uuid"
The ID of the application that the token is associated with.
passwordstringOptional
Set or update the subscriber's password. Omit this field or pass an empty string if you don't want to update the password.
fingerprintstringOptionalformat: "^[A-Za-z0-9_-]+$"=43 characters
Binds the token to a specific device or browser session, letting the holder refresh it without going through your backend. The [Browser SDK](/docs/browser-sdk/v4) generates this value automatically when starting a session — forward it to your backend when requesting a token, so tie the token to that client. Without `fingerprint`, your backend can still refresh the token using the companion [`refresh_token`](/docs/apis/rest/subscribers/tokens/refresh-subscriber-token) returned in this response.
scopeenumOptional
Grants the token's holder permission to refresh it directly from the Browser SDK client. Pair with `fingerprint` to bind the token to a device. Without this scope, your backend can still refresh the token using the companion [`refresh_token`](/docs/apis/rest/subscribers/tokens/refresh-subscriber-token). If `sat:refresh` is set without `fingerprint`, the token's lifetime is limited to 60 seconds.
first_namestringOptional
Set or update the first name of the subscriber.
last_namestringOptional
Set or update the last name of the subscriber.
display_namestringOptional
Set or update the display name of the subscriber.
job_titlestringOptional
Set or update the job title of the subscriber.
time_zonestringOptional
Set or update the time zone of the subscriber.
countrystringOptional
Set or update the country of the subscriber.
regionenumOptional
A routing override that controls which regional cluster the SDK connects to.
company_namestringOptional
Set or update the company name of the subscriber.

Response

subscriber_idstringRequiredformat: "uuid"
The ID of the subscriber that the token is associated with.
tokenstringRequiredformat: "jwt"
The token that is associated with the subscriber.
refresh_tokenstringRequiredformat: "jwt"
Refresh token.

Response Example

Response
1{
2 "subscriber_id": "32d94154-9297-418c-9a85-4a69e0c67c30",
3 "token": "eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwidHlwIjoiU0FUIn0..HahMYxqt4uI14qSH.daMTBR53lfEfEFiVA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5}

Example

1from signalwire.rest import RestClient
2
3client = RestClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7)
8
9token = client.fabric.tokens.create_subscriber_token(reference="subscriber-id")
10print(f"Token: {token['token']}")