Tokens from a project.
OK
"redacted"
"my-token"
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: '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-11-21T09:30:14.146Z" } ]
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-11-21T09:30:14.146Z" }