Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fern/apis/compatibility/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11688,7 +11688,7 @@ components:
type: string
description: The API token that can be used along with the project ID for basic authentication.
examples:
- PT037258e533e87ac63174ee136ed0798dc85d4f4f9e6d7191
- swapi_0123456789ab0123456789ab0123456789ab
unevaluatedProperties:
not: {}
description: Response containing a single token.
Expand Down
2 changes: 1 addition & 1 deletion fern/apis/signalwire-rest/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34498,7 +34498,7 @@ components:
type: string
description: The API token that can be used along with the project ID for basic authentication. It is returned only in this response and cannot be retrieved again; store it securely.
examples:
- PT037258e533e87ac63174ee136ed0798dc85d4f4f9e6d7191
- swapi_0123456789ab0123456789ab0123456789ab
unevaluatedProperties:
not: {}
title: Created API Token Response
Expand Down
15 changes: 10 additions & 5 deletions fern/products/apis/pages/core/authorization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,24 @@ To build the `credentials` string:

#### Example

Given the Project ID `a1b2c3d4-e5f6-7890-abcd-ef1234567890` and API Token `4tjCGnmAeQ0hwFmFDhwfgww880X2lsnuR60VMyasGR3hFpSyvu`:
Given the Project ID `a1b2c3d4-e5f6-7890-abcd-ef1234567890` and API Token `swapi_0123456789ab0123456789ab0123456789ab`:

```bash
# In the format username:password
a1b2c3d4-e5f6-7890-abcd-ef1234567890:4tjCGnmAeQ0hwFmFDhwfgww880X2lsnuR60VMyasGR3hFpSyvu
a1b2c3d4-e5f6-7890-abcd-ef1234567890:swapi_0123456789ab0123456789ab0123456789ab

# Base64 encoded:
YTFiMmMzZDQtZTVmNi03ODkwLWFiY2QtZWYxMjM0NTY3ODkwOjR0akNHbm1BZVEwaHdGbUZEaHdmZ3d3ODgwWDJsc251UjYwVk15YXNHUjNoRnBTeXZ1
YTFiMmMzZDQtZTVmNi03ODkwLWFiY2QtZWYxMjM0NTY3ODkwOnN3YXBpXzAxMjM0NTY3ODlhYjAxMjM0NTY3ODlhYjAxMjM0NTY3ODlhYg==

# Full header:
Authorization: Basic YTFiMmMzZDQtZTVmNi03ODkwLWFiY2QtZWYxMjM0NTY3ODkwOjR0akNHbm1BZVEwaHdGbUZEaHdmZ3d3ODgwWDJsc251UjYwVk15YXNHUjNoRnBTeXZ1
Authorization: Basic YTFiMmMzZDQtZTVmNi03ODkwLWFiY2QtZWYxMjM0NTY3ODkwOnN3YXBpXzAxMjM0NTY3ODlhYjAxMjM0NTY3ODlhYjAxMjM0NTY3ODlhYg==
```

API tokens created earlier begin with `PT` and are 50 characters long. Both formats
authenticate the same way, so treat a token as an opaque string rather than matching it
against a pattern. See [API credentials](/docs/platform/your-signalwire-api-space) for
details on token format.

### Finding your credentials

Your Project ID and API Tokens are available in the
Expand Down Expand Up @@ -73,7 +78,7 @@ Manage scopes in the [SignalWire Dashboard](/docs/platform/your-signalwire-api-s
```bash title="cURL"
# With base64-encoded credentials
curl https://{Your_Space_Name}.signalwire.com/api/laml/2010-04-01/Accounts/{YourProjectId}/Calls \
-H 'Authorization: Basic YTFiMmMzZDQtZTVmNi03ODkwLWFiY2QtZWYxMjM0NTY3ODkwOlBUOWE4YjdjNmQ1ZTRmM2EyYjFj'
-H 'Authorization: Basic YTFiMmMzZDQtZTVmNi03ODkwLWFiY2QtZWYxMjM0NTY3ODkwOnN3YXBpXzAxMjM0NTY3ODlhYjAxMjM0NTY3ODlhYjAxMjM0NTY3ODlhYg=='

# Encoded inline using the Bash pipe operator
curl https://{Your_Space_Name}.signalwire.com/api/laml/2010-04-01/Accounts/{YourProjectId}/Calls \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ In the "API" section you will find all the information you'll need. In particula

- Your Project ID (e.g., `7b981d06-fa9e-XXXX-XXXX-XXXXXXXXXXXX`)
- Your Space URL (e.g., `yourname.signalwire.com`)
- Your API Token (e.g., `PTda745ebXXXXXXXXXXXXXXXXXXXXXX`)
- Your API Token (e.g., `swapi_da745ebXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`)

The API Token is confidential: keep it private.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,24 @@ To build the `credentials` string:

#### Example

Given the Project ID `a1b2c3d4-e5f6-7890-abcd-ef1234567890` and API Token `4tjCGnmAeQ0hwFmFDhwfgww880X2lsnuR60VMyasGR3hFpSyvu`:
Given the Project ID `a1b2c3d4-e5f6-7890-abcd-ef1234567890` and API Token `swapi_0123456789ab0123456789ab0123456789ab`:

```bash
# In the format username:password
a1b2c3d4-e5f6-7890-abcd-ef1234567890:4tjCGnmAeQ0hwFmFDhwfgww880X2lsnuR60VMyasGR3hFpSyvu
a1b2c3d4-e5f6-7890-abcd-ef1234567890:swapi_0123456789ab0123456789ab0123456789ab

# Base64 encoded:
YTFiMmMzZDQtZTVmNi03ODkwLWFiY2QtZWYxMjM0NTY3ODkwOjR0akNHbm1BZVEwaHdGbUZEaHdmZ3d3ODgwWDJsc251UjYwVk15YXNHUjNoRnBTeXZ1
YTFiMmMzZDQtZTVmNi03ODkwLWFiY2QtZWYxMjM0NTY3ODkwOnN3YXBpXzAxMjM0NTY3ODlhYjAxMjM0NTY3ODlhYjAxMjM0NTY3ODlhYg==

# Full header:
Authorization: Basic YTFiMmMzZDQtZTVmNi03ODkwLWFiY2QtZWYxMjM0NTY3ODkwOjR0akNHbm1BZVEwaHdGbUZEaHdmZ3d3ODgwWDJsc251UjYwVk15YXNHUjNoRnBTeXZ1
Authorization: Basic YTFiMmMzZDQtZTVmNi03ODkwLWFiY2QtZWYxMjM0NTY3ODkwOnN3YXBpXzAxMjM0NTY3ODlhYjAxMjM0NTY3ODlhYjAxMjM0NTY3ODlhYg==
```

API tokens created earlier begin with `PT` and are 50 characters long. Both formats
authenticate the same way, so treat a token as an opaque string rather than matching it
against a pattern. See [API credentials](/docs/platform/your-signalwire-api-space) for
details on token format.

### Finding your credentials

Your Project ID and API Tokens are available in the
Expand Down Expand Up @@ -72,7 +77,7 @@ Manage scopes in the [SignalWire Dashboard](/docs/platform/your-signalwire-api-s
```bash title="cURL"
# With base64-encoded credentials
curl https://{Your_Space_Name}.signalwire.com/api/laml/2010-04-01/Accounts/{YourProjectId}/Calls \
-H 'Authorization: Basic YTFiMmMzZDQtZTVmNi03ODkwLWFiY2QtZWYxMjM0NTY3ODkwOlBUOWE4YjdjNmQ1ZTRmM2EyYjFj'
-H 'Authorization: Basic YTFiMmMzZDQtZTVmNi03ODkwLWFiY2QtZWYxMjM0NTY3ODkwOnN3YXBpXzAxMjM0NTY3ODlhYjAxMjM0NTY3ODlhYjAxMjM0NTY3ODlhYg=='

# Encoded inline using the Bash pipe operator
curl https://{Your_Space_Name}.signalwire.com/api/laml/2010-04-01/Accounts/{YourProjectId}/Calls \
Expand Down
14 changes: 14 additions & 0 deletions fern/products/platform/changelog/2026-09-14.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
tags: ["apis", "messaging", "voice"]
---

## Project API token format changed to a `swapi_` prefix

New Project API tokens begin with `swapi_` and are 42 characters long, replacing the previous
`PT` prefix and 50-character length. Personal Access Tokens and Project Signing Keys keep
their existing format.

Every token created before this change keeps working, with no deprecation and no end date, so
there is nothing to migrate. A Project can hold tokens in both formats at once, and both
authenticate identically through [HTTP Basic auth](/docs/apis/authorization). Treat a token as
an opaque string rather than matching it against a pattern or assuming a fixed length.

Find and create tokens under [API credentials](/docs/platform/your-signalwire-api-space) in the
Dashboard, or with [Create API token](/docs/apis/rest/project-tokens/create-token).

## Phone number address management added to the REST API

Link, re-point, or remove the resource that handles a phone number's calls or messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ In order to send an SMS from a FreeSWITCH dialplan extension, we need to do a fe
<!-- setup signalwire credentials -->
<action application="set" inline="true" data="space_name=XXXXXX"/>
<action application="set" inline="true" data="project_key=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX"/>
<action application="set" inline="true" data="api_token=PTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>
<action application="set" inline="true" data="api_token=swapi_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>

<!-- not using '+' here, just the 11 digit number itself, see curl line below -->
<action application="set" inline="true" data="signalwire_number=1XXXXXXXXXX"/>
Expand Down
11 changes: 11 additions & 0 deletions fern/products/platform/pages/platform/setup/api-credentials.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ Give your token a descriptive name to help differentiate it in logs and for debu
You can edit the token name and allowed scopes later by clicking the **⋯** button and selecting "Edit."
You may also delete a token from the same dropdown menu or the Edit page.

### Token format

New API tokens begin with `swapi_` and are 42 characters long. Tokens created earlier begin
with `PT` and are 50 characters long. Both formats authenticate the same way, and a Project
can hold tokens in both formats at the same time.

Existing `PT` tokens are not deprecated and have no end date, so there is nothing to migrate.

Treat a token as an opaque string. Don't parse it, match it against a pattern, or assume a
fixed length, in either format.

### Token scopes

API tokens can be configured with specific scopes that limit which APIs the token can access.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Get your API credentials from the project:
| Credential | Format |
|------------|--------|
| Project ID | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` |
| API Token | `PTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |
| API Token | `swapi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |
| Space Name | `your-space` |

<Warning>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
| `speakerId?` | `string` | Id of the speaker device to use for audio output. If undefined, picks a default speaker. |
| `stopCameraWhileMuted?` | `boolean` | Whether to stop the camera when the member is muted. Default: `true`. |
| `stopMicrophoneWhileMuted?` | `boolean` | Whether to stop the microphone when the member is muted. Default: `true`. |
| `token` | `string` | SignalWire project token, e.g. `PT9e5660c101cd140a1c93a0197640a369cf5f16975a0079c9`. |
| `token` | `string` | Video Room Token for the room to join, created with the [Create Room Token](/docs/apis/rest/video/room-tokens/create-room-token) endpoint. |
| `video?` | `boolean` \| `MediaTrackConstraints` | Video constraints to use when joining the room. Default: `true`. |
2 changes: 1 addition & 1 deletion specs/compatibility-api/tokens/models/core.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ model Token {
permissions: string[];

@doc("The API token that can be used along with the project ID for basic authentication.")
@example("PT037258e533e87ac63174ee136ed0798dc85d4f4f9e6d7191")
@example("swapi_0123456789ab0123456789ab0123456789ab")
token: string;
}
2 changes: 1 addition & 1 deletion specs/signalwire-rest/project-api/tokens/models/core.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ model CreateTokenResponse {
...TokenResponse;

@doc("The API token that can be used along with the project ID for basic authentication. It is returned only in this response and cannot be retrieved again; store it securely.")
@example("PT037258e533e87ac63174ee136ed0798dc85d4f4f9e6d7191")
@example("swapi_0123456789ab0123456789ab0123456789ab")
token: string;
}
Loading