Okta Integration

Configure your Datadog Okta integration directly through the Datadog API.

GET https://api.ap1.datadoghq.com/api/v2/integrations/okta/accountshttps://api.datadoghq.eu/api/v2/integrations/okta/accountshttps://api.ddog-gov.com/api/v2/integrations/okta/accountshttps://api.datadoghq.com/api/v2/integrations/okta/accountshttps://api.us3.datadoghq.com/api/v2/integrations/okta/accountshttps://api.us5.datadoghq.com/api/v2/integrations/okta/accounts

Overview

List Okta accounts. This endpoint requires the integrations_read permission.

Response

OK

The expected response schema when getting Okta accounts.

Expand All

Field

Type

Description

data

[object]

List of Okta accounts.

attributes [required]

object

Attributes object for an Okta account.

api_key

string

The API key of the Okta account.

auth_method [required]

string

The authorization method for an Okta account.

client_id

string

The Client ID of an Okta app integration.

client_secret

string

The client secret of an Okta app integration.

domain [required]

string

The domain of the Okta account.

name [required]

string

The name of the Okta account.

id [required]

string

The ID of the Okta account, a UUID hash of the account name.

type [required]

enum

Account type for an Okta account. Allowed enum values: okta-accounts

default: okta-accounts

{
  "data": [
    {
      "attributes": {
        "api_key": "string",
        "auth_method": "oauth",
        "client_id": "string",
        "client_secret": "string",
        "domain": "https://example.okta.com/",
        "name": "Okta-Prod"
      },
      "id": "f749daaf-682e-4208-a38d-c9b43162c609",
      "type": "okta-accounts"
    }
  ]
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

/**
 * List Okta accounts returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.OktaIntegrationApi(configuration);

apiInstance
  .listOktaAccounts()
  .then((data: v2.OktaAccountsResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v2/integrations/okta/accountshttps://api.datadoghq.eu/api/v2/integrations/okta/accountshttps://api.ddog-gov.com/api/v2/integrations/okta/accountshttps://api.datadoghq.com/api/v2/integrations/okta/accountshttps://api.us3.datadoghq.com/api/v2/integrations/okta/accountshttps://api.us5.datadoghq.com/api/v2/integrations/okta/accounts

Overview

Create an Okta account. This endpoint requires the manage_integrations permission.

Request

Body Data (required)

Expand All

Field

Type

Description

data [required]

object

Schema for an Okta account.

attributes [required]

object

Attributes object for an Okta account.

api_key

string

The API key of the Okta account.

auth_method [required]

string

The authorization method for an Okta account.

client_id

string

The Client ID of an Okta app integration.

client_secret

string

The client secret of an Okta app integration.

domain [required]

string

The domain of the Okta account.

name [required]

string

The name of the Okta account.

id

string

The ID of the Okta account, a UUID hash of the account name.

type [required]

enum

Account type for an Okta account. Allowed enum values: okta-accounts

default: okta-accounts

{
  "data": {
    "attributes": {
      "auth_method": "oauth",
      "domain": "https://example.okta.com/",
      "name": "exampleoktaintegration",
      "client_id": "client_id",
      "client_secret": "client_secret"
    },
    "id": "f749daaf-682e-4208-a38d-c9b43162c609",
    "type": "okta-accounts"
  }
}

Response

OK

Response object for an Okta account.

Expand All

Field

Type

Description

data

object

Schema for an Okta account.

attributes [required]

object

Attributes object for an Okta account.

api_key

string

The API key of the Okta account.

auth_method [required]

string

The authorization method for an Okta account.

client_id

string

The Client ID of an Okta app integration.

client_secret

string

The client secret of an Okta app integration.

domain [required]

string

The domain of the Okta account.

name [required]

string

The name of the Okta account.

id

string

The ID of the Okta account, a UUID hash of the account name.

type [required]

enum

Account type for an Okta account. Allowed enum values: okta-accounts

default: okta-accounts

{
  "data": {
    "attributes": {
      "api_key": "string",
      "auth_method": "oauth",
      "client_id": "string",
      "client_secret": "string",
      "domain": "https://example.okta.com/",
      "name": "Okta-Prod"
    },
    "id": "f749daaf-682e-4208-a38d-c9b43162c609",
    "type": "okta-accounts"
  }
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

/**
 * Add Okta account returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.OktaIntegrationApi(configuration);

const params: v2.OktaIntegrationApiCreateOktaAccountRequest = {
  body: {
    data: {
      attributes: {
        authMethod: "oauth",
        domain: "https://example.okta.com/",
        name: "exampleoktaintegration",
        clientId: "client_id",
        clientSecret: "client_secret",
      },
      id: "f749daaf-682e-4208-a38d-c9b43162c609",
      type: "okta-accounts",
    },
  },
};

apiInstance
  .createOktaAccount(params)
  .then((data: v2.OktaAccountResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

GET https://api.ap1.datadoghq.com/api/v2/integrations/okta/accounts/{account_id}https://api.datadoghq.eu/api/v2/integrations/okta/accounts/{account_id}https://api.ddog-gov.com/api/v2/integrations/okta/accounts/{account_id}https://api.datadoghq.com/api/v2/integrations/okta/accounts/{account_id}https://api.us3.datadoghq.com/api/v2/integrations/okta/accounts/{account_id}https://api.us5.datadoghq.com/api/v2/integrations/okta/accounts/{account_id}

Overview

Get an Okta account. This endpoint requires the integrations_read permission.

Arguments

Path Parameters

Name

Type

Description

account_id [required]

string

None

Response

OK

Response object for an Okta account.

Expand All

Field

Type

Description

data

object

Schema for an Okta account.

attributes [required]

object

Attributes object for an Okta account.

api_key

string

The API key of the Okta account.

auth_method [required]

string

The authorization method for an Okta account.

client_id

string

The Client ID of an Okta app integration.

client_secret

string

The client secret of an Okta app integration.

domain [required]

string

The domain of the Okta account.

name [required]

string

The name of the Okta account.

id

string

The ID of the Okta account, a UUID hash of the account name.

type [required]

enum

Account type for an Okta account. Allowed enum values: okta-accounts

default: okta-accounts

{
  "data": {
    "attributes": {
      "api_key": "string",
      "auth_method": "oauth",
      "client_id": "string",
      "client_secret": "string",
      "domain": "https://example.okta.com/",
      "name": "Okta-Prod"
    },
    "id": "f749daaf-682e-4208-a38d-c9b43162c609",
    "type": "okta-accounts"
  }
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

/**
 * Get Okta account returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.OktaIntegrationApi(configuration);

// there is a valid "okta_account" in the system
const OKTA_ACCOUNT_DATA_ID = process.env.OKTA_ACCOUNT_DATA_ID as string;

const params: v2.OktaIntegrationApiGetOktaAccountRequest = {
  accountId: OKTA_ACCOUNT_DATA_ID,
};

apiInstance
  .getOktaAccount(params)
  .then((data: v2.OktaAccountResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

PATCH https://api.ap1.datadoghq.com/api/v2/integrations/okta/accounts/{account_id}https://api.datadoghq.eu/api/v2/integrations/okta/accounts/{account_id}https://api.ddog-gov.com/api/v2/integrations/okta/accounts/{account_id}https://api.datadoghq.com/api/v2/integrations/okta/accounts/{account_id}https://api.us3.datadoghq.com/api/v2/integrations/okta/accounts/{account_id}https://api.us5.datadoghq.com/api/v2/integrations/okta/accounts/{account_id}

Overview

Update an Okta account. This endpoint requires the manage_integrations permission.

Arguments

Path Parameters

Name

Type

Description

account_id [required]

string

None

Request

Body Data (required)

Expand All

Field

Type

Description

data [required]

object

Data object for updating an Okta account.

attributes

object

Attributes object for updating an Okta account.

api_key

string

The API key of the Okta account.

auth_method [required]

string

The authorization method for an Okta account.

client_id

string

The Client ID of an Okta app integration.

client_secret

string

The client secret of an Okta app integration.

domain [required]

string

The domain associated with an Okta account.

type

enum

Account type for an Okta account. Allowed enum values: okta-accounts

default: okta-accounts

{
  "data": {
    "attributes": {
      "auth_method": "oauth",
      "domain": "https://example.okta.com/",
      "client_id": "client_id",
      "client_secret": "client_secret"
    },
    "type": "okta-accounts"
  }
}

Response

OK

Response object for an Okta account.

Expand All

Field

Type

Description

data

object

Schema for an Okta account.

attributes [required]

object

Attributes object for an Okta account.

api_key

string

The API key of the Okta account.

auth_method [required]

string

The authorization method for an Okta account.

client_id

string

The Client ID of an Okta app integration.

client_secret

string

The client secret of an Okta app integration.

domain [required]

string

The domain of the Okta account.

name [required]

string

The name of the Okta account.

id

string

The ID of the Okta account, a UUID hash of the account name.

type [required]

enum

Account type for an Okta account. Allowed enum values: okta-accounts

default: okta-accounts

{
  "data": {
    "attributes": {
      "api_key": "string",
      "auth_method": "oauth",
      "client_id": "string",
      "client_secret": "string",
      "domain": "https://example.okta.com/",
      "name": "Okta-Prod"
    },
    "id": "f749daaf-682e-4208-a38d-c9b43162c609",
    "type": "okta-accounts"
  }
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

/**
 * Update Okta account returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.OktaIntegrationApi(configuration);

// there is a valid "okta_account" in the system
const OKTA_ACCOUNT_DATA_ID = process.env.OKTA_ACCOUNT_DATA_ID as string;

const params: v2.OktaIntegrationApiUpdateOktaAccountRequest = {
  body: {
    data: {
      attributes: {
        authMethod: "oauth",
        domain: "https://example.okta.com/",
        clientId: "client_id",
        clientSecret: "client_secret",
      },
      type: "okta-accounts",
    },
  },
  accountId: OKTA_ACCOUNT_DATA_ID,
};

apiInstance
  .updateOktaAccount(params)
  .then((data: v2.OktaAccountResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

DELETE https://api.ap1.datadoghq.com/api/v2/integrations/okta/accounts/{account_id}https://api.datadoghq.eu/api/v2/integrations/okta/accounts/{account_id}https://api.ddog-gov.com/api/v2/integrations/okta/accounts/{account_id}https://api.datadoghq.com/api/v2/integrations/okta/accounts/{account_id}https://api.us3.datadoghq.com/api/v2/integrations/okta/accounts/{account_id}https://api.us5.datadoghq.com/api/v2/integrations/okta/accounts/{account_id}

Overview

Delete an Okta account. This endpoint requires the manage_integrations permission.

Arguments

Path Parameters

Name

Type

Description

account_id [required]

string

None

Response

OK

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

/**
 * Delete Okta account returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.OktaIntegrationApi(configuration);

const params: v2.OktaIntegrationApiDeleteOktaAccountRequest = {
  accountId: "account_id",
};

apiInstance
  .deleteOktaAccount(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"