> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doglytdc.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Script token

> Scripts API routes: script token.

| Method | Path | What it does |
| - | - | - |
| `GET` | `/scripts/{script_id}/token` | Reports whether a token exists and its prefix. Never returns the value. |
| `POST` | `/scripts/{script_id}/token/reset` | Generates a new token (dts\_…). Shown once; the previous one becomes invalid. Owner only. |
| `DELETE` | `/scripts/{script_id}/token` | Revokes the script token. Owner only. |

## GET /scripts/\{script\_id}/token

Reports whether a token exists and its prefix. Never returns the value.

**Authentication:** DoglyTdc session only (dashboard). Script tokens and OAuth are not accepted.

**Path parameters:** `script_id`

**Response:** `{ exists, prefix, created_at, last_used_at }`

```bash cURL theme={null}
curl -X GET "https://ucsyxzpdbnuyehizezvb.supabase.co/functions/v1/doglytdc-scripts-api/scripts/{script_id}/token" \
  -H "Authorization: Bearer dts_SEU_TOKEN"
```

## POST /scripts/\{script\_id}/token/reset

Generates a new token (dts\_…). Shown once; the previous one becomes invalid. Owner only.

**Authentication:** DoglyTdc session only (dashboard). Script tokens and OAuth are not accepted.

> [!NOTE]
>
> The `dts_…` token appears once. The previous one becomes invalid immediately.

**Path parameters:** `script_id`

**Response:** `{ token, prefix }`

```bash cURL theme={null}
curl -X POST "https://ucsyxzpdbnuyehizezvb.supabase.co/functions/v1/doglytdc-scripts-api/scripts/{script_id}/token/reset" \
  -H "Authorization: Bearer dts_SEU_TOKEN"
```

## DELETE /scripts/\{script\_id}/token

Revokes the script token. Owner only.

**Authentication:** DoglyTdc session only (dashboard). Script tokens and OAuth are not accepted.

**Path parameters:** `script_id`

**Response:** `204`

```bash cURL theme={null}
curl -X DELETE "https://ucsyxzpdbnuyehizezvb.supabase.co/functions/v1/doglytdc-scripts-api/scripts/{script_id}/token" \
  -H "Authorization: Bearer dts_SEU_TOKEN"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.