Tokens from a project.
OK
"redacted"
"my-token"
const response = await fetch('https://cloud-api.calyptia.com/v1/projects/{projectID}/tokens', { method: 'GET', headers: { "Authorization": "Bearer <token>" }, }); const data = await response.json();
[ { "id": "123e4567-e89b-12d3-a456-426614174000", "token": "redacted", "name": "my-token", "permissions": [ "create:*" ], "createdAt": "2024-12-03T17:29:06.357Z" } ]
Create token within a project. These tokens are to authorize other applications to access the project. For example:
"new-token"
Created
const response = await fetch('https://cloud-api.calyptia.com/v1/projects/{projectID}/tokens', { method: 'POST', headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "new-token", "permissions": [ "create:*" ] }), }); const data = await response.json();
{ "id": "123e4567-e89b-12d3-a456-426614174000", "token": "redacted", "name": "my-token", "permissions": [ "create:*" ], "createdAt": "2024-12-03T17:29:06.357Z" }