All URIs are relative to https://app.launchdarkly.com
Method | HTTP request | Description |
---|---|---|
deleteToken | DELETE /api/v2/tokens/{id} | Delete access token |
getToken | GET /api/v2/tokens/{id} | Get access token |
getTokens | GET /api/v2/tokens | List access tokens |
patchToken | PATCH /api/v2/tokens/{id} | Patch access token |
postToken | POST /api/v2/tokens | Create access token |
resetToken | POST /api/v2/tokens/{id}/reset | Reset access token |
deleteToken(id)
Delete access token
Delete an access token by ID.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.AccessTokensApi();
let id = "id_example"; // String | The ID of the access token to update
apiInstance.deleteToken(id, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the access token to update |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
Token getToken(id)
Get access token
Get a single access token by ID.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.AccessTokensApi();
let id = "id_example"; // String | The ID of the access token
apiInstance.getToken(id, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the access token |
- Content-Type: Not defined
- Accept: application/json
Tokens getTokens(opts)
List access tokens
Fetch a list of all access tokens.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.AccessTokensApi();
let opts = {
'showAll': true, // Boolean | If set to true, and the authentication access token has the 'Admin' role, personal access tokens for all members will be retrieved.
'limit': 789, // Number | The number of access tokens to return in the response. Defaults to 25.
'offset': 789 // Number | Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.
};
apiInstance.getTokens(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
showAll | Boolean | If set to true, and the authentication access token has the 'Admin' role, personal access tokens for all members will be retrieved. | [optional] |
limit | Number | The number of access tokens to return in the response. Defaults to 25. | [optional] |
offset | Number | Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Token patchToken(id, patchOperation)
Patch access token
Update an access token's settings. Updating an access token uses a JSON patch representation of the desired changes. To learn more, read Updates.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.AccessTokensApi();
let id = "id_example"; // String | The ID of the access token to update
let patchOperation = [{"op":"replace","path":"/role","value":"writer"}]; // [PatchOperation] |
apiInstance.patchToken(id, patchOperation, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the access token to update | |
patchOperation | [PatchOperation] |
- Content-Type: application/json
- Accept: application/json
Token postToken(accessTokenPost)
Create access token
Create a new access token.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.AccessTokensApi();
let accessTokenPost = {"role":"reader"}; // AccessTokenPost |
apiInstance.postToken(accessTokenPost, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
accessTokenPost | AccessTokenPost |
- Content-Type: application/json
- Accept: application/json
Token resetToken(id, opts)
Reset access token
Reset an access token's secret key with an optional expiry time for the old key.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.AccessTokensApi();
let id = "id_example"; // String | The ID of the access token to update
let opts = {
'expiry': 789 // Number | An expiration time for the old token key, expressed as a Unix epoch time in milliseconds. By default, the token will expire immediately.
};
apiInstance.resetToken(id, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the access token to update | |
expiry | Number | An expiration time for the old token key, expressed as a Unix epoch time in milliseconds. By default, the token will expire immediately. | [optional] |
- Content-Type: Not defined
- Accept: application/json