Create token
POST/tokens
Creates an API access token with the details in the given request body.
Request
- application/json
Bodyrequired
Access token create request
namestring
Responses
- 200
- 400
- 403
- 409
OK
- application/json
- Schema
- Example (auto)
Schema
accessKeystring
token object
{
"accessKey": "string",
"token": {
"id": 0,
"name": "string",
"lastUsed": "2024-07-29T15:51:28.071Z",
"dateCreated": "2024-07-29T15:51:28.071Z"
}
}
Bad request
- application/json
- Schema
- Example (auto)
Schema
messagestringrequired
{
"message": "string"
}
Operation not allowed
Duplicated element
- application/json
- Schema
- Example (auto)
Schema
messagestringrequired
{
"message": "string"
}
Authorization: http
name: BearerAuthtype: httpscheme: bearerbearerFormat: jwt
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://docs.seqera.io/tokens");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent(string.Empty);
content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());