Get a list of API Keys for a User
GET /api
Lists all API keys for a user, returning the most recent results first.
Path Parameters
userIdstring (required)
ID of the User.
Query Parameters
partialKeywordstring
Optional case-insensitive filter on the API key purpose or hint.partialPurposestring
Optional case-insensitive filter on the API key purpose.skipinteger
Number of items to skip. Defaults to zero. Minimum0.takeinteger
Number of items to take. Defaults to 30. Minimum0.
Response
200 — Success
Idstring
Gets or sets a unique identifier for this resource.ItemTypestringItemsarray of objectAccessLevelenum
The access level this API key grants.
Allowed values:FullAccess,ReadOnly,Custom.ActorTypeenum
Allowed values:User,AiAgent.ApiKeysensitive valueCreatedstring
Formatdate-time.Expiresstring
Formatdate-time.Idstring
Gets or sets a unique identifier for this resource.IsLastUsedTimestampKnownboolean
Whether the API key’s last-used time is being tracked. False for keys that predate last-used tracking, whose usage history is unknown. When true, a null LastUsedTimeStamp means the key has never been used.LastModifiedBystring
Gets or sets the username of the user who last modified this resource.LastModifiedOnstring
Gets or sets the date/time that this resource was last modified. Formatdate-time.LastUsedTimeStampstring
The date and time (UTC) the API key was last used to authenticate; null if it has never been used. Formatdate-time.Linksobject
Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.PurposestringUserIdstring
ItemsPerPageintegerLastModifiedBystring
Gets or sets the username of the user who last modified this resource.LastModifiedOnstring
Gets or sets the date/time that this resource was last modified. Formatdate-time.LastPageNumberintegerLinksobject
Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.NumberOfPagesintegerTotalResultsinteger
Example Response
{
"Id": "string",
"ItemType": "string",
"Items": [
{
"AccessLevel": "FullAccess",
"ActorType": "User",
"ApiKey": {
"HasValue": true,
"Hint": "string",
"NewValue": "string"
},
"Created": "2020-01-01T00:00:00.000Z",
"Expires": "2020-01-01T00:00:00.000Z",
"Id": "string",
"IsLastUsedTimestampKnown": true,
"LastModifiedBy": "string",
"LastModifiedOn": "2020-01-01T00:00:00.000Z",
"LastUsedTimeStamp": "2020-01-01T00:00:00.000Z",
"Links": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"Purpose": "string",
"UserId": "string"
}
],
"ItemsPerPage": 0,
"LastModifiedBy": "string",
"LastModifiedOn": "2020-01-01T00:00:00.000Z",
"LastPageNumber": 0,
"Links": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"NumberOfPages": 0,
"TotalResults": 0
}Generate a new API key for a User
POST /api
The API Key returned in the result must be saved by the caller, as it cannot be retrieved subsequently from the Octopus server
Path Parameters
userIdstring (required)
ID of the user.
Request Body
ActorTypeenum
The kind of actor that will hold this API key. Defaults to User when omitted.
Allowed values:User,AiAgent.Expiresstring
The date after which the API key ceases to be usable. Provide a null value to create an API key with the maximum allowable expiry. If unspecified, will use the system default which is 180 days unless otherwise configured. Formatdate-time.Purposestring
Informational text specifying the intended usage of the api key.UserIdstring (required)
ID of the user.
Response
200 — The created API Key, containing the unencrypted value of the key which must be saved by the caller, as it cannot be retrieved subsequently from the Octopus server.
ActorTypeenum
Allowed values:User,AiAgent.ApiKeystringCreatedstring
Formatdate-time.Expiresstring
Formatdate-time.Idstring
Gets or sets a unique identifier for this resource.IsLastUsedTimestampKnownbooleanLastModifiedBystring
Gets or sets the username of the user who last modified this resource.LastModifiedOnstring
Gets or sets the date/time that this resource was last modified. Formatdate-time.LastUsedTimeStampstring
Formatdate-time.Linksobject
Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.PurposestringUserIdstring
Example Request
{
"ActorType": "User",
"Expires": "2020-01-01T00:00:00.000Z",
"Purpose": "string",
"UserId": "string"
}Example Response
{
"ActorType": "User",
"ApiKey": "string",
"Created": "2020-01-01T00:00:00.000Z",
"Expires": "2020-01-01T00:00:00.000Z",
"Id": "string",
"IsLastUsedTimestampKnown": true,
"LastModifiedBy": "string",
"LastModifiedOn": "2020-01-01T00:00:00.000Z",
"LastUsedTimeStamp": "2020-01-01T00:00:00.000Z",
"Links": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"Purpose": "string",
"UserId": "string"
}Get a list of API Keys for a User
GET /api
Lists all API keys for a user, returning the most recent results first.
Path Parameters
userIdstring (required)
ID of the User.
Query Parameters
partialKeywordstring
Optional case-insensitive filter on the API key purpose or hint.partialPurposestring
Optional case-insensitive filter on the API key purpose.skipinteger
Number of items to skip. Defaults to zero. Minimum0.takeinteger
Number of items to take. Defaults to 30. Minimum0.
Response
200 — Success
ApiKeysobjectIdstring
Gets or sets a unique identifier for this resource.ItemTypestringItemsarray of objectItemsPerPageintegerLastModifiedBystring
Gets or sets the username of the user who last modified this resource.LastModifiedOnstring
Gets or sets the date/time that this resource was last modified. Formatdate-time.LastPageNumberintegerLinksobject
Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.NumberOfPagesintegerTotalResultsinteger
Example Response
{
"ApiKeys": {
"Id": "string",
"ItemType": "string",
"Items": [
{
"AccessLevel": "FullAccess",
"ActorType": "User",
"ApiKey": {},
"Created": "2020-01-01T00:00:00.000Z",
"Expires": "2020-01-01T00:00:00.000Z",
"Id": "string",
"IsLastUsedTimestampKnown": true,
"LastModifiedBy": "string",
"LastModifiedOn": "2020-01-01T00:00:00.000Z",
"LastUsedTimeStamp": "2020-01-01T00:00:00.000Z",
"Links": {},
"Purpose": "string",
"UserId": "string"
}
],
"ItemsPerPage": 0,
"LastModifiedBy": "string",
"LastModifiedOn": "2020-01-01T00:00:00.000Z",
"LastPageNumber": 0,
"Links": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"NumberOfPages": 0,
"TotalResults": 0
}
}Get an API Key by ID
GET /api
Path Parameters
idstring (required)
ID of the ApiKeyResource to load.userIdstring (required)
ID of the User that owns the ApiKey.
Response
200 — The requested API Key
AccessLevelenum
The access level this API key grants.
Allowed values:FullAccess,ReadOnly,Custom.ActorTypeenum
Allowed values:User,AiAgent.ApiKeysensitive valueHasValuebooleanHintstringNewValuestring
Createdstring
Formatdate-time.Expiresstring
Formatdate-time.Idstring
Gets or sets a unique identifier for this resource.IsLastUsedTimestampKnownboolean
Whether the API key’s last-used time is being tracked. False for keys that predate last-used tracking, whose usage history is unknown. When true, a null LastUsedTimeStamp means the key has never been used.LastModifiedBystring
Gets or sets the username of the user who last modified this resource.LastModifiedOnstring
Gets or sets the date/time that this resource was last modified. Formatdate-time.LastUsedTimeStampstring
The date and time (UTC) the API key was last used to authenticate; null if it has never been used. Formatdate-time.Linksobject
Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.PurposestringUserIdstring
Example Response
{
"AccessLevel": "FullAccess",
"ActorType": "User",
"ApiKey": {
"HasValue": true,
"Hint": "string",
"NewValue": "string"
},
"Created": "2020-01-01T00:00:00.000Z",
"Expires": "2020-01-01T00:00:00.000Z",
"Id": "string",
"IsLastUsedTimestampKnown": true,
"LastModifiedBy": "string",
"LastModifiedOn": "2020-01-01T00:00:00.000Z",
"LastUsedTimeStamp": "2020-01-01T00:00:00.000Z",
"Links": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"Purpose": "string",
"UserId": "string"
}Revoke an API Key
DELETE /api
Path Parameters
idstring (required)
Id of the ApiKey to delete.userIdstring (required)
Id of the User that owns the ApiKey to delete.
Response
200 — Confirmation that a User API Key has been deleted
Example Response
{}