Sign in Start for free

Api Keys

Get a list of API Keys for a User

GET /api/users/{userId}/apikeys

Lists all API keys for a user, returning the most recent results first.

Path Parameters

  • userId string (required)
    ID of the User.

Query Parameters

  • partialKeyword string
    Optional case-insensitive filter on the API key purpose or hint.
  • partialPurpose string
    Optional case-insensitive filter on the API key purpose.
  • skip integer
    Number of items to skip. Defaults to zero. Minimum 0.
  • take integer
    Number of items to take. Defaults to 30. Minimum 0.

Response

200 — Success

  • Id string
    Gets or sets a unique identifier for this resource.
  • ItemType string
  • Items array of object
    • AccessLevel enum
      The access level this API key grants.
      Allowed values: FullAccess, ReadOnly, Custom.
    • ActorType enum
      Allowed values: User, AiAgent.
    • ApiKey sensitive value
    • Created string
      Format date-time.
    • Expires string
      Format date-time.
    • Id string
      Gets or sets a unique identifier for this resource.
    • IsLastUsedTimestampKnown boolean
      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.
    • LastModifiedBy string
      Gets or sets the username of the user who last modified this resource.
    • LastModifiedOn string
      Gets or sets the date/time that this resource was last modified. Format date-time.
    • LastUsedTimeStamp string
      The date and time (UTC) the API key was last used to authenticate; null if it has never been used. Format date-time.
    • Links object
      Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
    • Purpose string
    • UserId string
  • ItemsPerPage integer
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • LastPageNumber integer
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • NumberOfPages integer
  • TotalResults integer

Example Response

JSON
{
  "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/users/{userId}/apikeys

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

  • userId string (required)
    ID of the user.

Request Body

  • ActorType enum
    The kind of actor that will hold this API key. Defaults to User when omitted.
    Allowed values: User, AiAgent.
  • Expires string
    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. Format date-time.
  • Purpose string
    Informational text specifying the intended usage of the api key.
  • UserId string (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.

  • ActorType enum
    Allowed values: User, AiAgent.
  • ApiKey string
  • Created string
    Format date-time.
  • Expires string
    Format date-time.
  • Id string
    Gets or sets a unique identifier for this resource.
  • IsLastUsedTimestampKnown boolean
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • LastUsedTimeStamp string
    Format date-time.
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • Purpose string
  • UserId string

Example Request

JSON
{
  "ActorType": "User",
  "Expires": "2020-01-01T00:00:00.000Z",
  "Purpose": "string",
  "UserId": "string"
}

Example Response

JSON
{
  "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/users/{userId}/apikeys/v1

Lists all API keys for a user, returning the most recent results first.

Path Parameters

  • userId string (required)
    ID of the User.

Query Parameters

  • partialKeyword string
    Optional case-insensitive filter on the API key purpose or hint.
  • partialPurpose string
    Optional case-insensitive filter on the API key purpose.
  • skip integer
    Number of items to skip. Defaults to zero. Minimum 0.
  • take integer
    Number of items to take. Defaults to 30. Minimum 0.

Response

200 — Success

  • ApiKeys object
    • Id string
      Gets or sets a unique identifier for this resource.
    • ItemType string
    • Items array of object
    • ItemsPerPage integer
    • LastModifiedBy string
      Gets or sets the username of the user who last modified this resource.
    • LastModifiedOn string
      Gets or sets the date/time that this resource was last modified. Format date-time.
    • LastPageNumber integer
    • Links object
      Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
    • NumberOfPages integer
    • TotalResults integer

Example Response

JSON
{
  "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/users/{userId}/apikeys/{id}

Path Parameters

  • id string (required)
    ID of the ApiKeyResource to load.
  • userId string (required)
    ID of the User that owns the ApiKey.

Response

200 — The requested API Key

  • AccessLevel enum
    The access level this API key grants.
    Allowed values: FullAccess, ReadOnly, Custom.
  • ActorType enum
    Allowed values: User, AiAgent.
  • ApiKey sensitive value
    • HasValue boolean
    • Hint string
    • NewValue string
  • Created string
    Format date-time.
  • Expires string
    Format date-time.
  • Id string
    Gets or sets a unique identifier for this resource.
  • IsLastUsedTimestampKnown boolean
    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.
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • LastUsedTimeStamp string
    The date and time (UTC) the API key was last used to authenticate; null if it has never been used. Format date-time.
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • Purpose string
  • UserId string

Example Response

JSON
{
  "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/users/{userId}/apikeys/{id}

Path Parameters

  • id string (required)
    Id of the ApiKey to delete.
  • userId string (required)
    Id of the User that owns the ApiKey to delete.

Response

200 — Confirmation that a User API Key has been deleted

Example Response

JSON
{}