Skip to content

Latest commit

 

History

History
54 lines (33 loc) · 1.04 KB

APITokens.md

File metadata and controls

54 lines (33 loc) · 1.04 KB

API Tokens

Create, validate and revoke API keys that can be used to access the API.

<?php
use Darkterminal\TursoPlatformAPI\Client;

require_once __DIR__ . '/vendor/autoload.php';

$turso = new Client(getenv('ORG_NAME'), getenv('API_TOKEN'));

List API Tokens

Returns a list of API tokens belonging to a user.

$turso->apiTokens()->list()->get();

Ref: https://docs.turso.tech/api-reference/tokens/list

Create API Token

Returns a new API token belonging to a user.

$turso->apiTokens()->create('test-token')->get();

Ref: https://docs.turso.tech/api-reference/tokens/create

Validate API Token

Validates an API token belonging to a user.

$turso->apiTokens()->validate()->get();

Ref: https://docs.turso.tech/api-reference/tokens/validate

Revoke API Token

Revokes the provided API token belonging to a user.

$turso->apiTokens()->revoke('test-token')->get();

Ref: https://docs.turso.tech/api-reference/tokens/revoke

Turso API Token: https://docs.turso.tech/api-reference/tokens